help if level editor

Get help using Construct 2

Post » Sun Jun 21, 2015 7:04 pm

i am currently making a level editor right now. but i need to know if its possible to make the blocks align with the grid?
(i am using the platformer template)
B
15
S
5
Posts: 22
Reputation: 1,062

Post » Sun Jun 21, 2015 10:56 pm

Yes it's possible.
New to Construct ? Where to start

Image Image

Image Image

Please attach a capx to any help request or bug report !
Moderator
B
292
S
115
G
96
Posts: 7,295
Reputation: 70,795

Post » Mon Jun 22, 2015 3:16 am

Kyatric wrote:Yes it's possible.

may i ask how do i do such a task
B
15
S
5
Posts: 22
Reputation: 1,062

Post » Mon Jun 22, 2015 9:51 am

Well it depends on your project.
So I strongly invite you to either post your project as it stands, or search for existing references to level editors in the forums or in the tutorials.

What is the size of your grid ?
If your project is made on a 64 pixels basis (GridWidth and GridHeight and you want to place your blocks thanks to the mouse input, then what you do is that when you click to place the block, you position/create it at the
x position : int(Mouse.X / GridWidth) * GridWidth + GridWidth/2
y position: int(Mouse.Y / GridHeight) * GridHeight + GridHeight/2

Example capx made in r208
New to Construct ? Where to start

Image Image

Image Image

Please attach a capx to any help request or bug report !
Moderator
B
292
S
115
G
96
Posts: 7,295
Reputation: 70,795


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 24 guests