A Flash Developer Resource Site

Results 1 to 11 of 11

Thread: Character Movement?

  1. #1
    Member
    Join Date
    Jul 2010
    Posts
    30

    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. #2
    Member
    Join Date
    Aug 2010
    Posts
    65
    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. #3
    Member
    Join Date
    Jul 2010
    Posts
    30
    thank you skewq, this is a real help.

  4. #4
    Funkalicious TOdorus's Avatar
    Join Date
    Nov 2006
    Location
    Nijmegen, Netherlands
    Posts
    697
    Really? I had the impression that you were adding upward acceleration and the triangle just adapts to it's new vector.

  5. #5
    Member
    Join Date
    Aug 2010
    Posts
    65
    Quote Originally Posted by TOdorus View Post
    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. #6
    Funkalicious TOdorus's Avatar
    Join Date
    Nov 2006
    Location
    Nijmegen, Netherlands
    Posts
    697
    Quote Originally Posted by skewq View Post
    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. #7
    Senior Member bluemagica's Avatar
    Join Date
    Jun 2008
    Posts
    766
    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:

  8. #8
    Member
    Join Date
    Aug 2010
    Posts
    65
    Quote Originally Posted by TOdorus View Post
    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. #9
    Junior Member
    Join Date
    Aug 2010
    Posts
    17
    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. #10
    Junior Member
    Join Date
    Aug 2010
    Posts
    17
    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. #11
    Member
    Join Date
    Jul 2010
    Posts
    30
    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
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center