The Daily Click ::. Forums ::. Klik Coding Help ::. Need help with complex gravity / inertia coding
 

Post Reply  Post Oekaki 
 

Posted By Message

Colin Watts



Registered
  26/09/2004
Points
  2
27th January, 2005 at 16:55:20 -

Hi all - thanks in advance.

The nature of my problem is this. I'm trying to make a side-view shooter, basically a clone of the BBC micro classic Thrust from the 1980s. I've managed to make the ship turn in 360 directions by using alterable values and basic trigonometry. I've set the following into alterable values:

- The virtual X coordinate of the ship. Has a range of 0-640,000 for accuracy. The X coordinate of the ship is set to this divided by 1000.
- The virtual Y coordinate of the ship. Basically same as above.
- The X vector of the ship which is added to the virtual X coordinate every 1/100s
- The Y vector - ditto
- The direction of the ship in degrees. The 32-direction direction of the ship is set to this value /11.25 every 1/100s.

I can make gravity and thrust work fine with these figures.

My big problem is what to do when the ship is attached by a line to another object, the load. I need to work out how to code the drag of the load and factor it into the ship's X and Y vectors. It may have something to do with finding centres of gravity and adding vectors, but I'm not sure.

I'm sorry if I'm not very clear about what I need, but if you've played Thrust you'll know what I mean. Here's a link to a freebie PC clone of the game (< 1MB)which might illustrate my point better.

http://members.home.nl/wdw/thrust.html

Many thanks.

 
n/a

Assault Andy

Administrator
I make other people create vaporware

Registered
  29/07/2002
Points
  5686

Game of the Week WinnerVIP Member360 OwnerGOTM JUNE - 2009 - WINNER!GOTM FEB - 2010 - WINNER!	I donated an open source project
27th January, 2005 at 18:20:05 -

I think this link will be very helpful:

http://www.clickteam.com/CTforum/showflat.php3?Cat=&Board=upload&Number=196164&page=&view=&sb=&o=&vc=1


 
Creator of Faerie Solitaire:
http://www.create-games.com/download.asp?id=7792
Also creator of ZDay20 and Dungeon Dash.
http://www.Jigxor.com
http://twitter.com/JigxorAndy

Colin Watts



Registered
  26/09/2004
Points
  2
28th January, 2005 at 12:59:44 -

Thanks for the help.

 
n/a
   

Post Reply



 



Advertisement

Worth A Click