Hello everbody!
Can somebody help me with sliding collision code for my sprites? i think i've got the collision code ready:
// Basic Setup
Sync On
Sync rate 60
Backdrop On
D3D_Init
// Fonts
D3D_Font 1, "Arial", 12, 0, 0, 1
// Vars
NX = 100
NY = 100
// Make Paddle
D3D_Box 0, 0, 10, 100
Get Image 1, 0, 0, 10, 100
CLS
// Make Wall
D3D_Box 0, 0, 30, Screen Height()
Get Image 2, 0, 0, 30, SCreen Height()
CLS
// Sprites
Sprite 1, NX, NY, 1
Sprite 2, Screen Width()-Image Width(2), 0, 2
Do
NX = NX+((RightKey()-LeftKey()))*5
NY = NY+((DownKey()-UpKey()))*5
Sprite 1, NX, NY, 1
Sprite 2, Screen Width()-Image Width(2), 0, 2
C = Sprite Collision(1, 2)
If C
NX = OX
NY = OY
EndIf
OX = NX
OY = NY
D3D_StartText
D3D_Text 1, Screen Width()/2, 0, 1, "FPS: "+Str$(Screen Fps())
D3D_Text 1, Screen Width()/2, 15, 1, "Sprite Collision: "+Str$(C)
D3D_EndText
Sync
Loop
but how do i make it slide? Oh btw this code uses D3D for the drawing stuff, but if you don't have it you can remove the D3D text part and just substract d3d from every line of code. Thanks for any input!