Level Creation Capx

Show us your completed creations made in Construct 2

Post » Sun Nov 13, 2011 12:32 pm

Ok to go with my save game Capx here's a level creator maybe for a sim type game, this is very basic but works, there maybe bugs,

on first screen click on Goto Editor Button
Left click to Select Road,Dirt,Water ETC
Right Click to Place on Map
To delete any items placed Hover mouse of object and press delete

I know it's far from complete, and if you delete the tiles in the left window then oopss they are gone... But it's a start for someone.

Also a snap to grid would be good for this, which i'm working on next.

Test here

Level Creator


Capx Here


Capx Download


tonycrew2011-11-13 14:04:10
B
40
S
14
G
11
Posts: 243
Reputation: 9,432

Post » Mon Dec 03, 2012 1:02 am

Hi tonycrew,

Thank you for the info. Did you incorporate a snap to grid yet?

Regards,
Shawn
B
10
S
3
G
2
Posts: 23
Reputation: 2,177

Post » Mon Dec 03, 2012 9:57 pm

No sorry i didnt get round to doing this but there are someother demos and plugins that will help with this.
B
40
S
14
G
11
Posts: 243
Reputation: 9,432

Post » Mon Dec 03, 2012 11:29 pm

There's an easy answer, Set X position to XMouse/32*32 (basically snaps to the mouse position converting it to an integer from a float) giving it a precise snapped position rather than in between integers allowing it to freely move around. I can create an example if need be.
B
17
S
4
G
5
Posts: 226
Reputation: 4,042

Post » Tue Dec 25, 2012 4:51 am

Thank you @dcrew
B
10
S
3
G
2
Posts: 23
Reputation: 2,177

Post » Sun Jan 27, 2013 1:44 pm

I did'nt quite get it. Can you send me a capx example? :)
Also I modified the version so there's 2 of each
building type so it doesn't duplicate when you try to move a block.superwifibattler2013-01-27 13:47:01
B
11
S
2
G
4
Posts: 78
Reputation: 3,292

Post » Sun Jan 27, 2013 4:20 pm

Basically set the block's X Position to the XMouse (X Position of the Mouse) devided by 32, convert that from a float to an int (Basically round it down), then times it by 32 again. (Replace 32 with the grid size you want), It's really that easy! Believe me!

So basically even in code:

int gridSize = 32;
block.Position.X = (int)Math.Floor(Cursor.X / gridSize) * gridSize;

In Construct2 it should be farely similar:

(Declare a integer variable called 'gridSize')
block   | Set X position to ( floor(XMouse/gridSize)*gridSize )

I haven't done C2 in a while but it should be something similar to that, if you still need an example please let me know!
dcrew2013-01-27 16:23:22
B
17
S
4
G
5
Posts: 226
Reputation: 4,042

Post » Wed Jan 30, 2013 6:14 pm

Or just use the % operator.

Set X position to : Mouse.X - Mouse.X % gridSize
Set Y position to : Mouse.Y - Mouse.Y % gridSizeMagistross2013-01-30 18:14:15
B
46
S
17
G
18
Posts: 847
Reputation: 13,802

Post » Sat Feb 02, 2013 12:37 pm

@Magistross
Thank you so much :) This worked perfectly!
B
11
S
2
G
4
Posts: 78
Reputation: 3,292

Post » Thu Feb 14, 2013 7:02 pm

What's the best way to output this information to use later?

I basically want to be able to give my editor to someone else to design levels. Then I import the info, from whatever file format it spits out, into my game.

I'm interested, not just in the file type, but also the layout of the information itself (arrays etc)

Thanks
B
10
S
4
G
5
Posts: 136
Reputation: 2,977

Next

Return to Completed Creations

Who is online

Users browsing this forum: Ryogo and 2 guests