The Daily Click ::. Forums ::. Klik Coding Help ::. Games factory - firing question
 

Post Reply  Post Oekaki 
 

Posted By Message

Archaos



Registered
  06/01/2004
Points
  4
7th January, 2004 at 09:17:34 -

Hi I hope someone can help me with this as I'm stuck..

I've started making a platform style shooter, a bit like Green Beret but with guns. I want the character to be able to fire to the left or right, not at any other angle so I've set it up like this-

When the player faces to the left value A is set to 2
When the player faces to the right value A is set to 1
When the player presses fire1 and value A is set to 2 it fires left.
When the player presses fire1 and value A is set to 1 it fires right.

That all works fine 99% of the time but every once in a while I'm facing one way and pressing fire and it shoots the opposite way. Not only does it look rubbish it also makes the game very unfair on the player! Can anyone suggest a way to fix this please?

I expressly don't want to use the "fire in direction of player" option as this will fire the bullets in all 8 directions.

Thanks in advance for any suggestions!

 
n/a

Deleted User
7th January, 2004 at 09:53:31 -

Does that happen randomly?

 

Archaos



Registered
  06/01/2004
Points
  4
7th January, 2004 at 09:57:07 -

It does seem pretty random, the only pattern I've found is that if I map jump to another key (its up and right or left at the moment) the problem is far worse.

 
n/a

Kris

Possibly Insane

Registered
  17/05/2002
Points
  2017
7th January, 2004 at 10:53:54 -

you could try setting the values when a particular direction is pressed, instead

 
"Say you're hanging from a huge cliff at the top of mt. everest and a guy comes along and says he'll save you, and proceeds to throw religious pamphlets at you while simultaniously giving a sermon." - Dustin G

Archaos



Registered
  06/01/2004
Points
  4
7th January, 2004 at 11:17:06 -

That's exactly what I'm doing!

When the player faces to the left value A is set to 2
When the player faces to the right value A is set to 1

 
n/a

Shen

Possibly Insane

Registered
  14/05/2002
Points
  3497
7th January, 2004 at 13:04:59 -

Or:
Joystick is pressed to left: Set flag 0 off
Joystick is pressed to right: Set flag 0 on

Flags and joypad readings are betterer.

 
gone fishin'

Archaos



Registered
  06/01/2004
Points
  4
7th January, 2004 at 14:07:40 -

Many thanks to everyone who took the time to reply!

I set the firing direction to be dependant on a flag value and now it's firing the right way every time!



 
n/a

Karnage [Ragnarok Games]



Registered
  28/10/2003
Points
  664
7th January, 2004 at 14:42:50 -

Well, good job for posting. Better take care of this before this gets clogged with crappy posts.

 
Remember, there's a little darkness in all of us... we just express it best.
--Ragnarok Games



Karnage [Ragnarok Games]



Registered
  28/10/2003
Points
  664
7th January, 2004 at 14:48:53 -

Administrator Message:This topic has been locked to prevent furter crapping up.

 
Remember, there's a little darkness in all of us... we just express it best.
--Ragnarok Games



Cazra

Crazy?

Registered
  24/07/2002
Points
  4472

Game of the Week WinnerVIP Member
7th January, 2004 at 16:36:11 -

try this:

Have an invisible shooting objects that will shoot the objects for the player.

>Always
-set position of shooter to 0,0 from action point of player
>Repeat while left is pressed
-set direction of shooter to left(16)
>repeat while right is pressed
-set direction to right(0)
>upon pressing fire1
-shooter object shoots object in the current directiion of shooter object

This works quite well. You can easily add more directions to it if needed.

 
n/a

yuyu



Registered
  13/05/2003
Points
  202

VIP Member
7th January, 2004 at 19:03:18 -

That works well but the actual problem your having is with the default platform engine. The coding of the shoot engine seems to be perfect to me.
The Default Platform engine has a bug when you jump or land sometimes where the direction of the object is set to left. Its just another bug with Games Factory so there are really two solutions, Live with it, or make your own engine.

 
n/a

AndyUK

Mascot Maniac

Registered
  01/08/2002
Points
  14586

Game of the Week WinnerSecond GOTW AwardHas Donated, Thank You!VIP Member
7th January, 2004 at 19:42:38 -

yeah that bug is annoying

if you are moving left but not holding left and then press jump the character jumps and instantly changes direction to the right.

 
.

Teapot

Does he even go here

Registered
  02/10/2003
Points
  2631

VIP Member
8th January, 2004 at 03:55:01 -

i use to just have an invisible 2 direction object with no speed and make the character shoot in the direction the invisible object was facing

 
n/a

Jon Chambers



Registered
  25/08/2002
Points
  1071
9th January, 2004 at 17:37:27 -

Why do you even need values? Why not just test direction when you shoot? Why waste a value that can be used for some other cool thing, like virtical momentum?

 
Copy this to your hard drive. It will be worth alot when I'm famous.

Notice: Spelling mistakes above left in for people who need to correct others to make their life fulfilled.

Phredreeke

Don't listen to this idiot

Registered
  03/08/2002
Points
  4504

You've Been Circy'd!VIP MemberPS3 Owner
19th August, 2005 at 07:29:35 -

why the hell is this in my favourites list? *deletes*

 
- Ok, you must admit that was the most creative cussing this site have ever seen -

Make some more box arts damnit!
http://create-games.com/forum_post.asp?id=285363
   

Post Reply



 



Advertisement

Worth A Click