![]() |
Space Game
1 Attachment(s)
I am planning on making a completely space-based game (like Cosmic Rift or Starship Troopers (Cosmic Rift is going P2P and Starship Troopers went out of business)), but I really can't think of a way to make the movement work correctly with my limited math knowledge. I'll attach a level with what I have of the movement system so far, and also paste the code below.
NPC Code://#CLIENTSIDE |
looks neat but i dont know what it does lol
feels like a plane |
Wow...looks awsome...
Not sure what you mean by moving "correctly"... Seems to work pretty well for me... |
Ah, i see what you mean now...where you can change direction instantly...
|
Quote:
Go play cosmic rift and u will see :) Its hard to explain. |
cool
very nice, now to jsut add a ship image sprite rotaded liek every 5 degrees and a changeimgpart and have it work in mulitple levels... heh i like to hold right and up to fly in circles heh
|
Perhaps I should try my hand at the Asteroids game I was working on again.
I felt it was quite nice. Especially since I had never had trig. But im in trig class now. We did vectors last week. :cool: Me likes. And I finally understand the proper use of arcTan I loves it. Very useful. I recall seeing it used and being baffled. I am now knowing how to be using it. |
Anytime you need an angle =/ arctan is there. I didn't even know it returned an angle until a few weeks ago.
It's been a while but I remember wanting to figure out an angle and not knowing exactly how I was gonna do that. I prabably did way more than I needed to. arcTan would make it faster. |
Well say you wanted to make a compas for some odd reason? =/
Trivial things I guess. Hey it could happen. I remember somebody once saying something like. "You almost never need to use arrays" hah. what a statement. |
=/ Ok so Im just crazy. gimmie a break.
We can live without angles I guess. |
Quote:
What is a transformation matrices. haha. I know graphing my transformation and I kinda know finding determinants with matrices. but that it. |
Quote:
NPC Code:newspeed = this.speed+this.thrustspeed*(keydown(0)-keydown(2)); this.speed would be the velocity, and this.angle should be the heading. The heading should be determined by the direction and the velocity... but I'm not into math enough to do this. I have done something like this, but instead of using a direction, I just had a x and y speed, which would be added to as keys were held, but using angles would make other things work much more efficently -- so, if someone (*looks at Kaimetsu*, lol) can help me out here, please do. |
Quote:
|
newx = x+sin(angle)*velocity;
Could that work? |
Quote:
Silly Kai. he was answering a question for me. Dun worry bout it. |
Quote:
|
Quote:
|
Quote:
Well, anyway, could you help me out here with the equations for changing the velocity/speed and the angle you are traveling in? I really have no clue what I should do... |
UnholyNation has a space game
|
1 Attachment(s)
Hmm...heres a script a long while ago.
It needs a TON of optimization, at least in ship movement, but I think it should be useful to you... Especially the coolness nebula effects... WARNING: DUE TO THE NUMBER OF LIGHT EFFECTS, AND THE QUALITY OF MY COMP, THIS MAY LAG ON SOME OLDER COMPS. YOU HAVE BEEN WARNED. |
Quote:
But I like your explanation kai this is very useful. |
Quote:
|
Using angles would make everything else much easier, like shooting projectiles, onwall stuff, upgrades for the ships (like rotation speed upgrades or something), and then I could use the mouse to change the angle for a secondary way to move.
BUT, if it's too hard I'll just use the two velocity variables... |
If I use a vector I wouldn't need the angle... I'll just use the vectors, heh.
Thanks for you're help, Kaimetsu :) |
| All times are GMT +2. The time now is 06:58 AM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.