Bouncer V1.1

{% trans 'Sorry, your browser does not support canvas -- please either update your browser or submit your requirements by phone or email.' %}

Accelerometer

Avatar for Purparus Purparus

Purpose: You have to "bounce" back the ball. The ball movement varies each time it bounces the walls or the "bouncer". If you miss the ball the game will end. How to play. Use the buttons to move the bouncer left or right targeting the falling ball. Variables: iTone: It contains a value to represent a high tone that will be decremented when the gave is over; iStdTimer: It is the number of loops before the stone moves down one row. In summary it determines the falling rate. When debugging the program please change this to a low value (e.g. 10); iDecrValue: This is the value to be reduced from the iStdTimer after each catch increasing the falling speed; If debugging please change this number to e.g. 1 iBouncer: It holds the position of the "bouncer". It is initial value is "2" (middle of the bottom line); bFailed: Boolean variable determining when the game is over; iColumn: Column where the stone will be shown. It may move 1 position left or 1 position right or even move in a straight line in each fall; iRow; Row where the ball is positioned. Depending on the sense of the movement it can be increased/decreased by 1 or stay (ball moving on the horizontal) iTimer: Loop counter representing the time the ball waits before move row. As more bounces you do as faster the ball moves (the initial value provided by iTimerValue is reduced by iDecrValue); iPosAnt: Saves the previous position of the bouncer in order to switch the led off. I used it instead of clear pixels to avoid led flickering; bButtonPressed: Flag to control when a button was pressed what causes the bouncer position being cleared and moved right or left. iColDirection: Variable carrying the horizontal displacement of the ball. It can be -1 (left), 0 or 1 (right) iRowDirection:Variable carrying the vertical displacement of the ball. It can be -1 (down), 0 or 1 (up) iColumnAnt: Previous column the ball was positioned before moving. It helps to determined when the iColDirection needs to be a fixed value and what is it (1 or -1) iScore: Number of hits in the ball

Report this project
Back to top