How do I populate an scene with objects

Get help using Construct 2

Post » Sun Jun 26, 2016 6:47 pm

More precisely, I would like to spawn during runtime ledge helpers and attach them to corners when its possible.
Also, is it effective memory wise? or is it better to just go old fashioned way and do it by hand when creating levels?

Thanks
B
43
S
12
G
14
Posts: 488
Reputation: 10,570

Post » Mon Jun 27, 2016 4:54 pm

shameless bump
B
43
S
12
G
14
Posts: 488
Reputation: 10,570

Post » Tue Jun 28, 2016 9:26 pm

bump
B
43
S
12
G
14
Posts: 488
Reputation: 10,570

Post » Tue Jun 28, 2016 9:33 pm

like popup in a tutorial?
Image Image
B
22
S
13
G
135
Posts: 871
Reputation: 70,320

Post » Tue Jun 28, 2016 10:11 pm

Have you tried it? I don't expect any performance issues, either way you do it. Just whatever is more convenient for you.

You can have each of your corners spawn a helper sprite. Or you can put them in a container and use a system-create at x,y to create the corner and helper together. Or you can use a tilemap position of your corner tile to spawn a helper object.

You're going to need to be more specific, there are a ton of ways to spawn an object. How to do it depends on your situation.
Mistakes were made.
B
51
S
25
G
107
Posts: 1,581
Reputation: 60,458

Post » Wed Jun 29, 2016 12:37 am

yeah, tried it, but either got to spawn just one or one one each corner of every tile. I use an instance variable to determine whether they are right or left but this too didn't work.

For a better explanation, the last post on my tumblr.
The big red tiles are one of the sprite frames which is placed in corners. Attached to these ones there's a small helper. I've been trying to do it automatically rather than by hand but with no success.

http://vertexzero.tumblr.com/post/146506786218/testing-the-flow-during-the-past-weeks-ive-been
B
43
S
12
G
14
Posts: 488
Reputation: 10,570

Post » Wed Jun 29, 2016 2:49 am

If I understand, you want the game to automatically detect which tile the player is allowed to hang to?
That's an interesting question I've also tried to solve.
Your boxes around the player are to define the hitbox and the "no-grab" zone? It reminds me of an attempt I made myself (but didn't test yet) using "yes-grab" zone instead of grabable tiles, let me fetch some screenshot, and I'll explain...
B
7
S
3
G
3
Posts: 56
Reputation: 2,240

Post » Wed Jun 29, 2016 5:01 am

Is that a tilemap? Are all blocks the same or do you have specific corner type blocks, floors, and walls?
Mistakes were made.
B
51
S
25
G
107
Posts: 1,581
Reputation: 60,458

Post » Wed Jun 29, 2016 1:23 pm

@oosyrag, no is not a tilemap yet but eventually will be. For now since is just a prototype and test bed I use a sprite with 3 different frames so I know which one is for walls, floor and corners.
Collision is done with a sprite mask.

@Estecka, yeah same I've been trying to solve this but with no success. I read several tutorials that could share same methods but didn't help too much.
So far I just seem to be able to spawn them in every sprite without taking into account in which frame it is.
B
43
S
12
G
14
Posts: 488
Reputation: 10,570

Post » Wed Jun 29, 2016 1:40 pm

Glad to be on-topic !
Sorry I took so long, I forgot my way in.

Here's my attempt at making a character able to hang to cliffs. Again I didn't take the time to even code it so I only have theory:
Image
The character is facing right, and is represented by the violet box.
In order to hang to a cliff, an element of the scenery must be present in the red area on the top right (Detects a wall), but NOT in the green area. (Detects a "hole" in the wall for the character to hang to.)
B
7
S
3
G
3
Posts: 56
Reputation: 2,240

Next

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 15 guests