Alice Community  

Go Back   Alice Community > Alice 2 > How do I...?

Reply
 
Thread Tools Display Modes
How do I make a score counter
Old
GrungeX
Guest
 
Status:
Posts: n/a
Default How do I make a score counter - 06-02-2011, 01:20 PM

Hey guys! I want to make a score so that everytime the player clicks on Samurai, the score raises by 1.

It takes 9 hits to kill the Samurai so the number should raise by 1 everytime the samurai is hit.

OR

If it's possible, to have the score count down. So that it goes from 9, 8, 7, 6, 5, 4, 3, 2, 1.


Any help is greatly appreciated!
   
Reply With Quote
Old
reuben2011
Senior Member
 
reuben2011's Avatar
 
Status: Offline
Posts: 489
Join Date: Sep 2009
Location: Hawaii
Default 06-02-2011, 03:15 PM

What you want to use is 3D text to display the score. The 3d text can be found on the far right of the object gallery. Then you want to have a number variable that keeps track of the score like "health." Then in the "when object is clicked" event put the samurai as the object and put this as your method.

health set value to (health - 1)
3dTextObject.text = health as a string


Projects
-Escape the Kitchen
-That ninja animation
-Hill Collision

Upcoming Projects
-Some penguin adventure game?
   
Reply With Quote
Old
GrungeX
Guest
 
Status:
Posts: n/a
Default 06-02-2011, 03:49 PM

Quote:
Originally Posted by reuben2011 View Post
What you want to use is 3D text to display the score. The 3d text can be found on the far right of the object gallery. Then you want to have a number variable that keeps track of the score like "health." Then in the "when object is clicked" event put the samurai as the object and put this as your method.

health set value to (health - 1)
3dTextObject.text = health as a string
Thanks for the help! Although how would I set 3dTextObject = health as a string? I'm trying but it's not working. I'm trying to drag the function "object as a string" but it's not working :\
   
Reply With Quote
Old
sfunk
Senior Member
 
sfunk's Avatar
 
Status: Offline
Posts: 1,112
Join Date: Mar 2011
Location: I don't know
Default 06-02-2011, 03:50 PM

I made a tutorial practicaly for this reason, check out the link in my signature if you can't understand ruebens explination

(the example was meant for another post)
Attached Files
File Type: a2w example.a2w (1.44 MB, 107 views)


If you are stuck on a project, check out the tutorials I made here at this link:

http://alice.org/community/showthread.php?p=36778#post36778

There are lots of tutorials on it so far, including some youtube videos, check it out

Or..

Go to my youtube channel to check out my alice 2.2 tutorials I have there..

http://www.youtube.com/user/sfunk1992?feature=mhsn

Last edited by sfunk; 07-02-2011 at 09:13 PM.
   
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



Copyright ©2017, Carnegie Mellon University
Alice 2.x 1999-2012, Alice 3.x 2008-2012, Carnegie Mellon University. All rights reserved.