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" |
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 |
|
|
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() |
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 |
|
|
162 |
bellguy.draw(); |
bellguy.draw(); |
163 |
|
|
164 |
furgason.draw(); |
furgason.draw(); |
|
textbox.draw(); |
|
165 |
|
|
166 |
SDL_Flip(screen); |
SDL_Flip(screen); |
167 |
} |
} |
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); |
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); |
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; |
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(); |