Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - zez

Pages: 1 ... 9 10 [11]
201
so, attempting to get my map data from a txt file on a separate host, theoretically the permissions are set up for reading and writing, the code just idles forever tho. compiles fine, no weird error's, the does.... nothing. Im a little stumped, and I think Iv been staring at this altogether to long, so maybe an extra set of eyes?


{
   import org.flixel.*;
   import flash.display.Loader;
   import flash.net.URLRequest;
   import flash.events.Event;
   
   public class MapLoader extends FlxState
   {
      private var yoinkmap:Loader;
      public var map:String;
      public function MapLoader():void
      {
         var txt:FlxText
         txt = new FlxText(0, (FlxG.width / 2) - 80, FlxG.width, "Loading...")
         txt.setFormat(null, 16, 0xFFFFFFFF, "center")
         this.add(txt);
         yoinkmap = new Loader();
         yoinkmap.contentLoaderInfo.addEventListener(Event.COMPLETE, loadComplete);
         yoinkmap.load(new URLRequest("http://cropcrusade.netai.net/flash/maps/map.txt"));
      }
      override public function update():void
      {
         super.update();
      }
      private function loadComplete(event_load:Event):void
      {          
      map = event_load.target.content;
      FlxG.state = new PlayState();
      }
   }
}

202
Awesome! That answers the first part of my question, Im thinking Id have to do something similar with FlxTilemap to get that to work as well... could I just change the line where its looking for a string to a variable and do it the same way as importing dynamic text into a text field maybe? Ill play around with that later, although any other ideas would be greatly appreciated.

203
So, I guess basically, my questions are; is there a way to have a variable that controls what graphic is used for a sprite, and is there a way to remote load data that would normally be embedded?

Im working on a top down dungeon crawler, and I want the player to be able to be able to choose what graphic they use for there character, as well as modify (through the game itself, and there choices, not a level editor) the levels themselves. Im planning on having the whole thing running online, with accounts set up for each player that store the whole of there world and all variables associated with the actual character. This is more an issue with the map then the player, as I could just deal with a variable controlling what animations are used, and have 1 giant sprite sheet, although that seems kind of bassackwards, but I would still want the map array to be modifiable...

Pages: 1 ... 9 10 [11]