Can Someone Check Out My File?

Get help using Construct 2

Post » Tue Jul 16, 2013 12:03 pm


Hi everyone I pulled an all nighter,No pain no gain
I was wondering how i can make my premade Grid follow and snap to the grid ingame so i can place tiles more accurate,right now my tiles are going where ever they want and its looking horrible.

Here is the demo to check out.
Koolville DEMO

arrows = movement

hold left mouse to destroy
left click an empty space to build is what im trying to achieve but also keeping it with the ingame grid.
Im also not using arrays.RookieDev2013-07-16 23:08:20
GMO FOOD = DEATH
B
23
S
9
G
5
Posts: 567
Reputation: 6,368

Post » Tue Jul 16, 2013 12:27 pm

try moving your sprite origin to the bottom right,

if its still off try an other corner.
B
4
S
1
Posts: 51
Reputation: 502

Post » Tue Jul 16, 2013 12:32 pm

I don't know how you place your grid right now, surely with a pin to the player.
Instead, place it by setting every tick the grid position to (round(player.X/tilesize)*tilesize) + offsetX
(round(player.Y/tilesize)*tilesize) + offsetY
where offsetX and Y are constants initialized depending on your grid origin. (ho, and remove the pin ^^)
This way, the grid will only be positioned on tile places, making it a lot nicer. It won't follow the player smoothly though, but you can't have both ^^
B
17
S
8
G
4
Posts: 461
Reputation: 6,097

Post » Tue Jul 16, 2013 6:33 pm

@Guizmus Thank you @ GeneratorX Thank you aswell

Guizmus i was wondering how i went about that,I have that same code but i did not make it every tick and i also did not take PIN off.Thank you
GMO FOOD = DEATH
B
23
S
9
G
5
Posts: 567
Reputation: 6,368

Post » Tue Jul 16, 2013 6:47 pm

Ok the only issue im having now is,I had my grid sprites sticking to my player with PIN now since i have it off i only have one single cell my grid of sprites will not stick together this way?
I can only get one single cell to appear and how would i go about pinning this,If i cant use the pin function?
@Guizmus
GMO FOOD = DEATH
B
23
S
9
G
5
Posts: 567
Reputation: 6,368

Post » Tue Jul 16, 2013 6:48 pm

@RookieDev
I'm not sure I understand your question. I can make you an example tomorrow if that's what you need. How did you do it ? Is it working right now ? Can you give a sample capx for testing ?
B
17
S
8
G
4
Posts: 461
Reputation: 6,097

Post » Tue Jul 16, 2013 6:52 pm

In my Demo you can see that my grid of sprites are all individual sprites that are pinned to my objects position correct?
Now that i have taken pin off my sprites nolonger stay together as a group of Cells but now there is just one single cell behind my player.If i use this method how can i keep my GRID TOGETHER.
Hope that makes more sense.And i do not need a capX i just need you to explain it to me if you can.
GMO FOOD = DEATH
B
23
S
9
G
5
Posts: 567
Reputation: 6,368

Post » Tue Jul 16, 2013 6:58 pm

My computer is down right now, so I'm having hard time explaining and testing, sorry.
I wouldn't use a sprite for the grid, but a tiledBackground, as it's the same sprite repeated X times. With a single object to move, it would be easier.
If you need to keep N sprites for any reason, then you'll have to add a different offset for each one, and keep track of witch cell is witch (lots of events/variables for this though).
If you don't use an every tick, how do you do it right now ? a condition "Player.plateform Is moving" could do it (witch is also an every tick with a condition by the way).

Hope this helps, I'm trying my best ^^
B
17
S
8
G
4
Posts: 461
Reputation: 6,097

Post » Tue Jul 16, 2013 7:04 pm

@Guizmus I had it set as a condition that ran every tick but the platformer movement sounds alot more optimized and actually sounds a hell of alot better.
I didnt think to make a tiled backround for the grid because i thought that it would register it as only one sprite and not a grid
I stand corrected,and you are helping alot,I get alot more from the forums than tutorials,I like to be social and hands on thats the best way to learn.Thanks For all of your input and your help so farRookieDev2013-07-16 19:07:49
GMO FOOD = DEATH
B
23
S
9
G
5
Posts: 567
Reputation: 6,368

Post » Tue Jul 16, 2013 7:44 pm

I am still having issues when my player is on the ground,The tiled grid is not matching up with the blocks i snapped to the grid in my layout,Does anyone else have any clues on how to make this accurate?
I can see that it is offsetting and i dont know why,When it should be behind my player and snapping to the grid as i walk in an acurate fashion.

I think i just found out that I cant detect offsetting on a tiled backround! That really sucks i guess i will be going back to using single sprites for this grid.RookieDev2013-07-16 19:57:40
GMO FOOD = DEATH
B
23
S
9
G
5
Posts: 567
Reputation: 6,368

Next

Return to How do I....?

Who is online

Users browsing this forum: ankas, iBarin, whitephon, WhosWho and 12 guests