• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!
  • Hello [name]! Thanks for joining the GMC. Before making any posts in the Tech Support forum, can we suggest you read the forum rules? These are simple guidelines that we ask you to follow so that you can get the best help possible for your issue.

Question - Code How do you handle tiles with slopes in GMS 2.0?

H

hexdump

Guest
Hi,

After auto-convincing myself that Unity is not the right tool to create 2D games and checking GMS 2.0 I have decided to buy it because it seems a pretty nice tool.

One of the main things I want to avoid are physics. I hate physics in old-school games, so, could anybody be so kind to explain how do you handle slopes in GMS? I have been thinking about having a height map per tile but this seems a bit overkill.

On the other hand, is there a vector2, vector3 type in gamemaker?

Thanks in advance.
 
Last edited by a moderator:
A

Ariak

Guest
Vec 2 and 3 is a no sadly. There is no direct vector implementation. you will have to calc all things with x,y as two seperate variables.
@icuurd12b42 offers a set of scripts to implement vectors and associated functions here: https://marketplace.yoyogames.com/assets/300/tmc-vectors

In regards to handling slopes in GM: if they are exactly 45° my tutorial should help you: https://forum.yoyogames.com/index.p...ment-and-collision-line-without-objects.4073/
Grids are exactly like GMS2 tilemaps. No changes to the underlying logic needed: just swap out the functions. I'll prolly get around to updating it ...someday.

For slopes of any kind you'll have to resort to the heightmap per tile. This is nicely explained by @Mike here:
 
H

hexdump

Guest
Thanks a lot for the answers. Will ha ve a look at them tomorrow.
 
Top