Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / shooting an arrow

Author
Message
Wikaman1
16
Years of Service
User Offline
Joined: 17th Aug 2008
Location: Scotland
Posted: 24th May 2010 03:53
so I'm making an extra mode (archery) for my RPG adventure game. I'm just wondering where to start with getting the trajectory path of an arrow depending on where the player aims. Anybody got any tips on this? Thanks
JTK
14
Years of Service
User Offline
Joined: 10th Feb 2010
Location:
Posted: 24th May 2010 04:21
I'm a fan of Matty's Fulcrum Physics... You should check it out here. The most recent - unofficial - version is near the bottom of the thread...

You shoud check it out...

All you would have to do is create a dynamic actor; set its "gravity", "Force", Direction etc. and let the physics take it from there...

Sorry I can't be more specific, but maybe Matty could help you from there as time allows - pretty busy right now with schooling - but who knows...

Hope this helps,

JTK
Matty H
16
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 24th May 2010 15:37
Thanks for the link JTK, keep spreading the word

You could of course use my plug-in but I suppose it depends on your current system and how integrated it is into your game and whether your game is 3D.

Is your game 3D/2D? Is it side scrolling, top down etc?

To fake it you could use a sine wave to control the arrow height, this should give you a nice curve.

I would need to test this, its slightly more complicated than what I have above, you could experiment with it though.

Wikaman1
16
Years of Service
User Offline
Joined: 17th Aug 2008
Location: Scotland
Posted: 24th May 2010 15:42
it's a 3d over-the-shoulder type game.

yeh I was thinking of using some kind of maths to create a curved path for the arrow to follow. I'll try out that code you gave me. Thanks
CrazyCoder
14
Years of Service
User Offline
Joined: 30th Mar 2010
Location: Great Britain
Posted: 24th May 2010 20:49
Using a sine wave creates a curve like this though:

So you need to make sure it only goes through 180 degrees otherwise it will start going up again.
Maybe try something like this:

Here you have the velocity (YSpeed) changing under the force of gravity.
This creates a more realistic curve and also you don't have to worry about when you go over 180 degrees,
because it just carries on falling, faster and faster like in real life.

Login to post a reply

Server time is: 2024-11-19 23:08:07
Your offset time is: 2024-11-19 23:08:07