how to generate star achievements

djngam

  • Posts: 63
hi guys,

ive combed the forums and the internet for a solution but i cant seem to find it. if anyone could help me out i would be eternally grateful.

basically i have a simple shooter game with many levels.  and i just want to have the "three star" achievement at the bottom of each stage. im not sure how to go about this (i.e. if the player completes the stage with one bullet then they get awarded three stars. anymore than its two stars and etc.)

hoping theres a kind soul out there who can help out.

Thanks guys!

Bhoopalan

  • Posts: 1018
Hi...

There has always been pure souls in Stencyl to help other Stencylers. I'm definitely not one though ;) But would like to share my idea.

1. Create 3 graphics. One with 1 star highlighted, another one with 2 stars and another one with 3 stars highlighted.

2. Create an actor named 'Stars'. Create 3 animations with names like 1Star, 2Stars & 3Stars. Place the graphics you created in the respective animations.

3. Hope you have already created an attribute to track bullet count. If not, create a number attribute (I would name it bulletCount).

3. When the bullet is created, 'bulletCount' is incremented by 1. Inside the bullet actor's even, you can use 'when created' event and write the following code:

increment bulletcount by 1 (there's a green block which can be searched as 'increment'. Use that block)

4. When the game is over, create an event
if bulletCount = 1
  create actor 'Stars'.
otherwise if bulletCount = 2
  create actor 'Stars'.
  switch animation [2Stars] for last created actor (Search for switch block and you'll find this blue block)
otherwise if bulletCount = 3
  create actor 'Stars'.
  switch animation [1Star] for last created actor

Now you can also create the actor 'Stars' above all the if function if you know what I mean. Also, set the default animation to 3 stars.
If I helped you at anytime, help me back build my twitter followers :)
https://twitter.com/imbhoopalan

Bhoopalan

  • Posts: 1018
I don't know what's ur skill level, if you don't understand anything in this, you might search the same along with the keyword stencyl in google. Stencyl has got documentation for everything I told here. It's a pretty good software.
If I helped you at anytime, help me back build my twitter followers :)
https://twitter.com/imbhoopalan

djngam

  • Posts: 63
thanks so much for your reply. i understand that to avoid repetitiveness its best to use a list attribute somehow. ill tinker with it and see how it goes . if you have any more information please do let me know!

thanks buddy!

djngam

  • Posts: 63
nope. still nothing. :(  would really appreciate any help from stencylers. just a simple explanation will do. all i need is a simple 1- 3 stars being displayed based on the score.  break down of the problem would be to

1.) save each score from each level.
2.) create stars based on the score on the "level select" page.

ive seen it made in so many games and now i cant look at them the same without wondering "how are you doing that" hahaha i know you guys can relate xD

thanks in advance to anyone.