A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: [help] y-axis in side scroll (jet ski)

  1. #1
    one BAD mutha FK'er astrocalder's Avatar
    Join Date
    Oct 2004
    Location
    LA
    Posts
    221

    [help] y-axis in side scroll (jet ski)

    I'm making a game (as a christmas present - deadline coming up) where you jet ski along the x-axis, up makes you jump, and down makes you go into dive mode. when you dive (y<0) you can move up or down a little to explore - press down to keep sinking to the bottom, up to return to the jet ski. i think if i add something like this to my current side scroll code...

    if y<0 dive = true;
    if dive = true (if button is down (down) y -=5;
    if button is down (up) y +=5;
    if y>0 ski = true;

    (i know it's all ucked fup, but i hope you get the idea)

    can anyone translate that into actionscript? i haven't done AS in years and i'm drawing a blank. i think if i see it written out, i'll know where it needs to go, but i can't write it.
    i'd copy and paste my code but i'm working on a different computer with no internet. any help much appreciated. happy holidays.

    ps - if anyone's interested, i'd be willing to trade art for AS. i work mostly in pixel. i'd love to do more games but i'm no good with AS.
    a little bit of imagination goes a long way...
    www.asobiproductions.com

  2. #2
    skylogic.ca MD004's Avatar
    Join Date
    Oct 2003
    Location
    Canada
    Posts
    366
    Code:
    //This is AS 1
    if (player._y < 0) {
        ski = false;
        if (Key.isDown(Key.DOWN)) {
            player._y -= 5;
        } else
        if (Key.isDown(Key.UP)) {
            player._y += 5;
        }
    } else
    if (player._y >= 0) {
        ski=true;
    }
    Hope that helps. Merry Christmas
    ~MD

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