Hello and welcome to our community! Is this your first visit?
Register
Page 1 of 2 12 LastLast
Results 1 to 10 of 11
  1. #1
    Japanologist Wilio's Avatar

    Join Date
    Dec 2005
    Location
    Somewhere in time
    Posts
    5,561

    Platformer Tutorial.

    This tutorial will be sliced in 7 parts. 1 part released every 3-4 days at least. So I present the first part: Hero movement(right and left). Next chapter: laws of physic.

    http://www.swfcabin.com/open/1224457025

    ask any questions in this thread.

    if swfcabin isn't working, i'm sorry.

    Code:
    var vx:Number = 5;//speed for walking
    var startX:Number = Stage.width / 2;
    var startY:Number = Stage.height/2;//hero y starting position
    var vy:Number = 0;//gravity
    var direct:String = "Right";
    
    hero = attachMovie("hero", "hero", 777);//keep the hero with a highest depth
    hero._x = startX;
    hero._y = startY;
    
    hero.onEnterFrame = function() {
    	if (vy == 0) {
    		if (!Key.isDown(Key.LEFT) && !Key.isDown(Key.RIGHT)) {
    			this.gotoAndStop(1);
    		}
    		if (Key.isDown(Key.LEFT)) {
    			if (direct == "Right") {
    				this._xscale *= -1;
    				direct = "Left";
    			}
    			this._x -= vx;// move to the left
    			this.gotoAndStop(2);
    		}
    		if (Key.isDown(Key.RIGHT)) {
    			if (direct == "Left") {
    				this._xscale *= -1;
    				direct = "Right";
    			}
    			this._x += vx;// move to the right
    			this.gotoAndStop(2);
    		}
    	}
    };

  2. #2
    Fanatic Enthusiast James's Avatar


    Join Date
    Aug 2007
    Location
    42.
    Posts
    3,119

    Re: Platformer Tutorial.

    Wow, something that HELPS me for once.
    Cheers Will, this has been just what I'm looking for, it's easy to understand and pretty straightforwardly explained, well done.
    Can't wait for the next section.

  3. #3
    Insanity Skype's Avatar



    Join Date
    Apr 2007
    Location
    England
    Posts
    27,397

    Re: Platformer Tutorial.

    This isnt a tutorial. It's just "Copy this". You dont learn shit.

    Try explaining the code.

  4. #4
    Japanologist Wilio's Avatar

    Join Date
    Dec 2005
    Location
    Somewhere in time
    Posts
    5,561

    Re: Platformer Tutorial.

    Quote Originally Posted by Skype
    This isnt a tutorial. It's just "Copy this". You dont learn shit.

    Try explaining the code.
    Don't be stupid. I clearly explained in tutorial what does it do.

  5. #5
    Insanity Skype's Avatar



    Join Date
    Apr 2007
    Location
    England
    Posts
    27,397

    Re: Platformer Tutorial.

    Swf cabin doesnt work for some people. If you can type it in flash, why not the thread too? Or simply host somewhere else. That works.

  6. #6
    Japanologist Wilio's Avatar

    Join Date
    Dec 2005
    Location
    Somewhere in time
    Posts
    5,561

    Re: Platformer Tutorial.

    Quote Originally Posted by BN
    In parts of the tutorial you just say "Now put this code in" and you don't explain any of it. But the other parts are great. Can't wait till it's finished.
    Could you please tell the exact parts, so I can work on it?
    Also, skype, find me a swf host and i'll gladly host it.

  7. #7
    Enthusiast Vermi's Avatar

    Join Date
    May 2007
    Location
    Québec
    Posts
    2,327

    Re: Platformer Tutorial.

    Really nice tut there, I didnt read it entirely, but from the 5 first pages, I already learned alot of things (I suck at AS). When Im done reading it and trying it, I'll definitivly post my outcome.
    [img]http://**********.com/img/1284650939.jpg[/img]

  8. #8
    Insanity Skype's Avatar



    Join Date
    Apr 2007
    Location
    England
    Posts
    27,397

    Re: Platformer Tutorial.

    Quote Originally Posted by Will
    Quote Originally Posted by BN
    In parts of the tutorial you just say "Now put this code in" and you don't explain any of it. But the other parts are great. Can't wait till it's finished.
    Could you please tell the exact parts, so I can work on it?
    Also, skype, find me a swf host and i'll gladly host it.
    [s:ilwu0q1f]http://www.fwup.com[/s:ilwu0q1f] Nope that's down.

    [s:ilwu0q1f]http://www.swfup.com[/s:ilwu0q1f] Damn that's down too lol.

    http://www.swfme.com

    there are a few.

  9. #9
    Fanatic Enthusiast Alcyone's Avatar

    Join Date
    May 2008
    Posts
    3,474

    Re: Platformer Tutorial.

    http://www.trportfolio.net/upload/

    Here's a good, simple SWF host, and mostly everyone can see it. And, no i can't see swfcabin :C
    [tn=560:1296vzj9]http://www.explosm.net/db/files/Comics/Kris/makeover2.png[/tn:1296vzj9]

  10. #10
    Dedicated Member Eikill's Avatar

    Join Date
    Oct 2007
    Location
    Norway
    Posts
    965

    Re: Platformer Tutorial.

    Quote Originally Posted by Skype
    http://www.swfme.com
    That does not work for me
    [center:3sqvsoaw]You want a Lockerz.com invite? Send me a PM![/center:3sqvsoaw]


 
Page 1 of 2 12 LastLast

Posting Permissions

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