Alice Community  

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

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Variables
Old
Scott
Guest
 
Status:
Posts: n/a
Default Variables - 09-25-2008, 07:07 PM

Hey,

I am taking Computer Science at school and we are using Alice. Recently I have been working ahead and know a bit more stuff than we have learned. Yet the one thing I do not understand is variables. I read over and over the part where you learn it in the book in the classroom and tried it but couldn't get it to do what I wanted.

Let me say that I am making a game. You are a guy in a Beach Chair and you go around and hit chickens and get 100 points. I have the chair as the guys vehicle and the chair the camera's vehicle so they are all synced. I have 3 chickens in the level so far that go in circles. And as of now The guy goes right through the chickens.

First question I have is how do I make it as when the Chair hits a chicken, the chicken falls and gives you 100 points. I tried for a half hour but couldn't get it to work. I know I need to use the IF thing, and I know what to do, just don't know how to put it down. I want it to be like "If Beach Chair hits chicken, make Chicken Fall". Next part of this question is how do I get this to work when there are more than 1 chicken. There will many many many chickens, like maybe up to 30 or 40. How do I set it to get to hit any chicken for this IF statement to work. Because it lists the chickens as Chicken 1, Chicken 2, and so on. And I don't think making 40 IF statements is necessary.

Next question is how do I get a score system. I know how to get text and position it in the left corner of the screen, but how do I get the score to change up 100 points when you hit a chicken.

I have the file attached and would like to hear back from someone on how to do this. I have only been in this class for 4 weeks. And I do not mind anyone to do what I need to my file and re attach it. I would really really appreciate it if you did because I can learn best seeing it like that.
Attached Files
File Type: a2w 7 Chair Game.a2w (762.0 KB, 59 views)
   
Reply With Quote
 

Tags
car, chicken, guy, problem, variable


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 ©2024, Carnegie Mellon University
Alice 2.x © 1999-2012, Alice 3.x © 2008-2012, Carnegie Mellon University. All rights reserved.