Sticky? Please?
Create the following sprites:
Left wall
Right wall
Top wall
Bottom wall
Make these long lines that border your project
--------------------------------------------------------------------
Ball
Make this a circular ball about the size of a pea in real life.
------------------------------------------------------------------------------------
------------------------------------------------------------------------------------
Make these variables:
A
B
***********************************
Add this code in the ball:
**************************
To reflect:
***************************
When flag clicked
forever {
if touching left wall or right wall
set A to direction
set B to 90 - A
Point in direction ((B * 2) + A)+180)
}
***************************
When flag clicked
forever {
if touching Top wall or Bottom wall
set A to (direction - 270)
set B to 90 - A
Point in direction ((90 + A)+(B * 2))
}
********************************
To make the ball move:
********************************
When flag clicked
forever {
move 2 steps
}
Hope it helps!
SKRATCHER
"this'll SKRATCH ya! "
Last edited by SKRATCHER (2007-06-25 01:27:54)
Offline
A and B can be variables. Walls can be sprites.
Could you explain this to me? I don't get why you said this -->.
Offline