Looking for example or tutorial on map editing and collision detection
-
I found video tutorial code For spriteAnimation to walk a knight sprite up down left and right over a simple map I made with a grass tile repeated and random plant bushes. I created through the map editing tool a collision point flag and rectangle collision area. I can’t seem to get the code right to detect when the animated sprite knight collides with the plant tile. I have been looking through the help but I’m missing something.
On another note: Since I have 2 Nintendo Switches being shared by the family I never know which one I can access for my code. I bought another copy of Fuse4 and shared my program code between Friends (me) . That’s pretty neat.
-
@tdg8934 iv actually got the code for the knight program i can share tomorrow if you want to DM me your friend code i can share it to you.
as for your map detection you want.
collidemap(sprite)
-
Thank you again for all your help. It’s a shame the tutorial videos are not listed or there is code to download. But since my last email, I just rewatched the Video tutorial on the knight animation again and entered it into my program manually.
As far as Map marked area collision with the knight animation sprite, I would think I should use something like:
loadMap(“Map1”)
setSpriteCamera(0,0,2)
:
C1 = collideMapArea(“Bush1”, knight)
:
loop
centreSpriteCamera(0,0)
clear()
drawMap()
:
If C1 then
print(“Hit”)
update()
endif
:
repeatWhere Bush1 is a flag marked area (or rectangle marked area in yellow) of a position on my Map as I created a map in the Tools->Map Editor. When I move the knight animation sprite over or near the marked areas on the map, I never get a collision indication.
Ideas?
-
@tdg8934 To be honest typing it in manually will help in the long run, as for map collision try this
https://fuzearena.com/help/view/Map Editor
if you just draw the box it will handle the collision no need to write in the box unless your wanting something different to happen. iv also added in mynamemaplocation
video below https://fuzearena.com/forum/topic/1141/youtube-tutorial-on-named-map-locationsyou can also add layers by
drawmaplayer(0)
drawmaplayer(1)
then if you wanted you can draw your sprites in between layers