Spawn object from a specific tile

Get help using Construct 2

Post » Tue Mar 04, 2014 2:31 pm

Hi everybody,

I like to make this method for spawn my object where a specific tile is on the map.

when I make a multiple level with a different map, to make easy, I would like to spawn some objects (coins...etc) where a specific tile is on the map, and after that delete the tile.

I think is possible with a collision, but without collision is possible? I have this dubt...

someone have some suggetion?

thank you very much!!
B
21
S
9
Posts: 298
Reputation: 2,967

Post » Tue Mar 04, 2014 3:09 pm

Use TileToPosition system expression to spawn on a specific tile.
Do you want it to be spawned on colliding tile?
I will not let you reach the sisters
Nature Forums
B
11
S
5
G
2
Posts: 496
Reputation: 2,306

Post » Tue Mar 04, 2014 5:19 pm

Doc Ai wrote:Use TileToPosition system expression to spawn on a specific tile.
Do you want it to be spawned on colliding tile?


I would like, when layout start, just spawn object where some tile are on the tilemap... i post the capx...

I can do it with a collision maybe, but I prefer the first method... but I don't know how I can do it...

Thank you
You do not have the required permissions to view the files attached to this post.
B
21
S
9
Posts: 298
Reputation: 2,967

Post » Wed Mar 05, 2014 9:11 am

Top left tile is zero and so on....
You do not have the required permissions to view the files attached to this post.
I will not let you reach the sisters
Nature Forums
B
11
S
5
G
2
Posts: 496
Reputation: 2,306

Post » Wed Mar 05, 2014 10:06 am

Doc Ai wrote:Top left tile is zero and so on....


thank you for the reply, but I mean,

I need to spawn the object where the tilemap are in different way, but maybe is not possible... because with this method I can spawn the object with the specific x and y...
B
21
S
9
Posts: 298
Reputation: 2,967

Post » Wed Mar 05, 2014 11:04 am

Ribis wrote:I need to spawn the object where the tilemap are in different way, but maybe is not possible...

I don't understand. :?: Can you draw a picture?


Ribis wrote:because with this method I can spawn the object with the specific x and y...

No.It spawn on tiles.For example,TiletoPositionX(1), spawn it on the 2nd tile horizontally(Since it starts with zero)
I will not let you reach the sisters
Nature Forums
B
11
S
5
G
2
Posts: 496
Reputation: 2,306

Post » Wed Mar 05, 2014 10:24 pm

Doc Ai wrote:
Ribis wrote:I need to spawn the object where the tilemap are in different way, but maybe is not possible...

I don't understand. :?: Can you draw a picture?


Ribis wrote:because with this method I can spawn the object with the specific x and y...

No.It spawn on tiles.For example,TiletoPositionX(1), spawn it on the 2nd tile horizontally(Since it starts with zero)


yes different but it's the same... because I need to draw the code anyway... and with the tilemap you can't set a perfect axis....

my method it's for save time, when you draw on the tilemap, you can save the tilemap in one JSON file... I'm thinking about if is possible to spawn the object where the tilemap is without write anything...

like:

for each single tile, where the tile is "1", spawn a object...

with the collision you can do it, make a big vertical line and move in horizontal or vertical, and when the "big line" touch a tile numer "1", the "big line" spawn a new object where the tile number 1 is... I can do it actually but I would prefer without "scanning"

thank you for the reply :D
B
21
S
9
Posts: 298
Reputation: 2,967

Post » Thu Mar 06, 2014 5:33 am

I'm assuming you're after something like this.

https://dl.dropboxusercontent.com/u/108 ... lemap.capx
Using R243 for all examples
B
69
S
20
G
6
Posts: 379
Reputation: 9,699

Post » Thu Mar 06, 2014 2:23 pm

emoaeden wrote:I'm assuming you're after something like this.

https://dl.dropboxusercontent.com/u/108 ... lemap.capx


yes, this is a perfect example!!

thank you very much :)
B
21
S
9
Posts: 298
Reputation: 2,967


Return to How do I....?

Who is online

Users browsing this forum: rayolf and 23 guests