Ignore:
Timestamp:
Apr 4, 2011, 2:05:55 AM (11 years ago)
Author:
sam
Message:

monsterz: start rearranging the title screen.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/monsterz/title.cpp

    r735 r754  
    3939
    4040private:
    41     int title, stars, clouds, eagle, logo;
     41    int title, stars, clouds, eagle, logo, ground;
    4242    int anim[6];
    4343    int event[7];
     
    6262    vec2 cloudpos[5];
    6363    vec2 cloudspeed[5];
     64
     65    vec2i ground_pos;
    6466
    6567    int eagley;
     
    120122    srand(rand() ^ time(NULL));
    121123
    122     data->logo = Tiler::Register(PNG_LOGO, vec2i(380, 181), 0, 1.0f);
     124    data->logo = Tiler::Register(PNG_TITLE_LOGO, vec2i(380, 181), 0, 1.0f);
     125    data->ground = Tiler::Register(PNG_TITLE_GROUND, vec2i(384, 80), 0, 1.0f);
     126    data->ground_pos = vec2i(640 / 2 - 384 / 2, 480 / 4 - 80);
     127
    123128    data->title = Tiler::Register(PNG_TITLE, 384, 0, 1.0f);
    124129    data->stars = Tiler::Register(PNG_STARS, vec2i(384, 144), 0, 1.0f);
     
    273278    /* The background, always here. */
    274279    int backid = (int)data->period;
    275     Scene::GetDefault()->AddTile((data->title << 16) | backid, 24, 72, 1, 0);
     280    Scene::GetDefault()->AddTile((data->title << 16) | backid,
     281                                 data->ground_pos.x, data->ground_pos.y, 1, 0);
    276282
    277283    /* The stars */
     
    309315    }
    310316
     317    /* The ground. */
     318    for (int x = (data->ground_pos.x - 1) % 384 - 384;
     319         x < Video::GetSize().x; x += 384)
     320    {
     321        Scene::GetDefault()->AddTile((data->ground << 16) | 0,
     322                                     x, data->ground_pos.y, 0, 0);
     323    }
     324
    311325    /* Maybe an animation? */
    312326    int tiler = 0;
     
    336350    }
    337351    if (tiler)
    338         Scene::GetDefault()->AddTile((tiler << 16) | id, 24 + pos.x, 72 + pos.y, 1, 0);
     352        Scene::GetDefault()->AddTile((tiler << 16) | id,
     353                                     data->ground_pos.x + pos.x,
     354                                     data->ground_pos.y + pos.y, 1, 0);
    339355
    340356    /* The logo, on top of the rest. */
     
    351367    Input::UntrackMouse(this);
    352368    Tiler::Deregister(data->logo);
     369    Tiler::Deregister(data->ground);
    353370    Tiler::Deregister(data->title);
    354371    Tiler::Deregister(data->stars);
Note: See TracChangeset for help on using the changeset viewer.