Changeset 754


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

monsterz: start rearranging the title screen.

Location:
trunk/monsterz
Files:
2 added
4 edited
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/monsterz/Makefile.am

    r740 r754  
    1313EXTRA_DIST = $(PNG) $(WAV)
    1414
    15 PNG = gfx/background.png gfx/board.png gfx/logo.png gfx/tiles.png \
     15PNG = gfx/background.png gfx/board.png gfx/tiles.png \
    1616      gfx/elements.png gfx/font1.png gfx/font2.png gfx/title0.png \
    1717      gfx/titleanim0.png gfx/titleanim1.png gfx/titleanim2.png \
     
    2020      gfx/titleevent3.png gfx/titleevent4.png gfx/titleevent5.png \
    2121      gfx/titleevent6.png gfx/titleclouds.png gfx/titlestars.png \
    22       gfx/titleeagle.png gfx/icons.png
     22      gfx/titleeagle.png gfx/icons.png \
     23      gfx/title/logo.png gfx/title/ground.png
    2324WAV = sound/applause.wav sound/boing.wav sound/click.wav sound/ding.wav \
    2425      sound/duh.wav sound/grunt.wav sound/laugh.wav sound/pop.wav \
  • trunk/monsterz/monsterz.h

    r424 r754  
    1414static char const * const PNG_BACKGROUND = "monsterz/gfx/background.png";
    1515static char const * const PNG_BOARD = "monsterz/gfx/board.png";
    16 static char const * const PNG_LOGO = "monsterz/gfx/logo.png";
    1716static char const * const PNG_TILES = "monsterz/gfx/tiles.png";
    1817static char const * const PNG_ELEMENTS = "monsterz/gfx/elements.png";
    1918static char const * const PNG_ICONS = "monsterz/gfx/icons.png";
     19
     20static char const * const PNG_TITLE_LOGO = "monsterz/gfx/title/logo.png";
     21static char const * const PNG_TITLE_GROUND = "monsterz/gfx/title/ground.png";
     22
    2023static char const * const PNG_TITLE = "monsterz/gfx/title0.png";
    2124static char const * const PNG_CLOUDS = "monsterz/gfx/titleclouds.png";
  • 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.