-
Character Movement?
Hey everyone.
I was wondering if anyone new the character movement and gravity settings for this game.
http://www.salomonsson.se/siberia/
-
well nobody can really 'know' except the author you can achieve similar results just having a var angle, and every time you press space the angle gets increased and if not it gets multiplied by a gravity factor, how much i cant tell from the looks of it, but maybe somewhere like 0.2, experiment!
-
thank you skewq, this is a real help.
-
Funkalicious
Really? I had the impression that you were adding upward acceleration and the triangle just adapts to it's new vector.
-
Originally Posted by TOdorus
Really? I had the impression that you were adding upward acceleration and the triangle just adapts to it's new vector.
can be done that way too, the bigger problem here, i think, is to fine tune the added angle/velocity and gravity values for a nice gameplay, not whether the anlge determines the velocity or the velocity determines the angle
-
Funkalicious
Originally Posted by skewq
can be done that way too, the bigger problem here, i think, is to fine tune the added angle/velocity and gravity values for a nice gameplay, not whether the anlge determines the velocity or the velocity determines the angle
I wan't really explicit, by my post related to that. In my opinion it's easier to balance when you use the y-component of the velocity instead of the angle, as angle would affect both x and y movement.
-
Senior Member
That's a simple helicopter game clone, and the basic mechanism is adding upward speed while the space is pressed, and adding downward speed, while it isn't. The angle of the sprite has nothing to do with the movement, it is just a visual effect, and is calculated simply based on the y speed.
If you like me, add me to your friends list .
PS: looking for spriters and graphics artists for a RPG and an Arcade fighting project. If you can help out, please pm me!
My Arcade My Blog
Add me on twitter:
-
Originally Posted by TOdorus
I wan't really explicit, by my post related to that. In my opinion it's easier to balance when you use the y-component of the velocity instead of the angle, as angle would affect both x and y movement.
you may be right about balancing, however it depends on the type of mechanics you want to create, becouse when using the y component you get constant x speed, while using angle the speed of both y and x are varying. This exact game is surelly only adding upwards velocity on keypress but i was talking about a general way how you might do this
-
some days before,I made a example just like you want. I will paste the core code later.
------------------------------------------------------------------------------------
Sorry,my English is not fluent.
-
this is my code:
var arg = this._rotation*Math.PI/180;
var vx = Math.cos(arg)*20;
var vy = Math.sin(arg)*20;
vy += 0.5;
this._rotation = Math.atan2(vy, vx)*180/Math.PI;
this._x += vx;
this._y += vy;
-
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|