DemoProductions / shmup

3 stars 2 forks source link

bullets are not added to foreground #121

Open flip40 opened 7 years ago

flip40 commented 7 years ago

The detrimental effect here we are looking to avoid is when the player is not moving (other than foreground moving them along) and the bullets are falling behind. Bullets shot up/down by the player or ai should NOT be moving forwards/backwards relative to the camera. This is solved by moving the bullets into the foreground.

Need to consider/test what effects this may have on player and enemy bullet speeds (do they travel faster to the right as opposed to the left when this happens? Ideally / hopefully they travel the same speed).

ghost commented 7 years ago

Does not seem to effect player and enemy speeds

http://giphy.com/gifs/P8CVZDhRrsNGw

I also tried adjusting the foreground scroll speed to something extreme and the speeds looked the same. Will need to take a closer look at the Scroll script, it is still the exact code from the pixel nest tutorial. Maybe we can cut out things we don't need. I also remember the mention on how there were comments that looked something like javadoc

flip40 commented 7 years ago

Nice testing. Looks like adding to foreground for players and enemies is indeed the correct solution then. Scroll speed doesn't affect the local bullet speeds, which is good.

ghost commented 7 years ago

Can save a foreground reference to the weapon on Awake or Start (or maybe to the player if that would make more sense)

flip40 commented 7 years ago

I think it would make more sense on the Weapon.