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

2016/11/9

bouncing ball

1
2
iiuulliiaannaa iiuulliiaannaa

2017/1/4

#
no idea
danpost danpost

2017/1/4

#
You can randomly alter the direction of the ball by adding a slight turn when bouncing. So:
// instead of
turn(180);

// use something like
turn (180+(Greenfoot.getRandomNumber(9)-4));
This will add a variance of +/- 4 degrees when bouncing.
danpost danpost

2017/1/4

#
iiuulliiaannaa wrote...
still don't understand how you add the image
Use the 'image' link below the reply box.
iiuulliiaannaa iiuulliiaannaa

2017/1/4

#
img i m a stress
iiuulliiaannaa iiuulliiaannaa

2017/1/4

#
http://i68.tinypic.com/2coj0ci.jpg]no
danpost danpost

2017/1/4

#
Not the 'link' link -- the 'image' link (third one from the left).
iiuulliiaannaa iiuulliiaannaa

2017/1/4

#
oh done..the ball is going random .. thank you now i want to make another player to move vertically ... continue ?!
iiuulliiaannaa iiuulliiaannaa

2017/1/4

#
[Disallowed URL]
iiuulliiaannaa iiuulliiaannaa

2017/1/4

#
is an ? and no picture
iiuulliiaannaa iiuulliiaannaa

2017/1/4

#
danpost danpost

2017/1/4

#
iiuulliiaannaa wrote...
i want to make another player to move vertically
Add a new subclass of Actor and add code to the act method to have objects of the class move up and down.
iiuulliiaannaa iiuulliiaannaa

2017/1/4

#
{setRotation(90); if (Greenfoot.isKeyDown("up")) { move(-4); } if (Greenfoot.isKeyDown("down")) { move(4); } setRotation(0); } I have done like this...is still something the last question for today is how I am i add the score system? and where it should be placed thank you a lot
danpost danpost

2017/1/4

#
Start with int values in your World subclass, one for the score of each player. Then refer to my Value Display Tutorial scenario if you want the scores displayed.
iiuulliiaannaa iiuulliiaannaa

2017/1/4

#
i didn t get nothing from that chat :)) I will try at home tonight ...i will read something about the score table and maybe i will figure it out Thank you a lot hope I will find you tomorrow again :D have a nice evening..or day ..we have different times :)
You need to login to post a reply.
1
2