The Daily Click ::. Forums ::. Klik Coding Help ::. A 32-direction passing system... anyone knows how??
 

Post Reply  Post Oekaki 
 

Posted By Message

Robbert



Registered
  19/06/2003
Points
  420
5th August, 2004 at 13:25:16 -

Hey guys I'm making a soccer game and I want my players in the field to pass the ball in a direction. The player has an 8-direction movement, but I want the ball passing system to be more complex than just 8 ways. I want the ball to go anywhere the player wants it to go and not just north or south you know ... tips regarding this?

 
Hey mates, I'm Iglo yeah =P!

Mr Coffee



Registered
  04/09/2003
Points
  440
5th August, 2004 at 14:10:27 -

Well, it would be easy to give the ball 32 direction movement but if the player only has 8 direction movement then obviously you can't kick the ball in 32 directions very easily. You need to give the player more directions of movement.

 
99 percent chance that the above post is 100 percent correct.

David Newton (DavidN)

Invisible

Registered
  27/10/2002
Points
  8322

Honored Admin Alumnus
5th August, 2004 at 16:33:36 -

It's difficult to have more than eight directions of movement with the four arrow keys, though - and rotational movement ("race car") would be too unworkable, I'd imagine.

If the ball has 32 directions, though, you can make it veer slightly in the direction of a player that you're passing to... make the ball "intelligent", but not too much.

 
http://www.davidn.co.nr - Games, music, living in America

Agent_K64



Registered
  17/03/2003
Points
  69
5th August, 2004 at 19:40:01 -

Have you thought of using the mouse to move the player instead?

 
Evil omg~!

Kris

Possibly Insane

Registered
  17/05/2002
Points
  2017
5th August, 2004 at 19:58:55 -

what about finding the closest player to the player you're controlling, and make a "pass object" face towards that player, so when you press the pass button, the ball will shoot in that direction?

 
"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

Kramy



Registered
  08/06/2002
Points
  1888
5th August, 2004 at 20:14:17 -

How about making your guy run in 8 directions but look at the mouse pointer, then kick in that dir?

 
Kramy

DistantJ [FZ Games]



Registered
  02/08/2004
Points
  855
6th August, 2004 at 05:24:04 -

You could give your player analog joystick control using the plugin, so that he an have 32 directions, but with only 8 directions of animation, then passing the ball could be easier. Problem is if the user has no joystick the keyboard controls would be much less flexible and probably limit to 8 directions still, but that's not an uncommon thing in PC games nowadays.

 
http://www.fzgames.com

Radix

hot for teacher

Registered
  01/10/2003
Points
  3139

Has Donated, Thank You!VIP MemberGOTW WINNER CUP 1!GOTW WINNER CUP 2!GOTW WINNER CUP 3!GOTW WINNER CUP 4!
6th August, 2004 at 13:40:02 -

The problem is, with 8-directional movement there's really no way to send it wherever you want it to go, because you can only input 8 directions using the cursor keys. I recommend making it so the player just passes the ball directly to the nearest friendly player in the general direction they are pressing.

 
n/a

Kramy



Registered
  08/06/2002
Points
  1888
6th August, 2004 at 15:26:04 -

What if the numpad was used? Then you'd have 16 dirs.(Although less coordinated people would probably be annoyed)

Using the mouse is probably the best way. Then you can use the left click to kick, or something.

 
Kramy

Tiles

Possibly Insane

Registered
  06/12/2002
Points
  2339

GOTM 3TH PLACE WINNER - JANUARY 2010
7th August, 2004 at 06:05:56 -

what about simply placing an active at the player´s feet. with 32 directions. always look at ball.

player shoots ball--->set direction of ball to active ...

 
Free graphics,Free Games
http://www.reinerstilesets.de

benb7760 - Plasmagem



Registered
  24/04/2003
Points
  357
7th August, 2004 at 06:44:38 -

you could have it so an active object follows the mouse, and when you hit the ball, it will go a bit towards the object at the mouse. That way you have to hover the mouse over the player you want to pass to.

 
Plasmagem - http://www.plasmagem.com

No Investments, no risks, make money searching google
http://netbux.org/?r=46841

Robbert



Registered
  19/06/2003
Points
  420
8th August, 2004 at 09:34:43 -

Tnx guys for the comments on this. The mouse thing I guess would be neat if it all worked out, but I had it in a different game ( I recreated Halo's multiplayer level with a top-view , with the controls like a 3DFPS but than seen from the sky )... Master Chief looked and walked in the direction of the mousepointer ( replaced by a crosshair ) but I want my crosshair to rotate in a circle (same radius in every direction...), so that you don't have to move the mouse all the time to keep it 'before the player', you know what I mean?? I'm gonna try it again though with the mouse in this game... but if anyone of yall got this thing working with the constant radius, please give me an example. Yoúll be at the credits mate

 
Hey mates, I'm Iglo yeah =P!

The Chris Street

Administrator
Unspeakably Lazy Admin

Registered
  14/05/2002
Points
  50116

Game of the Week WinnerClickzine StaffAcoders MemberKlikCast StarVIP MemberPicture Me This Round 35 Winner!Second GOTW AwardYou've Been Circy'd!Picture Me This Round 38 Winner!GOTM December Third Place!!
I am an April FoolKliktober Special Award Tag
8th August, 2004 at 13:01:02 -

You could, I guess, have a rotating crosshair around the player.

 
n/a

Arf :: FPP Games



Registered
  15/05/2002
Points
  1364
8th August, 2004 at 14:55:46 -

Make the crosshair and set its hotspot to -100 (or however far you want it from the player). Make this the rightward facing animation and then rotate it to get the other 31 directions. Always set it to the same position as the player and make it look towards an invisible active object, then always set the invisible active's position to XMouse, YMouse. Voila.

 
n/a

Robbert



Registered
  19/06/2003
Points
  420
11th August, 2004 at 16:56:24 -

well tnx dude you really seem to know how to do these thing. I'm still working on it but when it's done I'll explain it to you. this will be the coolest soccer game ever made by games factory (I have made 2 before -with editable player looks etc )

 
Hey mates, I'm Iglo yeah =P!
   

Post Reply



 



Advertisement

Worth A Click