How do I kill, animate and display points

Get help using Construct 2

Post » Mon Jul 14, 2014 7:57 am

Hi,

I am trying to create a small game which you can test on http://candywebwork.com/game

It is an auto runner type of game, and in need of your help.

1. How do i kill the crab on falling down?
2. How can i display points with fading animation 1point for coins. 2points for cup cakes and juice and 10points for the treasure box?

Please help me in completing this game.

Thank you
B
2
Posts: 6
Reputation: 160

Post » Tue Jul 15, 2014 2:57 pm

Anyone please?
B
2
Posts: 6
Reputation: 160

Post » Tue Jul 15, 2014 3:19 pm

If you don't need the crab to be "bound to layout" you could just remove this behavior and check if it is on the layout, killing it otherwise.
Bruno

I like to eat, but I'm no cook. Why liking to play games would make you a game designer?
B
19
S
5
G
1
Posts: 530
Reputation: 2,727

Post » Tue Jul 15, 2014 3:34 pm

As for the "crab killing" you should do what BrunoPalermo said. Just destroy it once out of the layout.
( Crab = Outside of Layout > Destroy ).

As for the points, if i get it right, you just should set a Sine behaviour on the points image or text.
Set Sine to Opacity and play around with it a little.
B
10
S
4
G
3
Posts: 165
Reputation: 2,511

Post » Tue Jul 15, 2014 4:33 pm

khaan wrote:2. How can i display points with fading animation 1point for coins. 2points for cup cakes and juice and 10points for the treasure box?


Add a SpriteFont object, maybe call it PlusPoints and limit it to characters 0123456789+
Give it the Fade behaviour (1 sec fade out time, destroy after fade out)
Then do:
Code: Select all
Player->On collision with Coin
   Coin->Spawn PlusPoints
   PlusPoints->Set text to "+1"
   System->Add 1 to GlobalPoints
   Points->Set text to "" & GlobalPoints
   Coin->Destroy


This will pop up text with "+1" at the location of the coin and destroy the coin. The text will fade out and disappear. It will also update the GlobalPoints variable (or whatever you use to keep track of points) and update the Points display (assuming you have a Text/SpriteFont called Points to display points)

Repeat and edit for cup cakes, juice and treasure boxes.

If you had the paid version you could simplify it by using a Family for bonus point items, with an instance variable for the points they give.
Last edited by OddConfection on Wed Jul 16, 2014 11:50 am, edited 1 time in total.
Find all the Construct 2 games that were on Steam Greenlight here
B
33
S
9
G
7
Posts: 451
Reputation: 6,782

Post » Wed Jul 16, 2014 6:20 am

Thank you for the solutions, i will implement them and if anything goes wrong i'll get back for your help.
B
2
Posts: 6
Reputation: 160

Post » Wed Jul 16, 2014 11:36 am

I couldn't fine some options.
Attached is the test file please check.
You do not have the required permissions to view the files attached to this post.
B
2
Posts: 6
Reputation: 160

Post » Wed Jul 16, 2014 11:49 am

What option do you miss ?

It appears you display points and have them fading as you asked.

Your player gets destroyed as well when it goes outside of layout.
If you want it to do more, add more code/actions in the event "Player is outside of layout".

Or possibly ask a more precise question explaining EXACTLY what you want to achieve and what you see happening in your capx instead. This will help us to help you.
New to Construct ? Where to start

Image Image

Image Image

Please attach a capx to any help request or bug report !
Moderator
B
292
S
115
G
96
Posts: 7,293
Reputation: 70,769

Post » Wed Jul 16, 2014 12:02 pm

@khaan

I've modified your capx to include the actions I outlined above.

Maybe it will be easier for you to see them this way.

You might also want to go through some of the beginner tutorials.
You do not have the required permissions to view the files attached to this post.
Find all the Construct 2 games that were on Steam Greenlight here
B
33
S
9
G
7
Posts: 451
Reputation: 6,782

Post » Wed Jul 16, 2014 2:57 pm

@OddConfection: Thank you so much this is perfect as i wanted. Surely i need to check more beginner tutorials.

Thank you once again.
B
2
Posts: 6
Reputation: 160


Return to How do I....?

Who is online

Users browsing this forum: FabianB, ST314 and 31 guests