For the final project in the Creating Apps with Devices course (Prototype an Innovation), I’m trying to help some students make a small Galactica game in the App Lab which uses the Circuit Playground as the joystick (the Game Lab interface does not currently allow enabling the Maker Toolkit). However, I’m having some trouble with the missiles shifting on the screen during the game.
Here’s a link to my code: Galactica Prototype
Here’s a video of what the problem encounter in the app and describe below: Galactica Problem Video
Thus far I’ve successfully made the ‘hero’ move (a pointer finger) with the roll of the Circuit Playground accelerometer, and shoot missiles with the left board button. The code works to shoot the missiles correctly, but when one missile reaches the top of the screen and is removed, the remaining missiles shift to the left by ~10-15px.
I’ve also used console.log() to display the values of the arrays that are tracking the missile X positions, and they don’t seem to change even though the images are shifting on the screen.
Thanks for you help!