How do I make a grid/tile-based game?

Get help using Construct 2

Post » Fri Mar 27, 2015 11:05 pm

I want to know how to make a grid/tile-based game. Say you are making a game where you can drag and drop sprites on to the screen and you can make a scene of some sort, like a city, but you don't want it to be able to placed just anywhere, only on the grid. How would I do that?
B
4
S
1
Posts: 3
Reputation: 367

Post » Mon Mar 30, 2015 6:27 pm

For drag and drop, you have a built in behavior.
About gris, just set the position every tick or at a trigger to round(yourposition*32)/32
32 can be replaced by your grid size

(please note that i wrote that from my memory, the code may not work, tell me if this is the case, i will check later ;))
http://armaldio.xyz - Image - Join now our Discord Server ;) - https://discord.gg/0eLPLj96B4tUr1D3

If you like my work you can donate some bucks ;)

Image
B
54
S
16
G
1
Posts: 245
Reputation: 5,583

Post » Mon Mar 30, 2015 10:11 pm

Yeah, it doesn't work. Unless I'm doing the trigger wrong though. I scratched the idea of the drag and drop city building game for one where you click and it makes the building if that has anything to do with it.
B
4
S
1
Posts: 3
Reputation: 367

Post » Mon Mar 30, 2015 10:47 pm

RexBoard & SquareTx or HexTx
https://www.ravenheart.ca/home
Company name changed to avoid Facebook-type shenanigans

"Someone once told me I bite off more than I can chew...

I told them I would rather choke on greatness than nibble on mediocrity."
B
22
S
6
G
1
Posts: 1,370
Reputation: 4,734

Post » Mon Mar 30, 2015 11:17 pm

Please see this capx for a demonstration using a tilemap.

https://dl.dropboxusercontent.com/u/706 ... ample.capx
Nothing goes unanswered!
B
24
S
5
G
1
Posts: 434
Reputation: 3,446

Post » Tue Mar 31, 2015 8:01 pm

I'm not talking about tilemaps. I'm talking about a Simcity-like game, but you are restricted to putting buildings on a grid.
B
4
S
1
Posts: 3
Reputation: 367


Return to How do I....?

Who is online

Users browsing this forum: ColombageEnPLS, darkrealos, pmerineau, Yahoo [Bot] and 6 guests