Hey everyone.
I was wondering if anyone new the character movement and gravity settings for this game.
http://www.salomonsson.se/siberia/
Printable View
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. :)
Really? I had the impression that you were adding upward acceleration and the triangle just adapts to it's new vector.
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.
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;
Thank you:):):):):):):):):)