How to create a point system?(Solved!)

duke22122

  • Posts: 33
I want to create a point system that adds 1 point every time something leaves the screen. Like an object or an actor. I scanned through the code for something along the lines of that but couldn't find anything. Can someone please explain or show what code I need to put in?

« Last Edit: March 13, 2014, 03:52:28 pm by duke22122 »

Give me a second, i'll make an example! :D
I'm 17 years old, here to help and Entertain. {Also to make fun games}
ADAM: (http://www.stencyl.com/game/play/25588)
Also, if you need help making a platformer, search {Jumper} in Stencyl Forge. This is a player with everything you need in it, that i made. Enjoy!

Here we go!

In this Point System,
My Flowers, when hit by a player, they give 1+ Point > Then die.

First, make an attribute: (Look at the Second picture for, guidance)
Called {Points}.
Type {Number}

Then copy what i did in the first picture, easy eh?

 
I'm 17 years old, here to help and Entertain. {Also to make fun games}
ADAM: (http://www.stencyl.com/game/play/25588)
Also, if you need help making a platformer, search {Jumper} in Stencyl Forge. This is a player with everything you need in it, that i made. Enjoy!

gamegirlxl

  • Posts: 713
"Like an object"  It doesn't matter if something is inanimate or alive, they're both considered actors.

If you know when they're going off screen, and then killing them, right before the killing code block put a "increment var by #" block.  Or whatever you like using to increase a score.

(NoFaceEntertainment, that only explains the very basics of having a score, but I don't think that collisions can be used anywhere in this specific function of the code.)

duke22122

  • Posts: 33
ok thanks I`m going to give it a try!

Hey beautiful, it worked for me.

Simple is always better, makes it so much easier to control (And fast).
I'm 17 years old, here to help and Entertain. {Also to make fun games}
ADAM: (http://www.stencyl.com/game/play/25588)
Also, if you need help making a platformer, search {Jumper} in Stencyl Forge. This is a player with everything you need in it, that i made. Enjoy!

duke22122

  • Posts: 33
"Like an object"  It doesn't matter if something is inanimate or alive, they're both considered actors.

If you know when they're going off screen, and then killing them, right before the killing code block put a "increment var by #" block.  Or whatever you like using to increase a score.

(NoFaceEntertainment, that only explains the very basics of having a score, but I don't think that collisions can be used anywhere in this specific function of the code.)


If I do that.... How do I display the score somewhere?

gamegirlxl

  • Posts: 713
Like this psedo-code (simply put, because it would change if you decide to scroll):

Code: [Select]
When drawing:
  Draw text:{insert score attribute block here} @ x,y

duke22122

  • Posts: 33
Thanks for the input! I figured it out.