[Puzzle] How to place Items on the playfield grid?

Get help using Construct 2

Post » Mon Sep 02, 2013 9:18 am

Hi,

I'm writing a puzzlegame where you need to place some items on a playfield. The game is controlled by touch controls. The playfield is some kind of a tilemap. If the user touches on some location of the tilemap he should add a new sprite directly located on top of the tile he has touched before, so that he can place some items on this "map".

How can I do it? I'm not really sure how to find the location on the grid where the player has touched so that I can place the new sprite on it?!

Thanks for any help,

Benny
B
6
S
2
Posts: 19
Reputation: 1,038

Post » Mon Sep 02, 2013 12:22 pm

B
18
S
3
G
3
Posts: 83
Reputation: 3,736

Post » Mon Sep 02, 2013 2:27 pm

you going to have to spawn new objects(sprite) on touch and set them to touched location right?

Your question about to touched location:
Off the Top of my head, can't say if it works for sure, but the recipe is here:
Click on sprite - Set position type in X input box touch.X and do same for Y

Something like that.
https://www.scirra.com/manual/119/touch
You gonna have to play aroundDUTOIT2013-09-02 14:29:30
You think you can do these things, but you can't, Nemo!
Just keep reading.
Just keep learning.
B
65
S
16
G
9
Posts: 1,429
Reputation: 12,718

Post » Mon Sep 02, 2013 2:31 pm

Should be hard at all

On Touched | Create object at ( floor(Touch.X/TileSize)*TileSize , floor(Touch.Y/TileSize)*TileSize )

Cheers
B
42
S
17
G
17
Posts: 2,247
Reputation: 17,471


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 14 guests