I've been messing around, tryin' to do Sprite Collision in dbp but I have no idea what to do, I just wanna make it so that when my char hits the other sprite then my char stops but i dont know what to do, help please?
Start:
Sync on : Sync Rate 100
`Players Commands
pm#=1.0
Cls Rgb(0,255,0)
center text 20,5,"Up"
Get Image 1,0,0,40,40
Sprite 1,300,200,1
offset sprite 1,sprite width(1) / 2,sprite height(1) / 2
`A.I.1's Commands
Cls Rgb(255,0,0)
center text 20,5,"A.I.1"
Get Image 2,0,0,40,40
Sprite 2,100,100,2
Do
Gosub Collision
Gosub PlayerMovement
Sync
Loop
`Players Movement Commands
PlayerMovement:
If Upkey()=1 Then Move Sprite 1,+pm#
If Downkey()=1 Then Move Sprite 1,-pm#
If Upkey()=1 Then Move Sprite 1,+pm#
If Rightkey()=1 Then angle#=angle# +2.0
If Leftkey()=1 Then angle#=angle# -2.0
Rotate Sprite 1,angle#
Return
Collision:
If Sprite Hit(1,2)
endif
Return