In this video I expand on the tile map we made earlier. I show you ONE method of detecting wall collision with a character that moves on screen. Check it out!
I followed both of your tutorials and now I've made my first tile map! Your tutorial really helped because I ran into problems with other ones I tried.
question: using your tutorials plus my knowledge of coding and old game design, I devised a means of having multiple canvases in a single Div (that way I could create several smaller maps instead of one giant one). Then, having each canvas element in an array, used a For Loop so that each would fill in with the correct sprites which worked swimmingly! However, the same did not work for collision detection; for the record, it created the collision for each canvas but overlaid them all on the first canvas instead of each one individually. so I was wondering if you had any idea how I could get the collision drawn on each individual canvas? I realize that ctx is set to the first canvas but don't know how to apply it to all 3 canvases. If you had any ideas, I would be grateful!
Wow that's awesome!! Unfortunately the answer is you need to make ctx for each canvas. Frank's Laboratory does a great Frogger video that utilizes this logic. Check out this video: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-GXvNEwu9cgM.html @8:00 Frank works with multiple ctx and canvas elements. Hope this helps!!
@@chucksresume7203 I've figured out that instead of using multiple canvases in a grid, I can just use one giant canvas and combiner multiple smaller map arrays into a larger one; in this case, I created 2D arrays for each map square, then organized each map into one 2D array called overworld. however, each map array is just getting drawn over each other instead of side by side as organized in the overworld array. Do you know of any means to move to a different point of a larger canvas to draw each map array? (IE: MapA1 is in the top left corner, MapA4 is in the top right). thank you for your time