![]() A year ago I was the one asking questions here so I'm quite new at answering other peoples questions. Okay a lot of code to go through (okay maybe not a lot), but I hope that at least some of what I said makes sense. RemoveObject(attempts) This removes the attempt balls from right to left depending on how many attempts you have left. GameIsRunning = true Here I declare that the game is running because you spawned a new ball and therefore you should not be able to spawn another before the current ball is lost.ĪttemptsCounter- When you spawn a new ball by pressing the spacebar you lose an attempt. attemptsCounter > 0 checks how many attempts the player has left. The gameIsRunning checks wether the game is running and by that I mean that a ball is in play, so basicly this secures that you can't spawn a new ball while another ball is in play (you should therefore add gameIsRunning = false to the place in your code where you check if the ball is lost and you have to spawn a new one). The problem is that if i add more than one block to the world, they all change image at the same time even when. On the last image change, the block is removed. I have the ball and block code so that every time the ball hits a block, the block image changes to a more degraded version. Secondly gameIsRunning = false is a boolean meaning that it's a datatype which can be true og false. so im making a simple breakout game with degrading blocks. First of all Greenfoot.isKeyDown("space") checks that space is pressed. It's just almost only guys who program.įirst of all the act method gets called frequently.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |