
-----------------------------------
rookie
Tue Feb 17, 2004 1:41 pm

boucing ball help with the code
-----------------------------------
i have just started turing in my class, and i really have no idea wat to do i understand somethings but not alot i need to do a program like amovie im asking if some one could help me with how i need to make a simple ball bounce! :lol: so if anyone could help in anyway, that would be awesome!

-----------------------------------
Paul
Tue Feb 17, 2004 2:26 pm


-----------------------------------
check this out
http://www.compsci.ca/v2/viewtopic.php?t=3525
or/and
this
http://www.compsci.ca/v2/viewtopic.php?t=3704

-----------------------------------
Maverick
Tue Feb 17, 2004 3:48 pm


-----------------------------------
heres my ball thing

%n00bish bouncing ball 
setscreen("nocursor") 
setscreen("graphics:400;350") 
var ballx,bally,ballxdir,ballydir:int 
drawfillbox(1,1,400,350,white) 
randint(ballx,0,maxx) 
randint(bally,0,maxy) 

ballxdir:=1 
ballydir:=1 

loop 
    drawfilloval(ballx,bally,5,5,12) 
    delay(1) 
    drawfilloval(ballx,bally,5,5,0) 
    
if ballx>maxx and ballxdir>0 then 
ballxdir:=-ballxdir 
elsif ballx0 then 
ballydir:=-ballydir 
elsif bally maxu or ballu < 0 then
   bally *= -1
end if


bally *= -1 
is the same as
bally := bally * -1

-----------------------------------
rookie
Thu Feb 19, 2004 10:44 pm


-----------------------------------
ok what i need to do is make an annimation movie type thing and my idea was to make a simple ball (with a mind of its self) bouncing through out a setting i just want  the ball to do a simple bounce forward like its jumping! i know strange idea.hahaha ok so if that helps explains my idea and u can understand wat help i need thanks!

[/code]

-----------------------------------
Paul
Fri Feb 20, 2004 11:01 am


-----------------------------------
You want the ball to "have a mind of its own" you mean, jumping around like a person, not in an orderly fashion? That would mean you don't need physics, but an animation. like moving a circle around.

-----------------------------------
rookie
Fri Feb 20, 2004 2:37 pm


-----------------------------------
all i wat is for it to take little jumps. like its playing leap frog so that it does little hops. im sorry my discriptive skills suck ass

-----------------------------------
Cervantes
Fri Feb 20, 2004 4:30 pm


-----------------------------------
Well in that case you need lots of physics. :?

check out [url=http://www.compsci.ca/v2/viewtopic.php?t=3777]this topic
