Page 2 of 2 FirstFirst 12
Results 11 to 15 of 15
  1. #11
    Join Date
    Mar 2003
    Location
    Brisbane Australia
    Posts
    1,429
    search google for "flash document class"

    or check out the link below

    http://www.heaveninteractive.com/web...t-30-tutorial/

  2. #12
    Join Date
    Dec 2009
    Posts
    10
    Thx Browndog, I will check it out

    johndow12: It wouldn't work at the time I did this thread. I'm at the wrong computer right now but I can try to attach it on saturday.

  3. #13
    Join Date
    Dec 2009
    Posts
    10
    There, I finally managed to attach my files to a post.
    I've come quite a bit with my game, converted all of the code I had in the frame into an .as3-file, however I still have the enemies and bullets in other .as3-files, but I don't think that this is a problem really.

    However, I've now got this problem: When you walk onto the obstacles, "velocity" is set to 0 and "inAir" is set to false, and the main char is set to his first-frame (stand still). But when I try to walk when on the obstacle, it stays in the first-frame, only to sometimes play the walk-cycle without stopping when I release the left/right keys.

    Other than that, feel free to comment on my code, such as tips on how to improve and so forth.

    I would also like to make a boss-character, any tips on that?

    Thanks a bunch
    Attached Files Attached Files
    • File Type: zip 6.zip (1.86 MB, 197 views)

  4. #14
    Join Date
    Mar 2003
    Location
    Brisbane Australia
    Posts
    1,429
    Why are you setting shootAllow=true; in a timer that fires every 300 milliseconds?

    Code:
                           if (event.keyCode == 37) {
    				left=false;
    				if (!inAir && !down) {
    					dude.gotoAndPlay(1);
    				}
    			} else if (event.keyCode == 39) {
    				right=false;
    				if (!inAir && !down) {
    					dude.gotoAndPlay(1);
    				}
    			}
    the problem on the obstacle is because in the above code in the keyUpF function the inAir variable is sometimes true when on an obstacle so the gotoAndPlay(1) doesn't execute.

  5. #15
    Join Date
    Dec 2009
    Posts
    10
    It is there so that it doesn't fire bullets all the time when you press space, only one bullet each 300 milliseconds(if you keep pressing).


    Hmm, seems weird, any way to fix this? I mean I am setting the inAir to false when landing on the obstacle.


    Okay, I put the "inAir = false;" before "velocity=0;" and it worked. I also put "dude.gotoAndStop(32);" in the "if (inAir) { " leaving the main char in the jumping frame everytime he's in air.
    Last edited by ad3pt_swe; 03-11-2010 at 10:00 AM.

Page 2 of 2 FirstFirst 12

Tags for this Thread

Posting Permissions

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