How do I create a building in clicked sprite?

Get help using Construct 2

Post » Tue Nov 04, 2014 10:50 am

Hi, i have the following problem:
I have 3 layers
a/layer island with 6 sprites of grass (all the same with diffirent instance var) and i want to build a building when you click on any of them (and open the building layer like pop-up)
b/layer background
c/layer buildings that player clicks on 2 type of buildings and suppose create one of them at the last potition of the grass clicked

i set position of x and y at grass and i declare at what layer and x,y co ordinates the new building must be created but the building always build in the same position (1st grass sprite)
i click the grass sprite then layer opens to choose building to create ,i click on building and builds at same grass sprite all time

how can i make the actions so the new building creates in the last position clicked? in any grass sprite that i choose and click?

ty
You do not have the required permissions to view the files attached to this post.
B
4
S
1
Posts: 3
Reputation: 256

Post » Tue Nov 04, 2014 4:47 pm

............
You do not have the required permissions to view the files attached to this post.
B
67
S
24
G
7
Posts: 1,518
Reputation: 11,072

Post » Wed Nov 05, 2014 12:12 am

Thank you very much. I havent realize that so much work needed to make this. Now i can see the logic.
B
4
S
1
Posts: 3
Reputation: 256

Post » Tue Nov 11, 2014 2:16 am

Im searching it and the spawn object maybe it solve temporarilly the problem but for sure it isnt the correct method.
The correct method should be:
a/click on grass (any) and somehow his x,y coordinates saved-stored (temporarilly) somewhere, then
b/i click at the pop up object i want to create and give order to create it at those specific x,y coordinates of grass.
For sure must be a way to code it . Why to make an intermidiate object and then replace it?
Wherever i click a sprite, the coordinates must be stored and then applied to the new object that i want to create so it could be positioned to the specific place
Any ideas?
ty
B
4
S
1
Posts: 3
Reputation: 256


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 41 guests