Alice Community  

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

Reply
 
Thread Tools Display Modes
Random numbers & 3D Text
Old
Alex Rodriguez
Guest
 
Status:
Posts: n/a
Default Random numbers & 3D Text - 04-06-2009, 07:06 PM

I'm working on a class project where I make a simple game with a ring and a cone. The object is to have the ring move up and down and you move the cone in the ring to get points. I placed a 3D text of the number Zero for the score. I'm trying to make that 3D text increase by 1 every time the user scores a point (get the cone in the ring). I've created a basic outline toying around with some functions, but I'm not sure how to make it work. If I need to be more specific I'll be glad to post more.

Can anyone help please?
   
Reply With Quote
Old
Scott300
Senior Member
 
Status: Offline
Posts: 80
Join Date: Feb 2009
Location: Ohio
Default 04-06-2009, 11:21 PM

Make a variable named Number

number increment by 1

3dtext set text to world.number as a string
  Send a message via AIM to Scott300 Send a message via MSN to Scott300  
Reply With Quote
I can't get my number to increase by 1
Old
Alex Rodriguez
Guest
 
Status:
Posts: n/a
Default I can't get my number to increase by 1 - 04-07-2009, 04:48 PM

I can't get my world variable (score) to increase by 1 when the ring is within 1 meter of the cone which I have in an if/else statement.

If ring is within 1 meter of cone
increment world.score by 1

That should make the number increase by 1 when the ring is near enough to the cone, correct?


THe loop I have in the my point method is just so I can test that method so the number increase by 1. I need it to move up and down because in the game thats what the ring will be doing. If anyone can look at my world and let me know what I'm doing wrong, I would greatly appreciate it. Feel free to email me at arodriguez1212@msn.com

I can't test the method to make my 3D text change unless I can manage to work out the problem above. I'm frustrated at this point and want to throw the PC out the window.
Attached Files
File Type: a2w Lab3.a2w (247.0 KB, 22 views)
   
Reply With Quote
Old
draikon3
Guest
 
Status:
Posts: n/a
Default 04-08-2009, 08:46 AM

this looks about right
Attached Files
File Type: a2w Lab3.a2w (247.4 KB, 51 views)
   
Reply With Quote
Old
Alex Rodriguez
Guest
 
Status:
Posts: n/a
Default 04-08-2009, 09:29 AM

I changed approaches and made an event when something becomes true. I simply used the same statements (if [object] is within [X meters] of [object]
increment score by 1.

I must have been doing something wrong when trying to make a seperate method to call for the score to increment by one. After I made it into an event, it worked fine. Thanks for your help Scott, I was forgetting to add [what] as a string. And thanks draikon 3 for taking the time to look at my world.
   
Reply With Quote
Old
Scott300
Senior Member
 
Status: Offline
Posts: 80
Join Date: Feb 2009
Location: Ohio
Default 04-09-2009, 02:44 PM

Quote:
Originally Posted by Alex Rodriguez View Post
I changed approaches and made an event when something becomes true. I simply used the same statements (if [object] is within [X meters] of [object]
increment score by 1.

I must have been doing something wrong when trying to make a seperate method to call for the score to increment by one. After I made it into an event, it worked fine. Thanks for your help Scott, I was forgetting to add [what] as a string. And thanks draikon 3 for taking the time to look at my world.
You probably had it in a loop, thus nothing under the loop was being called until the loop finished, when its in a while things under it will run.
  Send a message via AIM to Scott300 Send a message via MSN to Scott300  
Reply With Quote
Torus project
Old
SRM7364
Guest
 
Status:
Posts: n/a
Wink Torus project - 04-10-2009, 03:13 PM

Could you send you post your final project here so that I can compare.

Thanks in advance.


Quote:
Originally Posted by Alex Rodriguez View Post
I changed approaches and made an event when something becomes true. I simply used the same statements (if [object] is within [X meters] of [object]
increment score by 1.

I must have been doing something wrong when trying to make a seperate method to call for the score to increment by one. After I made it into an event, it worked fine. Thanks for your help Scott, I was forgetting to add [what] as a string. And thanks draikon 3 for taking the time to look at my world.
   
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.