The Daily Click ::. Forums ::. Klik Coding Help ::. PLEEEASE help me out...PLEASE
 

Post Reply  Post Oekaki 
 

Posted By Message

kjarom



Registered
  08/06/2004
Points
  805
29th September, 2005 at 17:20:18 -

Ok...I'm currently working on an engine for a new game. I just have a couple graphics and stuff, and it's pretty basic coding. HOWEVER, when you fire the bazooka (by hitting control) it JUST WON'T FIRE! I've looked through my code for about an hour, I have no idea where I screwed up. It worked before, too.

Download the code at: http://www.sitesled.com/members/hypera/SpyWars.gam

...and PLEASE see if you can find the problem! Once again the bazooka won't fire!

THANKS CLICKERS!

 
You now rockin wit a pro

DeadmanDines

Best Article Writer

Registered
  27/04/2006
Points
  4758
29th September, 2005 at 17:51:45 -

Ahah, I see what you've done

This is a common mistake in TGF.

The problem lies in your two bazooka-firing events (the 'user-presses-control' ones).

You see the event number? Right-click it and you should get an option like 'edit the actions' or something.

This'll give you a box containing all the actions for that event.

When you click an action, TGF remembers which ones you clicked first. In your case, you clicked the 'create bullet from bazooka' action BEFORE clicking the 'create bazooka' action. Your list of actions goes like this:

. Start animation of bullet
. Set Direction of bullet
. Change animation of player
. Create bullet at bazooka
. Change direction of player
. Create bazooka
. Set position of bazooka to (0,0) from player

That's the order TGF will run them in. So TGF thinks of it like this:

. Start animation of bullet What bullet? There aren't any?
. Set Direction of bullet Still no bullets
. Change animation of player Okay!
. Create bullet at bazooka What bazooka? There is no bazooka!?
. Change direction of player Okay!
. Create bazooka Okay!
. Set position of bazooka to (0,0) from player Okay!

Do you see the problem? Because the events are in a funny order, TGF doesn't know what you want it to do, so it gets it wrong.

Fortunately you can rearrange the order of the actions by dragging them using that box I just showed you. So drag them to an order like this:

. Create Bazooka
. Set position of Bazooka to (0,0) from player
. Create Bullet at Bazooka
. Set direction of bullet
. Start bullet moving
. Change animation of player
. Change direction of player

You could probably clean up those events by getting rid of a few un-necessary actions, but heyho, it works

I've tested that in MMF, but if you have any problems in TGF, just ask

 
191 / 9999 * 7 + 191 * 7

moonbird99



Registered
  03/04/2004
Points
  910
29th September, 2005 at 18:15:02 -

you both said it all - if he dont get it now he never will

 
to start press any key ...... where's the ANY KEY??

kjarom



Registered
  08/06/2004
Points
  805
29th September, 2005 at 19:08:00 -

hey thanks man! thanks so much, i owe ya!

 
You now rockin wit a pro

kjarom



Registered
  08/06/2004
Points
  805
29th September, 2005 at 20:00:53 -

yeah it works now

 
You now rockin wit a pro
   

Post Reply



 



Advertisement

Worth A Click