Grid Based Block Placement

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

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

    scirra.com/forum/tile-based-digging-games_topic44909.html

  • Thanks but, what do I do with those? I looked through Construct and can't find where to use them ( Major newb. )

  • go to the thing your dragging and set position

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

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • small example from my tower defense for draging and dropping towers.

    <img src="http://i.imgur.com/H8uipQSl.jpg" border="0" />

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

    mediafire.com/download/hmttf20lbk2znd3/project.capx

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)