A Flash Developer Resource Site

1. ## Character Movement?

Hey everyone.

I was wondering if anyone new the character movement and gravity settings for this game.

http://www.salomonsson.se/siberia/

2. 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!

3. thank you skewq, this is a real help.

4. Really? I had the impression that you were adding upward acceleration and the triangle just adapts to it's new vector.

5. 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

6. 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.

7. 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.

8. 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

9. some days before,I made a example just like you want. I will paste the core code later.
------------------------------------------------------------------------------------
Sorry,my English is not fluent.

10. 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;

11. Thank you

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•

 » Home » Movies » Tutorials » Submissions » Board » Links » Reviews » Feedback » Gallery » Fonts » The Lounge » Sound Loops » Sound FX » About FK » Sitemap