G
Guest
Guest
I'm working on a top-down, turn-based, grid-based game with procedurally generated levels. My next step will be coding a collision system.
I seem to have two choices for collisions:
(1) Ds_grid: When the actor wants to move in a direction, I can pull the data from the grid to figure out where the actor's going and either let the actor go there (it's a floor) or else call some other action like combat (it's a monster).
(2) Objects/tiles: I can let the actor just rip out his movement action and then check the sprite's bounding box every frame; if the box overlaps with a walle tile or monster object, I can stop movement and, if appropriate, call an action like combat. I studied Heartbeast's tile-collisions tutorial, and I could do it. This would be a very different system.
I think the ds_grid is more intuitive because my game is just a data grid with sprites sprayed on top.
Soon, though, I will add shooting and projectiles, and it would be neat if an actor could zip across the map in a single turn. I'll need to research the best way to do this with the ds_grid method; presumably, I'll just check each cell in the direction of the projectile's/actor's desired movement until I find something that's not a wall, then use my same movement code with a faster speed to push the sprite all the way to the tile immediately prior to the tile with the collision, then trigger run appropriate collision events. But it nags me that, well, this is what GameMaker's built-in collision detection system was made for.
Do wiser heads have any advice for me?
I seem to have two choices for collisions:
(1) Ds_grid: When the actor wants to move in a direction, I can pull the data from the grid to figure out where the actor's going and either let the actor go there (it's a floor) or else call some other action like combat (it's a monster).
(2) Objects/tiles: I can let the actor just rip out his movement action and then check the sprite's bounding box every frame; if the box overlaps with a walle tile or monster object, I can stop movement and, if appropriate, call an action like combat. I studied Heartbeast's tile-collisions tutorial, and I could do it. This would be a very different system.
I think the ds_grid is more intuitive because my game is just a data grid with sprites sprayed on top.
Soon, though, I will add shooting and projectiles, and it would be neat if an actor could zip across the map in a single turn. I'll need to research the best way to do this with the ds_grid method; presumably, I'll just check each cell in the direction of the projectile's/actor's desired movement until I find something that's not a wall, then use my same movement code with a faster speed to push the sprite all the way to the tile immediately prior to the tile with the collision, then trigger run appropriate collision events. But it nags me that, well, this is what GameMaker's built-in collision detection system was made for.
Do wiser heads have any advice for me?