Alice Community  

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

Reply
 
Thread Tools Display Modes
Question about FPS
Old
Quantumpower
Guest
 
Status:
Posts: n/a
Default Question about FPS - 06-11-2010, 06:48 PM

I'm in grade 9 and very interested on Alice because I chose a course for next year(gr. 10) and we will be using alice.
How to make a revolver shoot and then when the bullet reaches a certain object it gets killed. How can I put a score system on the project I'm planning to make for example when the player kills a target +5 points and it adds up.
   
Reply With Quote
Old
DensetsuNoKaboom
Senior Member
 
DensetsuNoKaboom's Avatar
 
Status: Offline
Posts: 1,188
Join Date: May 2010
Location: e4eaf2
Default 06-11-2010, 06:50 PM

One word: variables. Set it so that "when bullet is within 1 meter of enemy, then variable.score increment by 1".
Or at least I think that's how it goes.


Thank you for taking the time to read this signature. This signature loves you.
   
Reply With Quote
Old
Dameria
Senior Member
 
Dameria's Avatar
 
Status: Offline
Posts: 978
Join Date: Sep 2009
Location: United States
Default 06-11-2010, 10:16 PM

Yes, you create a world number variable in the world.properties tab and call it "score". Then, in the method that detects when the bullet is within the distance of the target, just add right after that code: (score = score + 5). This will make the variable "score" go up by 5 (for example if the score is 15, it will be (score = 15 + 5) and the new score will be 20).

Then you probably want to display it, so add a 3d Text object at the end of the object library and set it in the place near the camera that you want it, and go to its property tab and change its vehicle to "camera" instead of "world". This will make the text follow the camera where it goes instead of staying still while you move around. Now for the text to display the new score in the number variable, go back to the method that you incremented score by 5 and right after that block of code. For this one, go to the 3d Text object properties tab and drag where where it says "text" underneath the increment block of code I said before. This will let you change the text of the 3d Text. Just set it to default string at first, but you will change it now. Now go to the world.functions tab and look for "(what) as a string" and drag that into the place where it says "default string". It should ask you to put in something for the parameter "(what)". For this, look for where it says world.score and click on that. Now just click on the arrow on the right of the block of code and click on Duration, click on Set Value, and type in 0 and press enter (this will make it happen instantly instead of over the course of 1 second) and now you are done. Now you can test it.

Wow that was a lot to write, it took be about 15 minutes.


Check out my best projects so far and please comment:

Tic-Tac-Toe 2.0 ................... http://www.alice.org/community/showthread.php?t=3548
Alice Paint ........................... http://www.alice.org/community/showthread.php?p=23408
Real-Time Clock .................. http://www.alice.org/community/showthread.php?p=12725
Maze Game ......................... http://www.alice.org/community/showthread.php?t=4301
   
Reply With Quote
Old
jediaction
Senior Member
 
jediaction's Avatar
 
Status: Offline
Posts: 5,064
Join Date: Jul 2009
Location: Bel Air, Maryland
Default 06-12-2010, 08:03 AM

Quote:
Originally Posted by Quantumpower View Post
I'm in grade 9 and very interested on Alice because I chose a course for next year(gr. 10) and we will be using alice.
How to make a revolver shoot and then when the bullet reaches a certain object it gets killed. How can I put a score system on the project I'm planning to make for example when the player kills a target +5 points and it adds up.
Well, you could do an increamenting count or a count that i like doing which is a True and False type. But if your new, I would be happy to help you with whatever you needed. So please ask. The counting, I made an example already, You could use it and switch the points to every 5. Increamenting is a little different. You can just follow Damerias steps. I'll be here to help


Website: www.salokingames.com
FaceBook: www.facebook.com/SalokinGames
   
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 ©2019, Carnegie Mellon University
Alice 2.x 1999-2012, Alice 3.x 2008-2012, Carnegie Mellon University. All rights reserved.