Alice Community  

Go Back   Alice Community > Alice 2 > Works-In-Progress

Reply
 
Thread Tools Display Modes
Tank Game
Old
frigging_n00b
Guest
 
Status:
Posts: n/a
Default Tank Game - 10-26-2005, 11:45 PM

I'm making a tank game.

You're suppose to click on the Spider Robot to kill it. When a key has been pressed, robots come towards the tank. When the robot has been clicked on, it should dissapear, move back to the dummy robot (which is invisible), and then become visible again, and go at the tank again. It is suppose to be a never ending game. But, there is something wrong, and everytime I click the robot, it disappears, and then reappear in the same place (not by the dummy robot).

It is not nearly finished yet, and I've only programmed the middle robot. Can someone check and help me? Thanks alot.

PS: It's in the GMail account again.

User: alicefiles
Pass: we1come
   
Reply With Quote
Old
gabe
Administrator
 
gabe's Avatar
 
Status: Offline
Posts: 461
Join Date: Jul 2005
Location: Pittsburgh, PA
Default 10-27-2005, 02:51 AM

Nice work. Just glancing over your code, it looks like the robot is not disappearing and reappearing at the dummy robot because it's still moving towards the tank. Basically, you've told the robot to move toward the tank when a key is pressed, and when the robot is clicked on, move toward the dummy robot. So there's a conflict in that the robot can't move in two directions at the same time. So the processes cancel themselves out and the robot stays disappears and reappears in the same place.
   
Reply With Quote
Old
frigging_n00b
Guest
 
Status:
Posts: n/a
Default 10-27-2005, 02:01 PM

Thanks,

But how do I change it? I've thought about it, but I can't seem to find a way to get around it....
   
Reply With Quote
Old
frigging_n00b
Guest
 
Status:
Posts: n/a
Default 10-29-2005, 03:40 PM

Sorry to double post, but this is rather urgent. I can't seem to think of a way to get around it, can one of you help me?
   
Reply With Quote
Old
kingsamses
Guest
 
Status:
Posts: n/a
Default 10-29-2005, 08:44 PM

Maybe you could do this: When you start the robot moving, set a variable (robot_moving) to one and to 0 when it's done moving (0 is default). When you want it to start moving the other way, first have a loop with nothing in it that terminates when robot_moving is 0 and then starts the robot moving. I hope I explained that clearly and understood the problem properly.
   
Reply With Quote
Old
frigging_n00b
Guest
 
Status:
Posts: n/a
Default 10-29-2005, 09:04 PM

kingsames, thanks for replying. From experience, I know that you are a good Alice programmer. Can you please check it out and do the stuff you said? I don't understand the variable thing.

I'll give you a cookie! lol, please help.
Thanks
   
Reply With Quote
Old
gabe
Administrator
 
gabe's Avatar
 
Status: Offline
Posts: 461
Join Date: Jul 2005
Location: Pittsburgh, PA
Default 10-30-2005, 01:05 AM

Is this for a school-related assignment?
   
Reply With Quote
Old
frigging_n00b
Guest
 
Status:
Posts: n/a
Default 10-30-2005, 10:58 AM

Uh....kind of. We're suppose to make the guy with knives chasing him, but I just decided to make this (as an addon)....
   
Reply With Quote
Old
kingsamses
Guest
 
Status:
Posts: n/a
Default 10-30-2005, 04:52 PM

Quote:
Originally Posted by frigging_n00b
Uh....kind of. We're suppose to make the guy with knives chasing him, but I just decided to make this (as an addon)....
So this thing isn't an assigned and graded thing, just done for fun? I don't want to help you cheat or anything. Also, what kind of cookie are you offering?
   
Reply With Quote
Old
frigging_n00b
Guest
 
Status:
Posts: n/a
Default 10-31-2005, 04:15 PM

lol....um.....white chocolate chip....


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