Ignore:
Timestamp:
Jun 29, 2010, 2:27:18 PM (13 years ago)
Author:
sam
Message:

Add a sprite following the mouse.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/test-map.cpp

    r20 r21  
    3232int nlayers = 0;
    3333
     34/* Player coordinates */
     35int playerx = 0, playery = 0;
     36
    3437// Load Bitmaps And Convert To Textures
    3538void LoadGLTextures(void)
     
    197200
    198201    for (int i = 0; i < nlayers; i++)
     202    {
     203        glPushMatrix();
     204        if (i == 2)
     205            glTranslatef(playerx, playery, 0.0f);
    199206        PutMap(layers[i], width, height);
     207        glPopMatrix();
     208    }
    200209}
    201210
     
    217226
    218227        video->Refresh(33.33333f);
     228
     229        SDL_GetMouseState(&playerx, &playery);
    219230
    220231        /* This could go in a separate function */
Note: See TracChangeset for help on using the changeset viewer.