Can a Mouse Click Detect an objects UID?

Get help using Construct 2

Post » Tue Jul 16, 2013 5:20 am

Well you can have it all. I made this example especially for you.
ImageImageImageImage
B
156
S
64
G
41
Posts: 2,589
Reputation: 34,603

Post » Tue Jul 16, 2013 5:26 am

[QUOTE=shinkan] Well you can have it all. I made this example especially for you.[/QUOTE]
Thank you @shinkan seeing this really helped me out alot.
GMO FOOD = DEATH
B
23
S
9
G
5
Posts: 567
Reputation: 6,368

Post » Tue Jul 16, 2013 6:47 am

@shinkan There is a bug in this capX,When i click one tile then the other a cracking sprite is left behind.It creates two cracking sprites and breaks the digging function.Is there a way to fix this?RookieDev2013-07-16 06:48:24
GMO FOOD = DEATH
B
23
S
9
G
5
Posts: 567
Reputation: 6,368

Post » Tue Jul 16, 2013 6:54 am

Mouse: On Left button released -> Sprite2: Destroy


Edit: This is very basic system. If You want to keep using it then You should really make some improvements. Like currently breaking block. While breaking the block try to move your mouse over different one. You will see that block over mouse cursor will be destoryed even when breaking animation is playing over completly different one.shinkan2013-07-16 07:00:24
ImageImageImageImage
B
156
S
64
G
41
Posts: 2,589
Reputation: 34,603

Post » Tue Jul 16, 2013 6:59 am

Awesome i was trippin alittle when it broke,I have so much on my mind i could not even see that little aspect to fix this.Thanks @shinkan. I did manage to incorperate touch controls with your example and it works flawless.
I want to know what you think about me using a premade grid to dictate where the player has the reach to set blocks? I figured it would be just as good as using arrays,the only issue i have is am i able to have the player place a block ingame but have it still snap to the grid? I dont want the player to go and lay a block but have it offsetting at an uneven position.
GMO FOOD = DEATH
B
23
S
9
G
5
Posts: 567
Reputation: 6,368

Post » Tue Jul 16, 2013 7:05 am


This will snap newly created blocks to 32x32 grid.
ImageImageImageImage
B
156
S
64
G
41
Posts: 2,589
Reputation: 34,603

Post » Tue Jul 16, 2013 7:09 am

@shinkan most people would maybe say thank you and just use this but i want to ask you what is happening there?
I think i understand that "round" is rounding up the number correct?
But where does the 16)/32)*32 come in im lost looking at this.
Most stuff after i see it i can instantly tell how it works but this is alittle tricky.
Thank you by the way.
GMO FOOD = DEATH
B
23
S
9
G
5
Posts: 567
Reputation: 6,368

Post » Tue Jul 16, 2013 7:28 am

I think a capx example will help you understand better.shinkan2013-07-16 07:28:19
ImageImageImageImage
B
156
S
64
G
41
Posts: 2,589
Reputation: 34,603

Post » Tue Jul 16, 2013 7:34 am

That is amazing @shinkan I never seen anyone put it that way before,This capX should be showcased in the tutorials section! you would help alot of people understand.Thank you for showing me this,I can see the difference in each expression.
GMO FOOD = DEATH
B
23
S
9
G
5
Posts: 567
Reputation: 6,368

Previous

Return to How do I....?

Who is online

Users browsing this forum: NN81, Yahoo [Bot] and 4 guests