hover, check, add subtract, destroy sprites undern

Get help using Construct 2

Post » Sat Jul 28, 2012 11:54 am

I wanna make part of a game that while your hovering over an area with you mouse it will display a several of the same sprite in a row but each are a different animation. When one of them is clicked it will check to see if the player has enough points/resources and then check to see if that's the correct choice. If not one or more will be taken away, reducing the player resources, and that sprite animation disappears. If so a point/asset will be given increasing a value/resource, and the rest of the animations in that hover area, including the ones behind the animated sprites, disappear revealing what is underneath. I want the player to be able to hover, click, fail, hover elsewhere, comeback and try again if desired.

I'm new to construct and I haven't gotten much setup yet so if I should have something like an array or instance thing or global variable etc I need to know. If you know of tutorial/s that would help that would be really helpful.
B
13
S
4
G
2
Posts: 26
Reputation: 2,429

Post » Sat Jul 28, 2012 2:11 pm

[QUOTE=blazah99]When one of them is clicked it will check to see if the player has enough points/resources and then check to see if that's the correct choice. If not one or more will be taken away, reducing the player resources, and that sprite animation disappears. If so a point/asset will be given increasing a value/resource[/QUOTE]

What do you mean by "the correct choice"? And you seem to be using the term "resources" and "points" in different contexts, could you please make it a bit more clear?
B
27
S
8
G
8
Posts: 903
Reputation: 8,452

Post » Sat Jul 28, 2012 10:25 pm

[QUOTE=Nimtrix] What do you mean by "the correct choice"? And you seem to be using the term "resources" and "points" in different contexts, could you please make it a bit more clear?[/QUOTE]

Sure. The Player will have a sort of inventory, example: Happy Faces = 1, Normal Faces = 3, Angry Faces = 0. In the hover area if the player clicks on the Angry Face to try and place his own he can't because he has 0, if he clicks on the Happy Face if correct he uses up his Happy Face(setting his inventory of it to 0) but gains either a Normal, Angry, or even another Happy face and destroys everything in the hover area revealing the contents(having been covered up by other sprites) for the player. At some point in the game(end of page 11 since its a comic) it will add up the remaining total in the inventory for score.

After I learn how to do this I want it to be able to destroy sprite objects elsewhere that aren't in that particular hover area unlocking pages, secrets, and other areas.

At the moment I have the same sprite object holding all the different animations or Happy, Normal, Angry, etc if that matters.
Heres the .capx file of the comic game I'm working on, it has a few noticeable bugs already. https://www.dropbox.com/s/xfqzwlhos8ja7em/LL%20Game.capxblazah992012-07-28 22:36:24
B
13
S
4
G
2
Posts: 26
Reputation: 2,429

Post » Sun Jul 29, 2012 4:46 am

Something like this?

HoverMenu.capx (r99)
B
27
S
8
G
8
Posts: 903
Reputation: 8,452

Post » Sun Jul 29, 2012 9:25 am

Very close. The Sprite has multiple animations with multiple frames for that animation(ex: Happy has 3 frames, Normal has 3, Angry has 3). When one is clicked that animation is destroyed because the player tried that one and it wasn't correct, so he can't choose it again.

I was also planning on their are multiple faces for the game(ex: Alex, Tommy, Jason, etc) so this structure probably wont work for that, or at least easily.

I worked on it some more but it would be a lot of coding doing it this way but its closer to what I had i mind.

HoverMenu.capx (r99) - almost got itblazah992012-07-29 09:28:09
B
13
S
4
G
2
Posts: 26
Reputation: 2,429


Return to How do I....?

Who is online

Users browsing this forum: 99Instances2Go, mnashwan, shinkan, stylie1, tarek2 and 10 guests