The Daily Click ::. Forums ::. Klik Coding Help ::. 8-Directional Shooting Problem
 

Post Reply  Post Oekaki 
 

Posted By Message

Bugsey



Registered
  14/03/2010
Points
  3

I am an April Fool
28th March, 2010 at 20:05:16 -

Right now, I'm making a shooter/platformer type game, where you can aim in 8 directions by pushing the arrow keys in the direction you want (the bottom 3 can only be aimed while in the air). However, you can't point diagonally down-left. Everything works fine when it comes to shooting an all that, but it's like that one direction doesn't exist.

Here's the engine so far:

http://www.mediafire.com/download.php?mmznkggjim4

Z is Jump, X is Shoot, move and aim with the arrow keys.

 
Image

Tokinsom



Registered
  22/11/2009
Points
  25
29th March, 2010 at 06:44:19 -

Hey Bugsey remember me?

Figured out your shooting problem; you forgot to add "(negated)Repeat while moved down" in event #66. Without it, holding left forces her direction to 16.

In the future, you might want to add a little debugger to see what your player's directions are. Just make a string object, uncheck "display as background" and "follow the frame", and make it white or something contrasting the background. Then give it a behavior with these events:

+Start of frame
-Set x position to: Xleftframe+10
-Set y position to: Ytopframe+10

+Always
-Change alterable string to: "Direction:"+Str$(Dir("Your Player"))



Edited by Tokinsom

 
n/a

Bugsey



Registered
  14/03/2010
Points
  3

I am an April Fool
29th March, 2010 at 23:11:48 -

Well, since you've fixed my problem, and sience Nobody can now aim in all 8 directions, there would be no point to the debugger you just mentioned, but thanks for helping me, I spent all afternoon trying to think of what I did wrong.


 
Image
   

Post Reply



 



Advertisement

Worth A Click