The Daily Click ::. Forums ::. Klik Coding Help ::. Help! - Throwing Object
 

Post Reply  Post Oekaki 
 

Posted By Message

eX Com



Registered
  15/08/2002
Points
  352
3rd July, 2003 at 17:31:51 -

I have a custom platform movement and when the player holds shift and presses "G", he "throws" a grenade and it bounces a few times and then blows up. My problem is.. It throws fine when he faces right (xpos + 6) but for some reason when he faces left (xpos - 6) the grenade still travels right. You'll have to see my code before you can give me a compete answer so if you think you can help, tell me and I'll DC-Mail you the URL. Thanks.

 
The chickens are coming...

AndyUK

Mascot Maniac

Registered
  01/08/2002
Points
  14586

Game of the Week WinnerSecond GOTW AwardHas Donated, Thank You!VIP Member
3rd July, 2003 at 18:05:16 -

you could make the grenade face the same direction as the character.
so when when its facing left and thrown, subtract a number but when facing right and thrown add a number.

i hope you get it to work

 
.

Pyro



Registered
  22/05/2003
Points
  110
4th July, 2003 at 04:57:09 -

Is the grenade a bouncing ball object? Because if it is, I run into this problem pretty often,
it might have to do with the initial direction or the order that you programmed direction condition in...What I mean is make sure you did it in the correct order like this:
Upon pressing G or whatever #1 create grenade #2 set direction to whatever, the wrong thing that I do sometimes Is: Upon pressing G # set direction to whatever #2 create the object. What I mean is make sure you put create the object first so it knows what it's directing.
Ugh, I'm sorry if this didn't make any sense.


 
n/a

Rycon



Registered
  20/09/2002
Points
  996
4th July, 2003 at 22:49:57 -

Pyro is right, although I have denied it for as long as I can, placement of code in Conditions and Actions can make a difrence if somthing is not working. For example:

Every 1 second
If Gernade is playing animation Disapearing

Switch that to:

If Gernade is playing animation Disapearing
Every 1 second

This will make no difrence at all, but correct placement in complex and thick code, CAN solve the problem that just doesent make sense.

This also solved a problem I had with a game I was making in Qbasic.

 
We are the music makers, we are the dreamers of dreams...

eX Com



Registered
  15/08/2002
Points
  352
5th July, 2003 at 15:22:38 -

k thanks for the help.. i fixed the problem.. i have no idea how lol i just screwed around with it for 5 minutes and it worked

 
The chickens are coming...
   

Post Reply



 



Advertisement

Worth A Click