Changeset 1202


Ignore:
Timestamp:
Apr 8, 2012, 3:28:19 PM (9 years ago)
Author:
sam
Message:

mrpigeon: test enemy sprites.

Location:
trunk/mrpigeon
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/mrpigeon/mrpigeon.cpp

    r1200 r1202  
    3232    deco_floorrails = Tiler::Register("mrpigeon/gfx/DECO_floorRails3x.png", ivec2(72,24), ivec2(0));
    3333
     34    enemy_casualblue = Tiler::Register("mrpigeon/gfx/enemy_CasualBLUE_walk.png", ivec2(16,24), ivec2(0)); /* 6 frames */
     35    enemy_casualblueattack = Tiler::Register("mrpigeon/gfx/enemy_CasualBLUE_walkAttack.png", ivec2(16,24), ivec2(0)); /* 6 frames */
     36
    3437    pigeon_flying = Tiler::Register("mrpigeon/gfx/pigeon_flying.png", ivec2(16,16), ivec2(0)); /* 2 frames */
    3538
     
    4750    walktime = 0.0f;
    4851    flytime = 0.0f;
     52    enemytime = 0.0f;
    4953    railtime = 0.0f;
    5054    backtime = 0.0f;
     
    5458{
    5559    WorldEntity::TickGame(deltams);
    56 deltams *= 6.3478;
    5760
    5861    totaltime += deltams;
     
    7376    if (backtime > 5000.0f)
    7477        backtime -= 5000.0f;
     78
     79    enemytime += deltams;
     80    if (enemytime > 700.0f)
     81        enemytime -= 700.0f;
    7582}
    7683
     
    103110
    104111    Scene::GetDefault()->AddTile(player_walkb, (int)(walktime * 8 / 700.0f), ivec3(120, 81, 0), 0, vec2(3.0f));
     112
     113    Scene::GetDefault()->AddTile(enemy_casualblue, (int)(walktime * 6 / 700.0f), ivec3(420, 81, 0), 0, vec2(-3.0f, 3.0f));
     114    Scene::GetDefault()->AddTile(enemy_casualblueattack, (int)(walktime * 6 / 700.0f), ivec3(320, 81, 0), 0, vec2(-3.0f, 3.0f));
    105115}
    106116
     
    115125    Tiler::Deregister(deco_citybackpav);
    116126    Tiler::Deregister(deco_floorrails);
     127
     128    Tiler::Deregister(enemy_casualblue);
     129    Tiler::Deregister(enemy_casualblueattack);
    117130
    118131    Tiler::Deregister(pigeon_flying);
  • trunk/mrpigeon/mrpigeon.h

    r1200 r1202  
    2323            *deco_citybackpav,
    2424            *deco_floorrails;
     25    TileSet *enemy_casualblue,
     26            *enemy_casualblueattack;
    2527    TileSet *pigeon_flying;
    2628    TileSet *player_dashdown,
     
    3537
    3638    double totaltime;
    37     float walktime, flytime, railtime, backtime;
     39    float walktime, flytime, enemytime, railtime, backtime;
    3840};
    3941
Note: See TracChangeset for help on using the changeset viewer.