/[bontz]/bontz/bontz.cpp
ViewVC logotype

Diff of /bontz/bontz.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.8 by swerk, Mon Aug 4 18:50:15 2003 UTC revision 1.9 by swerk, Tue Aug 5 14:53:44 2003 UTC
# Line 48  Line 48 
48    
49  #include "lib/CSprite.h"  #include "lib/CSprite.h"
50  #include "lib/CSpriteBase.h"  #include "lib/CSpriteBase.h"
51    #include "lib/textbox.h"
52    
53  #include "SDL/SDL.h"  #include "SDL/SDL.h"
54  #include "SDL/SDL_mixer.h"  #include "SDL/SDL_mixer.h"
# Line 70  CSpriteBase bellguybase; Line 71  CSpriteBase bellguybase;
71    
72  CSprite furgason;  CSprite furgason;
73  CSpriteBase furgasonbase;  CSpriteBase furgasonbase;
74  CSprite textbox;  TextBox message;
 CSpriteBase textboxbase;  
75    
76  Mix_Music *music;  Mix_Music *music;
77    
# Line 114  void DrawDialog(int x, int y){ Line 114  void DrawDialog(int x, int y){
114  void DrawBG()  void DrawBG()
115  {  {
116    DrawIMG(back, 0, 0);    DrawIMG(back, 0, 0);
117    //  DrawDialog(0, 0);    //  DrawDialog(0,0);
118  }  }
119    
120  void DrawScene()  void DrawScene()
# Line 145  void DrawScene() Line 145  void DrawScene()
145    fish4.clearBG();    fish4.clearBG();
146    fish4.updateBG();    fish4.updateBG();
147    
   textbox.clearBG();  
   textbox.updateBG();  
   
148    bellguy.clearBG();    bellguy.clearBG();
149    bellguy.updateBG();    bellguy.updateBG();
150    
# Line 165  void DrawScene() Line 162  void DrawScene()
162    bellguy.draw();    bellguy.draw();
163    
164    furgason.draw();    furgason.draw();
   textbox.draw();  
165    
166    SDL_Flip(screen);    SDL_Flip(screen);
167  }  }
# Line 238  int main(int argc, char *argv[]) Line 234  int main(int argc, char *argv[])
234    bellguy.setTrack(0);    bellguy.setTrack(0);
235    bellguy.startAnim();    bellguy.startAnim();
236    
237    
238      message.init("BONTZ!  ...testing 12345\nis this thing on? :^)", 50, 150, screen);
239    
240    furgasonbase.init("media/sprite/hero/furgason");    furgasonbase.init("media/sprite/hero/furgason");
241    //furgason.init(&furgasonbase, screen);    //furgason.init(&furgasonbase, screen);
242    //furgason.set(200, 200);    //furgason.set(200, 200);
# Line 245  int main(int argc, char *argv[]) Line 244  int main(int argc, char *argv[])
244    //furgason.setTrack(0);    //furgason.setTrack(0);
245    //furgason.startAnim();    //furgason.startAnim();
246    
247    textboxbase.init("media/menu");    
   textbox.init(&textboxbase, screen);  
   textbox.set(400, 300);  
   textbox.setSpeed(1);  
   textbox.setTrack(0);  
   textbox.startAnim();  
   
248    fish1.init(&fishbase1,screen);    fish1.init(&fishbase1,screen);
249    fish1.set(40,300);    fish1.set(40,300);
250    fish1.setSpeed(1);    fish1.setSpeed(1);
# Line 287  int main(int argc, char *argv[]) Line 280  int main(int argc, char *argv[])
280    InitImages();    InitImages();
281    DrawBG();    DrawBG();
282    
283    
284      message.draw();
285    
286    
287    
288    
289    int done=0;    int done=0;
290    
291    int LastUpdate;    int LastUpdate;
# Line 311  int main(int argc, char *argv[]) Line 310  int main(int argc, char *argv[])
310        //this should eventually be changed so it adds a number to screen        //this should eventually be changed so it adds a number to screen
311        //so it doesn't always overwrite the same file        //so it doesn't always overwrite the same file
312        //ex:  screen1.bmp screen2.bmp screen3.bmp  and so on        //ex:  screen1.bmp screen2.bmp screen3.bmp  and so on
313        if( event.key.keysym.sym == SDLK_PRINT){        if( event.key.keysym.sym == 's'){
314          //delay the print screen longer than the normal game time, so we don't continually take screen shots          //delay the print screen longer than the normal game time, so we don't continually take screen shots
315          if(PrintScreenTime+GameSpeed*100<SDL_GetTicks()){          if(PrintScreenTime+GameSpeed*100<SDL_GetTicks()){
316            PrintScreenTime=SDL_GetTicks();            PrintScreenTime=SDL_GetTicks();

Legend:
Removed from v.1.8  
changed lines
  Added in v.1.9

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26