Can anyone teach me something about map making? I've made a game where theres only a floor, but I don't know how to add walls or anything thats not the floor. I've seen codes where it has a bunch of numbers, something like this
10000000000000000001
11111100000000111111
10000000000000000001
11111111111111111111
I think it works like this. All the 0s are nothing or air, and all the 1s are platforms.
Is there any imformation on this code?
I need tutorials on Map making and collision
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
- kikito
- Inner party member
- Posts: 3153
- Joined: Sat Oct 03, 2009 5:22 pm
- Location: Madrid, Spain
- Contact:
Re: I need tutorials on Map making and collision
When I write def I mean function.
Re: I need tutorials on Map making and collision
With your tile tutorial Kikito. How would you proceed with making a functional block detection system. I can't seem to figure out how to look up the correct character from quadInfo and use it in my collision function.
- kikito
- Inner party member
- Posts: 3153
- Joined: Sat Oct 03, 2009 5:22 pm
- Location: Madrid, Spain
- Contact:
Re: I need tutorials on Map making and collision
Assuming that your characters are smaller than the cells in your game, that they start in a "normal" (not wall) cell, and that they don't move fast enough to "completely cross" a cell in a single update, the simplest way to do collision with a map is this one:
1. Determine on which cell your character is (the cell where the central point of his "feet" are).
2. If your character is moving up,
3. And the cell "up" from the current cell is "non-walkable"
4. Move the character "back down" until he's not touching the cell "up" any more.
5. Repeat steps 2,3,4 for "left", "down" and "right".
1. Determine on which cell your character is (the cell where the central point of his "feet" are).
2. If your character is moving up,
3. And the cell "up" from the current cell is "non-walkable"
4. Move the character "back down" until he's not touching the cell "up" any more.
5. Repeat steps 2,3,4 for "left", "down" and "right".
You need to look in tileTable, not in quadInfo.Refsa wrote:I can't seem to figure out how to look up the correct character from quadInfo and use it in my collision function.
When I write def I mean function.
Who is online
Users browsing this forum: Bing [Bot], Google [Bot] and 2 guests