I create a map and a character.. now, i use the keyboard to move a character in the map, but i have many question.
What is the theory for collisions and event?
I build a map so:
var map = {
[0, 0, 0],
[0, 1, 1],
[0, 0, 1]
}
For example, 0 is water, and 1 is grass. My class render the canvas with this matrix, associating the values with the images.
The problem is: my character, walking in the water!
Should I create a new matrix? For example:
var map = {
[{0, event}, {0, event}, {0, event}],
[{0, event}, {1, event}, {1, event}],
[{0, event}, {0, event}, {1, event}]
}
...is the correct way?
I don't find any tutorial for solve this problem!
Thanks ^^






