Grid Based Block Placement

Get help using Construct 2

Post » Thu Jun 06, 2013 1:45 pm

Hello! I've asked this question twice before. The first time I was linked to a forum search which only had one relevant topic, and that topic was for construct classic so I couldn't follow it. The second time I was linked to a post about grid based character movement, but that wasnt using a grid it was just turning and moving a certain amount of pixels and I can't see how I could use that to place blocks. So I ask again, how would I make a game in which the player can destroy, or place blocks but ONLY in a grid like for example, Minecraft, Terraria, etc. Please don't link me to any other "slightly" relevant posts as I don't want a re run of before.
B
5
S
1
Posts: 54
Reputation: 508

Post » Thu Jun 06, 2013 2:00 pm

for X:round((Player.X - 16) / 32) * 32 + 16
for Y:round((Player.Y - 16) / 32) * 32 + 16

This is to check on your grid (32 by 32). So if your character is on a tile and hits 3pixels in front o him you check that x with your X where you hit or where you put something. So it snaps to the grid

also:
http://www.scirra.com/forum/tile-based-digging-games_topic44909.htmlmrPeanut2013-06-06 14:53:47
B
9
S
3
G
3
Posts: 70
Reputation: 1,990

Post » Thu Jun 06, 2013 9:06 pm

Thanks but, what do I do with those? I looked through Construct and can't find where to use them ( Major newb. )
B
5
S
1
Posts: 54
Reputation: 508

Post » Thu Jun 06, 2013 9:09 pm

go to the thing your dragging and set position
B
41
S
11
G
7
Posts: 514
Reputation: 9,701

Post » Thu Jun 06, 2013 9:47 pm

Pretty sure I didn't do it right. I made it so when I left click, it creates the object I want tiled at (round((Player.X - 16) / 32) * 32 + 16 ,round((Player.Y - 16) / 32) * 32 + 16 ). When I tried that it didnt create any object. So then I made it so there is one of the object and when I drag and drop it it will snap to the grid and when I let go of it the object just dissapeared?
B
5
S
1
Posts: 54
Reputation: 508

Post » Thu Jun 06, 2013 9:52 pm

small example from my tower defense for draging and dropping towers.
B
9
S
3
G
3
Posts: 70
Reputation: 1,990

Post » Thu Jun 06, 2013 10:33 pm

As in Tower defence, do you mean top down? If so, I just want to clarify that I want to do a platformer. Not sure if that makes a difference. I really am a huge newb and I can't get it to work.
http://www.mediafire.com/download/hmttf20lbk2znd3/project.capx
B
5
S
1
Posts: 54
Reputation: 508


Return to How do I....?

Who is online

Users browsing this forum: brunopalermo and 23 guests