Simple collision question 2D

Blitz3D Forums/Blitz3D Beginners Area/Simple collision question 2D

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

how to handel 2D collsion like a rpg game ?

I use this
If ImagesCollide(sprite1,x%,y%,a%,berg1,200,200,0)

but than the moving object is hanging in a tree.
I thought mmm then I change the x and y -1 or +1 but that's not working because you can walk arround the tree.

There is no function to reset the Collision.

;some code here
wend
;some code here

Collide()

	;move
	If KeyDown(205) Then ;right
		x%=x%+1
		a%=3
	End If
	If KeyDown(203) Then ;left
		x%=x%-1
		a%=9
	End If
	If KeyDown(200) Then ;up
		y%=y%-1
		a%=0
	End If
	If KeyDown(208) Then ;down
		y%=y%+1
		a%=6
	End If

	DrawImage sprite1,x%,y%,(sprite1_frm+a%)
	
	a% = "" ;idle
Flip
Wend
End

Function Collide()
	If ImagesCollide(sprite1,x%,y%,a%,berg1,200,200,0) Then
		Text 250,250,"Now i Stop walking :) and i can't move again stuck in a tree"
	;But I want to walk again 
	EndIf
End Function