Sample Scripts

Collision Detection Sample Script

Code

Skybox.show "lagoon"
S is a Sphere having material="rock2" and pos=(2,1,0)
B is a Ninja having pos=(-1.5,-3,0) and rotate=(0,-90,0)

When S collides with B do
  S.stop
  sys.print "Ninja Hit!",color=yellow,size=5
  B.rotate(y-360)in 0.5 seconds async
  B.move(x-1.5)  in 0.1 seconds
  B.move(x+1.5) in 0.5 seconds
  sys.print ""
end do

do 100 times
  B.Idle1 async
  S.move(x-4) in 0.1 seconds
  S.move (x+4) in 1.5 seconds
end do

Leave a Reply

Your email address will not be published. Required fields are marked *

Skip to toolbar