goop2 Member Posts: 1059 From: Registered: 06-30-2004 |
Im having trouble with movement on GM. I have a tank and it sets variables every direction (to tell it wich direction to shoot. for instance : when the up button is pressed it does this code: up = true down = false left = false right = false) but when I move left it goes left and when I stop going left it moves down one sprite length Whats going on??? ------------------ AAARG! My pik wont show? Whats going on??? |
ArchAngel Member Posts: 3450 From: SV, CA, USA Registered: 01-29-2002 |
one sprite length, eh? hmmm.... do you use seperate objects for each direction? ------------------ |
Astaldaran Member Posts: 23 From: Registered: 06-12-2003 |
if so you should jsut change pics ------------------ |
ArchAngel Member Posts: 3450 From: SV, CA, USA Registered: 01-29-2002 |
even so, you'd have to watch for the origin of the sprite. ------------------ |
goop2 Member Posts: 1059 From: Registered: 06-30-2004 |
I use the same object, just change the sprite ------------------ AAARG! My pik wont show? Whats going on??? |
AmazingJas Member Posts: 437 From: Sydney, NSW, AUSTRALIA Registered: 04-03-2003 |
Do you have any code telling it what to do when a key is released? I can't think why it's doing what it is, but if you tell it to set speed to 0 on release, it might work or provide a clue. That is assuming your using speed to control movement, rather than jump-to commands. Failing that, upload the .gmd file and I'm sure someone will have a look. |
ArchAngel Member Posts: 3450 From: SV, CA, USA Registered: 01-29-2002 |
but, is the origin on the down sprite in the same place everywhere else? second, how do you just change the sprite? lol. ------------------ |
CobraA1 Member Posts: 926 From: MN Registered: 02-19-2001 |
Without more information, we really can't help you. All I can say is to check your sprite origins, make sure they're the same. ------------------ Switch Mayhem now available! Get it here |
goop2 Member Posts: 1059 From: Registered: 06-30-2004 |
I couldent figure out how to use code and only go in 4 directions so its comands.Im checking the origin now and ...... Its that stupid Auto-Orinin thingy! Thats what was screwing me up! Geeze... ------------------ AAARG! My pik wont show? Whats going on??? |
goop2 Member Posts: 1059 From: Registered: 06-30-2004 |
Now the shooting aint working... Ill put it on my homepage... www.freewebs.com/grafitiware ------------------ True = False |
ArchAngel Member Posts: 3450 From: SV, CA, USA Registered: 01-29-2002 |
k... I'll take a look at it..
------------------ |
ArchAngel Member Posts: 3450 From: SV, CA, USA Registered: 01-29-2002 |
k, took a peek, and I found three things. a) i like how you did the turning.. mind if I.. sorta implement it? (aka mind if I rip off you? lol) b) the shooting does work, it's the "enter" key" c) I found a bug with the shooting. when turning right from the up position, the tank will continue to shoot right. check the execution code if when you press the "up" key. instead of a p1right = false, there's another p1down = false. just a simple typo. ------------------ |
Astaldaran Member Posts: 23 From: Registered: 06-12-2003 |
works fine for me. Anyway having to repeatedly push the fire is a little annoying. I wish i had kept it but I made a little game where you were a tank (actualy two people would play against each other on the same computer) and could pick up mines and stuff plus use your bullets. However I had the tanks make the instance of the bullet but then the bullet figured out which directino to go. This allowd bullets to be shot as fast as the game could go (basicly an unbroken string) so then every time you fired it would start a timer. Anyway this would make it a lot slower but you could still hold it down. Then you can add powerups into teh game so that it decreases the time on the timer, this allows for faster rate of fire. I really do wish I had the game so I could show it to you... However I think the sample airplane game has a device much like it. You should look at that game. ------------------ |
goop2 Member Posts: 1059 From: Registered: 06-30-2004 |
A typo? Oops... Well thanks for taking a look,.. You've helped me to much for me to say no about riping stuff from it. Take anything you like. And the pressing more than once is for both realism and the fact that i was to lazy to make it differently :P Im going to put missles and mines in it too, and it will be 2 player. Hopefully I can master AI... Anyway, its not done yet. IT SALL BE BETTER!!!!! IT SHALL RULE!!!! IT SHALL ... what? ------------------ True = False |
goop2 Member Posts: 1059 From: Registered: 06-30-2004 |
I got it updated. check it out. You cant score points but its 2 player and you can shoot... No tiles yet though. ------------------ True = False |
goop2 Member Posts: 1059 From: Registered: 06-30-2004 |
I got it updated again. Player1 can get out of the tank by pressing delete. ------------------ True = False |