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

2016/11/9

bouncing ball

1
2
iiuulliiaannaa iiuulliiaannaa

2016/11/9

#
hi I have an ball which has to bouncing between two persons the first problem is i can't cross the barrier with the ball to other side (is a barrier between my people ) Should I make the barrier transparent ?but in the same time to see it? ran out of ideas can someone help me?:)
danpost danpost

2016/11/9

#
iiuulliiaannaa wrote...
I have an ball which has to bouncing between two persons the first problem is i can't cross the barrier with the ball to other side (is a barrier between my people ) Should I make the barrier transparent ?but in the same time to see it?
Making it transparent do not help as far a collisions are concerned. What class is the barrier created from? What collision detection codes are you using for the ball?
iiuulliiaannaa iiuulliiaannaa

2016/11/11

#
I have to apologise first ,I am new in greenfoot the barrier is created in actor class ?! and I have this code for the ball move(3); Actor net = getOneIntersectingObject(barrier.class); if (net!=null) { turn(180); move(1); } Actor baby_1 = getOneIntersectingObject(baby1.class); if (baby_1!=null) { move(5); } Actor baby_2 = getOneIntersectingObject(baby2.class); if (baby_2!=null) { move(5); } if you have some free time and you would like to help me I can even send the files and have a look there I have assessment at the beginning of January but I still have time to learn this ..hope so thank you
danpost danpost

2016/11/11

#
This code in your ball class:
1
2
3
4
5
6
Actor net = getOneIntersectingObject(barrier.class);
if (net!=null)
{
    turn(180);
    move(1);
}
tells the ball to turn around and move 1 pixel away from any intersecting barrier. Maybe you want to do something else other than that there; but, you really have not indicated that.
iiuulliiaannaa iiuulliiaannaa

2016/11/15

#
hi i finally get the ball into the left side ...with if (baby_1!=null) { turn(180); move(5); } What i am trying to do is to create an game between those people with complex movements and to have the score and more design things I really need help with this
danpost danpost

2016/11/15

#
I get the impression that this is a top-down view game -- am I correct? If so, then it would be necessary to track the height of the ball off the ground (basically a 3D issue), which would complicate things quite a bit; and, if you are not very familiar with programming, something you should probably avoid right now.
iiuulliiaannaa iiuulliiaannaa

2017/1/4

#
Hi I realised what you said after some documentation I just gave the turn(0) so simple now i have another question ....woow i am impressed of my knowledge ...my all is bouncing between my babies so my question is how do i do to the ball to bounce off a baby or babies in random direction...so to make the ball to go random and the baby to catch it ...for me has two ways but just theoretic ...the baby needs to me controlled or the baby has to attract the ball?! I am really appreciate that you spend time here solving problems ! thank you
iiuulliiaannaa iiuulliiaannaa

2017/1/4

#
[Disallowed URL] I don t know how to add an image over here :( I would like to show you how actually has to look
danpost danpost

2017/1/4

#
iiuulliiaannaa wrote...
I don t know how to add an image over here :( I would like to show you how actually has to look
You need to upload the image to an image hosting site like 'tinypic.com' or 'photobucket.com'; then, use the image url (not the page url) in the image link below the reply box.
iiuulliiaannaa iiuulliiaannaa

2017/1/4

#
hope this is working [Disallowed URL] if is then I have in the left side my ball code and in the left how the graphic should look like (I am very bad in this ) thank you
iiuulliiaannaa iiuulliiaannaa

2017/1/4

#
http://tinypic.com/r/2coj0ci/9 now?!
iiuulliiaannaa iiuulliiaannaa

2017/1/4

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

2017/1/4

#
Quote this to see what the text should look like to show an image here .
iiuulliiaannaa iiuulliiaannaa

2017/1/4

#
The ball can bounce off a baby or babies in random direction. Two new ‘player’ babies are added to each side of the line, that move vertically towards the ball ready to potentially bounce the ball back. Add a scoring system for each side. this is what i want to sort ...how should i do the ball to go in random direction ? and how are moving vertically the new players thank you
iiuulliiaannaa iiuulliiaannaa

2017/1/4

#
still don't understand how you add the image ... http://i68.tinypic.com/2coj0ci.jpg
There are more replies on the next page.
1
2