Ignore:
Timestamp:
Oct 21, 2011, 7:06:42 PM (10 years ago)
Author:
sam
Message:

monsterz: add a sprite with rocks in front of the title screen.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/monsterz/title.cpp

    r958 r1030  
    4040
    4141private:
    42     TileSet *title, *stars, *clouds, *logo, *ground;
     42    TileSet *title, *stars, *clouds, *logo, *ground, *rocks;
    4343    TileSet *anim[6];
    4444    TileSet *event[7];
     
    6666    vec2 cloudspeed[MAX_CLOUDS];
    6767
    68     ivec2 ground_pos;
     68    ivec2 ground_pos, rocks_pos;
    6969
    7070    struct
     
    141141    data->logo = Tiler::Register(PNG_TITLE_LOGO, ivec2(380, 181), 0, 1.0f);
    142142    data->logo_sprite = new Sprite(data->logo, 0);
    143     data->logo_sprite->position = vec3(26, 250, 3);
     143    data->logo_sprite->position = vec3(226, 450, 3);
    144144    Ticker::Ref(data->logo_sprite);
    145145
     
    147147    data->ground_pos = ivec2((vec2)(bbox[1] - bbox[0]) / ivec2(2, 4))
    148148                     - ivec2(384, 80);
     149
     150    data->rocks = Tiler::Register(PNG_TITLE_ROCKS, ivec2(640, 155), 0, 1.0f);
     151    data->rocks_pos = ivec2((vec2)(bbox[1] - bbox[0]) / ivec2(2, 2))
     152                    - ivec2(320, 240);
    149153
    150154    data->title = Tiler::Register(PNG_TITLE, 384, 0, 1.0f);
     
    351355    }
    352356
     357    /* The rocks */
     358    Scene::GetDefault()->AddTile(data->rocks, 0,
     359                                 ivec3(data->rocks_pos) + ivec3(0, 0, 10), 0);
     360
    353361    /* Maybe an animation? */
    354362    TileSet *tiler = NULL;
     
    394402    Ticker::Unref(data->logo_sprite);
    395403    Tiler::Deregister(data->ground);
     404    Tiler::Deregister(data->rocks);
    396405    Tiler::Deregister(data->title);
    397406    Tiler::Deregister(data->stars);
Note: See TracChangeset for help on using the changeset viewer.