PDA

View Full Version : Tank Game


frigging_n00b
10-26-2005, 10: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

gabe
10-27-2005, 01: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.

frigging_n00b
10-27-2005, 01: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....

frigging_n00b
10-29-2005, 02: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?

kingsamses
10-29-2005, 07: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. :p

frigging_n00b
10-29-2005, 08: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

gabe
10-30-2005, 01:05 AM
Is this for a school-related assignment?

frigging_n00b
10-30-2005, 09: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)....

kingsamses
10-30-2005, 03:52 PM
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?

frigging_n00b
10-31-2005, 03:15 PM
lol....um.....white chocolate chip....


Please, lol just help....

kingsamses
11-01-2005, 03:13 PM
Sounds good!

If you'll answer the question in my last post, I'll be glad to help. But I don't want to be doing your schoolwork for you.

frigging_n00b
11-04-2005, 01:38 PM
Ya, I'm trying to make it myself. There's still something wrong with it. It uploaded on GMail. I got all the values things in. Can you check to see whats wrong with it?

Thanks

kingsamses
11-04-2005, 02:24 PM
I'll see what I can do.

EDIT: Done. It now works. From the coding, it looks like you're going to add fences so the tank can't run really far away. Good idea! That is needed, or else the robots will take 30 seconds to come back to you.

frigging_n00b
11-16-2005, 08:27 PM
Sorry, was extremely busy for a long time.

Great job! Thanks alot.

First, how do you add a fence? Do you just insert the object?
And second, how do you set text to a variable?


Thanks

kingsamses
11-17-2005, 02:55 PM
Sorry, was extremely busy for a long time.

Great job! Thanks alot.

First, how do you add a fence? Do you just insert the object?
And second, how do you set text to a variable?


Thanks
For a fence, yeah, just put one in, then make some kind of collision detection.

What kind of variable, a string? And where's the text from? If user-input, World >>> Functions >>> ask user >>> ask user for a string. Use in conjunction with [variable] set value to [value], where [value] is "ask user for a string". If from 3-D text, 3-D text >>> Properties >>> text, drag into [variable] set value to [value]. If from something else, post it.