A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: CS6 - AS3 - Game Development help with Array

  1. #1
    Junior Member
    Join Date
    Oct 2012
    Posts
    2

    CS6 - AS3 - Game Development help with Array

    Hey everyone.

    I'm working on a project for college currently and we're doing AS3.

    My problem is I was wondering how i'd get my workers from one level to the next. in the game you start with 5 workers which are considered your lifes you have to get atleast one of them to the finish point without him dying etc if you lose one then you will only have 4 in the next level and if you lost 2 you'd only have 3 to continue the future levels with if you manage to complete the current one. so what I need to find out how to do is to use some form of vairable i was informed an array might work to bring my surviving workers to the next level.

    I'm working with Box2D aswell. the only code i currently have is collosion codes so the workers can die.

    any help appericated. perfered video tutorials <-- fastest way for me to learn personally.

    feel free to email me: leebrookes@live.com

    Thanks

  2. #2
    Senior Member realMakc's Avatar
    Join Date
    Oct 2002
    Posts
    927
    who needs video tutorial for array? seriously?

    array is like a smart bag where you put your stuff giving each item the tag with unique number, so that you can later ask "hey bag, gimme back item number 4", and it gives whatever was with the tag "4". an example:

    Code:
    var bag:Array = new Array();
    bag [0] = "bread";
    bag [1] = "milk";
    bag [2] = "condoms";
    trace (bag [1]); // traces "milk"
    trace (bag.length); // traces "3" - you have three items there
    so yes you could put all your characters aka workers into some array, one by one, and then pass the array to next level.
    who is this? a word of friendly advice: FFS stop using AS2

  3. #3
    Junior Member
    Join Date
    Oct 2012
    Posts
    2
    Thanks, i'll work on it tomorrow. sorry for my noobness but i'm still learning AS3 started two weeks ago and doing other projects along side it.

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