The Daily Click ::. Forums ::. Klik Coding Help ::. Question about firing in Games Factory
 

Post Reply  Post Oekaki 
 

Posted By Message

freudianslippers



Registered
  04/08/2003
Points
  9
15th June, 2004 at 13:06:27 -

Hi,
I realise GF is a bit old now but I'm still using it and was wondering if anyone could help me out with something please..

I'm making a side-scrolling game, the scrolling follows the hero.

Enemy characters are supposed to fire at the hero when they are visible on the screen.

However, what in actual facts happens is they fire before they are visible meaning that the hero is constantly being shot at from off-screen. This is obviously a bit unfair and looks rubbish.

Is there a way of specifying that the enemy only fires when they are in the play area? My current conditions are: Is the enemy in the play field and a timer, firing every 5 seconds.

It almost works, they don't fire until they are nearly on the screen but it isn't quite right. I can't find a way around this but there must be a solution. Am I missing something?

Thanks

Freud




 
J

Arf :: FPP Games



Registered
  15/05/2002
Points
  1364
15th June, 2004 at 13:42:38 -

Sounds like it should work. Although if the hotspot is set to the top-left of the sprite (the default position) then it could shoot before you can really see it. Try putting the hotspot in the centre. Also, instead of saying "is enemy in play area", try "is enemy's X-coordinate less than (X Right Frame - 20)".

 
n/a

freudianslippers



Registered
  04/08/2003
Points
  9
15th June, 2004 at 16:25:13 -

Hi, thanks a lot really appreciate the reply!

I thought it was something to do with the hotspot or action spot but it turns out both were centred so it wasn't that.

Alterting it so that it looks at the position of the screen x coordinate worked a treat though!

Thanks again

Freud

 
J

Joe.H

Evil Faker

Registered
  19/08/2002
Points
  3305
16th June, 2004 at 16:34:45 -

never mind.

Image Edited by the Author.

 
My signature is never too big!!!

Keatonian



Registered
  15/07/2002
Points
  571
17th June, 2004 at 00:18:23 -

In the playfield means in the level, not on the screen.

 
-Above post is ancient and probably irrelevant-

An old account of mine, recently cleared out. It's a blast to the past, the age was marked as 14 when I found it. If you know where to look, you can track me. Au revoir.
   

Post Reply



 



Advertisement

Worth A Click