Julz57 Posted August 31, 2017 Share Posted August 31, 2017 Very new to Phaser and reading as much as I can before committing to using it as my game development system. My goal is to alternate views, a bit like VR, from one eye to the other. I have done this before by setting specific colours for backgrounds (x2) and Sprites (two colour versions). Person uses Red Green filters to limit view to each eye. In the past I have page flipped (RE screen drawn, then LE screen drawn) which I know is not needed in Phaser. I can just change background colour for each screen refresh which will do the job. But this introduces a potential new problem as I need to hide objects / sprites from each aye alternately as background colour changes. Am thinking I could alternate "visible" for sprites that I do not want seen in alternate cycles. Question is, will collisions be detected with an invisible object? Goal is to teach both eyes to work together but while playing a simple retro style game. Another option would be to redraw sprites to be hidden in the background colour. I saw this as an option in in the examples but don't know how resource intensive this will be. Only four colours can be used in the design process. Two for backgrounds, two for sprites. Each eye only responds to two colours. Does anyone know if this could work? A better workaround? Just thought about the depth positioning. I could place the ones to be hidden behind the background? Can I set two layers, one drawn for RE and the other for LE and then just move one forward and back as required? Thinking this might be easier to code as sprites will be children of each layer? Again will collisions be detected? Thanks Quote Link to comment Share on other sites More sharing options...
samid737 Posted September 1, 2017 Share Posted September 1, 2017 You can hide sprites or other displayobjects and keep physics running by toggling renderable: The game sounds fairly simple, four colours , guessing four objects, I don't think performance will be an issue. You can draw graphic objects and switch the color tint after some event (time or input): Julz57 1 Quote Link to comment Share on other sites More sharing options...
Julz57 Posted September 1, 2017 Author Share Posted September 1, 2017 Hi samid 737, Yes a very simple game but for a specific goal as I need to control images presented to each eye. Colour filters before each eye facilitate the latter provided that the foreground and background colours are set correctly on alternate screen draws. It's part of vision therapy or eye exercises to improve vision. I have done this before but in a C+ game engine. My background is in optometry but now retired and doing volunteer work, aka this. I was wondering if I should take the plunge and start to learn how to use Phaser and what you've told me says 'Yes'. Thanks again, samid737 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.