This site requires JavaScript, please enable it in your browser!
Greenfoot back
maartendrift
maartendrift wrote ...

2013/3/15

Question about pinball game

1
2
3
maartendrift maartendrift

2013/3/16

#
I published the game. Pinball I want to improve the following: make the game unexpected (now the Ball goes the same way every time), when the Ball is at the top of the screen I'd want the Ball to move downwards directly and remove the Ball when it is on the bottom of the screen. How can I do that?
danpost danpost

2013/3/16

#
I did not see where the 'checkSide' method gets called from to execute.
maartendrift maartendrift

2013/3/17

#
That's stupid! But now I got an other question. How can I get that the Ball bounces once at a wall. When you see the game you that the Ball turns around the whole time at the side at the left. How do I do that?
danpost danpost

2013/3/17

#
Normally, you should be asking the following: if (at left wall AND moving left) bounce if (at right wall AND moving right) bounce if (at top wall AND moving up) bounce if (at bottom wall) disappear By using the condition of the direction of movement, the condition to bounce will not be 'true' for consecutive acts. A sample: if (getX()<7 && motionX<0) motionX=-motionX; Another way to prevent the sticking to the walls is to move off the wall when the wall is found (as well as reversing direction). This will avoid the wall from being found on consecutive act methods causing multiple reversals. You will have to save the original location of the ball before moving it each act, so you know where to move it back to if you found a wall.
maartendrift maartendrift

2013/3/17

#
Thank you! It helped me a lot!
SorrelCeasar SorrelCeasar

2013/3/17

#
Can you two please like my game please
maartendrift maartendrift

2013/3/17

#
I updated my game: http://www.greenfoot.org/scenarios/7753 @SorrelCeasar I did! Do you have any suggestions for my game?
maartendrift maartendrift

2013/3/17

#
http://www.greenfoot.org/scenarios/7753 I updated my game, but suddenly the game goes very fast. And I don't know why. Who can help me?
maartendrift maartendrift

2013/3/18

#
Nobody? It's really important!
Mamang_Superhero Mamang_Superhero

2013/3/18

#
maartendrift how about changing the speed a little, please like my game...
maartendrift maartendrift

2013/3/18

#
I tried, but it doesn't work.
Mamang_Superhero Mamang_Superhero

2013/3/18

#
i think the ball doesn't keep its speed after it is fired...
maartendrift maartendrift

2013/3/18

#
No? Where is it changed then?
You need to login to post a reply.
1
2
3