Simple bouncing circle:
Rem Control the screen update speed
sync on
sync rate 60
Rem Sets up starting position of the circle
CircleX# = 100
Circley# = 100
Rem Generate a random angle of movement, and the speed
Angle = rnd(359)
Speed = rnd(2) + 1
Rem Calculate the 'steps' to move in x & y to move at that angle and speed
dx# = newxvalue(0, Angle, Speed)
dy# = newzvalue(0, Angle, Speed)
Rem Starts loop
Do
Rem Move the circle in the x direction, reversing the x direction if it hits the edge
CircleX# = CircleX# + dx#
if CircleX# < 0.0 then CircleX# = 0.0 - CircleX# : dx# = dx# * -1.0
if CircleX# >= screen width() then CircleX# = screen width() - (CircleX# - screen width()) : dx# = dx# * -1.0
Rem Move the circle in the y direction, reversing the y direction if it hits the edge
CircleY# = CircleY# + dy#
if CircleY# < 0.0 then CircleY# = 0.0 - CircleY# : dy# = dy# * -1.0
if CircleY# >= screen height() then CircleY# = screen height() - (CircleY# - screen height()) : dy# = dy# * -1.0
Rem Clears screen
cls 0
Rem Draws circle
circle CircleX#,CircleY#,10
rem Updates screen
sync
Loop
Quote: "Where’s the best resource for beginners?"
Did you try looking at the tutorials thread at the top of the forum?
Quote: "i.e. you can call an object into being and it operates independently of the main code?"
That *can* be done with the use of my plug-ins, but it's advanced stuff and I wouldn't suggest that you go there just yet.