RDY 2 GAME

Posted by spotco on November 20, 2012
Started playing Aion. Slippery slope, etc.

DON'T DRINK LIKE SCRUB IMMA SIP N GRIP

Had time to work on side projects again after what seemed like months of being slammed by classes+hw. Recently my usb harddrive broke (all my anime wp's and videogame osts ;_;) so I've actually been using Scrapeplayer as my main music source now. It's actually been working fairly well, and a few days ago I patched up the biggest problems I've had with it. First, the mysterious delay when searching through loaded songs (which turned out to be a trivial fix, can you spot the error here?)

public function list(tar:String) {
  var lister:Timer = new Timer(1);
  var i:int = 0;
  var ct:int = 0;
  tar = tar.toLowerCase();
  lister.addEventListener(TimerEvent.TIMER, function(e) {
    if (i < songs.length) {
      if (songs[i].filename.toLowerCase().indexOf(tar) != -1) {
        dispatchEvent(new SPEvt(SPEvt.PRINT_EVT, { msg:songs[i].filename } ));
        ct++;
      }
    } else {
      dispatchEvent(new SPEvt(SPEvt.PRINT_EVT, { msg:ct + " songs total." } ));
      lister.stop();
    }
    i++;
  });
  lister.start();
}

The other problem, loading/listing speed which I think I fixed in a pretty amusing way. So the timer in AS3 can only fire at most once every 20ms or so. What do you do if you want to send requests at a faster rate? Just use a loop and send multiple requests every timer tick, obviously. QUALITY PERFORMANCE SOLUTIONS. Type LISTSPEED 20 in scrapeplayer to see this amazing bit of code at work.

Finally, started work again on iOS game after a 2month+ hiatus (I felt guilty!). The editor is still a giant mess that I'm surprised still works (I mean, just look at the onmouseup function here. And the double enumeration of all gameobject types here and here. 0/1 general good style).

Also, managed to cram even more redundant information into every level file.

{
    "assert_links": 8,
    "objects": [
        {"x": 430, "y": 53, "type": "birdflock", "label": "0"},
        {"x": 556, "y": 155, "type": "dogbone", "bid": 1, "label": "BID:1"}
    ],
    "start_x": 0,
    "connect_pts": {"x2": 1347, "x1": 40, "y2": 512, "y1": 52},
    "start_y": 0,
    "islands": [
        {"can_fall": true, "ground": "open", "y1": 52, "hei": 50, "x2": 352, "x1": 40, "y2": 50, "type": "line", "ndir": "left"},
        {"can_fall": true, "ground": "open", "y1": 50, "hei": 50, "x2": 491, "x1": 352, "y2": 53, "type": "line", "ndir": "left"}
    ]
}

This does not make for a pretty json input and json output method. All this new stuff was for automatic level-generation and repeating, which I managed to get (generally) working in one afternoon. Video:


leave a comment!