• 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!

GameMaker Using tiles as event triggers for an horizontal shmup in GMS2

T

Tronco

Guest
Hi everyone.

My game (traditional old school horizontal shoot em up) uses a time based spawn system for enemy waves and all other events in general. I prefer to keep a fixed view and make everything scroll towards the player.

But designing levels this way is very time consuming and boring.

Watching the Blood Money remake in GMS2 video by Mike Dailly (A big thank you Mike for all the great games you did back in the days!) and how it handles screen scrolling, I had an idea.

Can you use tiles (or even better, sprites/asset layer) as a trigger?
So that you can assemble the whole level in the room editor, make the whole tile (or asset) layer scroll towards the view and when a particular tile enters the view it spawns an enemy in that specific coordinate?

It's like object placement but a lot more lightweight and without having to deactivate/activate the instances (which make, I think, impossible to design the level with objects this way because you can't move deactivated instances)

Does the new tile system in GMS2 make this kind of trick possible? Can it be done even in GMS1? (I never used the room editor and tiles that much...)

Thank you
 

NazGhuL

NazTaiL
Does the new tile system in GMS2 make this kind of trick possible?
Yes it is. Using the different tile function you can check on wich tile you stand and trigger things like an instance can.
It was possible with gms1 and it's still possible with gms2.
Moving tile is also possible. Looks at all the tile functions.
(tilemap_get_at_pixel, tilemap_set_at_pixel, tilemap_x/y, etc...)
 
T

Tronco

Guest
I don't need to trigger it with my sprite, i need to trigger things when a tile enters in the view, or at least when they collide with a special invisible object with the same height as the room.

Messing around with tilemap codes i've managed to trigger an action when a tile enters, but it only works with tiles placed in the upper right corner of the screen.
Maybe i don't understand well how tilemap_get_at_pixel works, but do i need to add an offset of the vertical position of that particular tile to trigger it correctly?

How do i get the vertical coordinate in a room of every single tile?
 
T

Tronco

Guest
I've managed to put out a little system based on various heights of the view, with 32x32 cell distance, doing various checks if a tile enters at various y position of the view.

Is doing all these checks the only way to do something like that? I'd really like to store in some way the position of every single tile in the room and use that to check collision with the view. Just can't figure it out how tile system works i guess.
 
Top