The McLeodGaming forums were permanently closed on April 30th, 2020. You are currently viewing a read-only archive.
View unanswered posts | View active topics It is currently Fri May 15, 2020 1:57 am

Forum rules


IMPORTANT

This Forum is for Flash related questions ONLY! Do not ask questions about spriting, Game Maker, Photoshop, or anything else not related to Flash.



 [ 4 posts ] 
I need help with arrays 
Author Message

Joined: Wed Aug 29, 2012 7:24 pm
Posts: 3
Gender: Anime Girl
im tring to make it that i can keep re-using the platforms with this code
but my player only responds to one and falls through the other platform.

Code:
for (var i:Number = 0; i < Main.floors.length; i++)
         {
            if (Main.floors[i].hitTestObject(this))
            {
               grav = 0;
               grav--;
               trace("hit the floor")
            }
         }


but instead this code can call anything thats in the floor array.
so if there over 9000 platforms in the testlvel that are all in the floors array then it calls all of them so when the player hits any of the 9000(no matter which one) it does my code.


Wed Aug 29, 2012 7:30 pm

Joined: Wed Aug 29, 2012 7:24 pm
Posts: 3
Gender: Anime Girl
Heres my classes if its needed :/
http://www.mediafire.com/?04uhz1a46cjcwae


Wed Aug 29, 2012 10:56 pm
User avatar

Joined: Fri Jan 02, 2009 6:02 pm
Posts: 7283
Location: Australia
Country: Australia (au)
Gender: Male
MGN Username: Tid
Currently Playing: Deep™ The™ Game™
AS2 or 3

_________________
ImageImageImageImage
Ask me anything!!!
Special thanks to Steven for my beautiful Deep avatar! <3


Thu Aug 30, 2012 1:32 am
WWW

Joined: Wed Aug 29, 2012 7:24 pm
Posts: 3
Gender: Anime Girl
as3


Thu Aug 30, 2012 8:53 am
Display posts from previous:  Sort by  
 [ 4 posts ] 

Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

cron
Powered by phpBB® Forum Software © phpBB Group
Designed by ST Software for PTF.