Before Width: | Height: | Size: 129 KiB After Width: | Height: | Size: 64 KiB |
Before Width: | Height: | Size: 129 KiB After Width: | Height: | Size: 64 KiB |
Before Width: | Height: | Size: 129 KiB After Width: | Height: | Size: 64 KiB |
Before Width: | Height: | Size: 129 KiB After Width: | Height: | Size: 64 KiB |
Before Width: | Height: | Size: 129 KiB After Width: | Height: | Size: 64 KiB |
Before Width: | Height: | Size: 129 KiB After Width: | Height: | Size: 64 KiB |
Before Width: | Height: | Size: 129 KiB After Width: | Height: | Size: 64 KiB |
|
@ -2,6 +2,7 @@
|
||||||
}
|
}
|
||||||
sprites/sprites.spr
|
sprites/sprites.spr
|
||||||
shop/shop.spr
|
shop/shop.spr
|
||||||
|
party/party.spr
|
||||||
|
|
||||||
scripts/ch1l1_01.dat
|
scripts/ch1l1_01.dat
|
||||||
scripts/ch1l1_02.dat
|
scripts/ch1l1_02.dat
|
||||||
|
@ -58,6 +59,7 @@ backdrop/start3.gfx
|
||||||
backdrop/start4.gfx
|
backdrop/start4.gfx
|
||||||
backdrop/gameover.gfx
|
backdrop/gameover.gfx
|
||||||
backdrop/shop.gfx
|
backdrop/shop.gfx
|
||||||
|
backdrop/partybackdrop.gfx
|
||||||
loadingscreens/culture.gfx
|
loadingscreens/culture.gfx
|
||||||
loadingscreens/karate.gfx
|
loadingscreens/karate.gfx
|
||||||
loadingscreens/monitor.gfx
|
loadingscreens/monitor.gfx
|
||||||
|
|
|
@ -49,7 +49,8 @@ CD_FILESYS_LIB := CMXBoot
|
||||||
#----------------------------------------------------------------------------
|
#----------------------------------------------------------------------------
|
||||||
|
|
||||||
backend_src := gameover \
|
backend_src := gameover \
|
||||||
complete
|
complete \
|
||||||
|
party
|
||||||
|
|
||||||
enemy_src := npc \
|
enemy_src := npc \
|
||||||
npcdata \
|
npcdata \
|
||||||
|
|
34
makefile.gfx
|
@ -309,7 +309,6 @@ SHOP_GFX_TRANS_IN := $(foreach FILE,$(SHOP_GFX_TRANS),$(SHOP_GFX_DIR)/$(FILE).b
|
||||||
SHOP_GFX_TEX_OUT := $(SHOP_GFX_OUT_DIR)/shop.spr
|
SHOP_GFX_TEX_OUT := $(SHOP_GFX_OUT_DIR)/shop.spr
|
||||||
|
|
||||||
SHOP_GFX_HDR_OUT := $(INC_DIR)/shop.h
|
SHOP_GFX_HDR_OUT := $(INC_DIR)/shop.h
|
||||||
SHOP_GFX_REP_FILE :=
|
|
||||||
|
|
||||||
cleanshop:
|
cleanshop:
|
||||||
@$(RM) -f $(SHOP_GFX_TEX_OUT)
|
@$(RM) -f $(SHOP_GFX_TEX_OUT)
|
||||||
|
@ -324,6 +323,37 @@ GRAF_DIRS_TO_MAKE += $(SHOP_GFX_OUT_DIR)
|
||||||
GFX_DATA_OUT += $(SHOP_GFX_TEX_OUT)
|
GFX_DATA_OUT += $(SHOP_GFX_TEX_OUT)
|
||||||
|
|
||||||
|
|
||||||
|
#----------------------------------------------------------------------------
|
||||||
|
# Party pieces
|
||||||
|
#----------------------------------------------------------------------------
|
||||||
|
PARTY_GFX_DIR := $(GRAF_DIR)/party
|
||||||
|
PARTY_GFX_OUT_DIR := $(DATA_OUT)/party
|
||||||
|
|
||||||
|
PARTY_GFX_TRANS := balloon1 balloon2 banner1 banner2 banner3 banner4 \
|
||||||
|
bigcake jelly lefttable presents1 presents2 \
|
||||||
|
sandwiches smallcakes table2 \
|
||||||
|
toychest
|
||||||
|
# leave this as last item - some of the code needs it :(
|
||||||
|
PARTY_GFX_TRANS_IN := $(foreach FILE,$(PARTY_GFX_TRANS),$(PARTY_GFX_DIR)/$(FILE).bmp)
|
||||||
|
|
||||||
|
PARTY_GFX_TEX_OUT := $(PARTY_GFX_OUT_DIR)/party.spr
|
||||||
|
|
||||||
|
PARTY_GFX_HDR_OUT := $(INC_DIR)/party.h
|
||||||
|
PARTY_GFX_REP_FILE := $(PARTY_GFX_OUT_DIR)/rep.txt
|
||||||
|
|
||||||
|
cleanparty:
|
||||||
|
@$(RM) -f $(PARTY_GFX_TEX_OUT)
|
||||||
|
@$(ECHO) Party Cleaned
|
||||||
|
|
||||||
|
party: $(PARTY_GFX_TEX_IN)
|
||||||
|
$(PARTY_GFX_TEX_OUT) : $(PARTY_GFX_TEX_IN)
|
||||||
|
@parkgrab -c- -z+ -r+ -q+ $(PARTY_GFX_TRANS_IN) -b+ -t:8,4,1 -l:$(REPORT_DIR)/party.lbm -o:$(PARTY_GFX_TEX_OUT) -k:$(PARTY_GFX_REP_FILE)
|
||||||
|
@$(MV) -f $(PARTY_GFX_OUT_DIR)/party.h $(PARTY_GFX_HDR_OUT)
|
||||||
|
|
||||||
|
GRAF_DIRS_TO_MAKE += $(PARTY_GFX_OUT_DIR)
|
||||||
|
GFX_DATA_OUT += $(PARTY_GFX_TEX_OUT)
|
||||||
|
|
||||||
|
|
||||||
#----------------------------------------------------------------------------
|
#----------------------------------------------------------------------------
|
||||||
#----------------------------------------------------------------------------
|
#----------------------------------------------------------------------------
|
||||||
SPRITES_OUT_DIR := $(DATA_OUT)/sprites
|
SPRITES_OUT_DIR := $(DATA_OUT)/sprites
|
||||||
|
@ -411,7 +441,7 @@ GFX_DATA_OUT += $(TRANS_OUT_DAT)
|
||||||
# Big TGA backdrops
|
# Big TGA backdrops
|
||||||
#----------------------------------------------------------------------------
|
#----------------------------------------------------------------------------
|
||||||
BACKDROPS_IN_DIR := $(GRAF_DIR)/backdrop
|
BACKDROPS_IN_DIR := $(GRAF_DIR)/backdrop
|
||||||
BACKDROPS_IN := credits start1 start2 start3 start4 gameover shop
|
BACKDROPS_IN := credits start1 start2 start3 start4 gameover shop partybackdrop
|
||||||
|
|
||||||
BACKDROPS_OUT_DIR := $(DATA_OUT)/backdrop
|
BACKDROPS_OUT_DIR := $(DATA_OUT)/backdrop
|
||||||
BACKDROPS_OUT := $(foreach SCREEN,$(BACKDROPS_IN),$(BACKDROPS_OUT_DIR)/$(SCREEN).gfx)
|
BACKDROPS_OUT := $(foreach SCREEN,$(BACKDROPS_IN),$(BACKDROPS_OUT_DIR)/$(SCREEN).gfx)
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*=========================================================================
|
/*=========================================================================
|
||||||
|
|
||||||
gameover.cpp
|
party.cpp
|
||||||
|
|
||||||
Author: PKG
|
Author: PKG
|
||||||
Created:
|
Created:
|
||||||
|
@ -16,11 +16,7 @@
|
||||||
Includes
|
Includes
|
||||||
-------- */
|
-------- */
|
||||||
|
|
||||||
#include "backend\gameover.h"
|
#include "backend\party.h"
|
||||||
|
|
||||||
#ifndef __GFX_FONT_H__
|
|
||||||
#include "gfx\font.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef __PAD_PADS_H__
|
#ifndef __PAD_PADS_H__
|
||||||
#include "pad\pads.h"
|
#include "pad\pads.h"
|
||||||
|
@ -46,12 +42,20 @@
|
||||||
#include "system\vid.h"
|
#include "system\vid.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef __MATHTABLE_HEADER__
|
#ifndef __SHOP_SHOP_H__
|
||||||
#include "utils\mathtab.h"
|
#include "shop\shop.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef __LOCALE_TEXTDBASE_H__
|
#ifndef __GFX_SPRBANK_H__
|
||||||
#include "locale\textdbase.h"
|
#include "gfx\sprbank.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef __ACTOR_HEADER__
|
||||||
|
#include "gfx\actor.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef __FRONTEND_FRONTEND_H__
|
||||||
|
#include "frontend\frontend.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
@ -65,6 +69,10 @@
|
||||||
#include <trans.h>
|
#include <trans.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef __SPR_PARTY_H__
|
||||||
|
#include <party.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/*----------------------------------------------------------------------
|
/*----------------------------------------------------------------------
|
||||||
Tyepdefs && Defines
|
Tyepdefs && Defines
|
||||||
|
@ -82,7 +90,10 @@
|
||||||
Vars
|
Vars
|
||||||
---- */
|
---- */
|
||||||
|
|
||||||
CGameOverScene GameOverScene;
|
CPartyScene PartyScene;
|
||||||
|
|
||||||
|
CActorGfx *m_actorSpongebob;
|
||||||
|
CActorGfx *m_actorPatrick;
|
||||||
|
|
||||||
|
|
||||||
/*----------------------------------------------------------------------
|
/*----------------------------------------------------------------------
|
||||||
|
@ -91,24 +102,28 @@ CGameOverScene GameOverScene;
|
||||||
Params:
|
Params:
|
||||||
Returns:
|
Returns:
|
||||||
---------------------------------------------------------------------- */
|
---------------------------------------------------------------------- */
|
||||||
void CGameOverScene::init()
|
void CPartyScene::init()
|
||||||
{
|
{
|
||||||
m_image=CFileIO::loadFile(BACKDROP_GAMEOVER_GFX);
|
m_image=CFileIO::loadFile(BACKDROP_PARTYBACKDROP_GFX);
|
||||||
ASSERT(m_image);
|
ASSERT(m_image);
|
||||||
SetScreenImage((u8*)m_image);
|
SetScreenImage((u8*)m_image);
|
||||||
|
|
||||||
m_font=new ("game over font") ScalableFontBank();
|
// m_font=new ("game over font") ScalableFontBank();
|
||||||
m_font->initialise(&standardFont);
|
// m_font->initialise(&standardFont);
|
||||||
m_font->setJustification(ScalableFontBank::JUST_CENTRE);
|
// m_font->setJustification(ScalableFontBank::JUST_CENTRE);
|
||||||
m_font->setOt(5);
|
// m_font->setOt(5);
|
||||||
|
|
||||||
|
m_sprites=new ("Party sprites") SpriteBank();
|
||||||
|
m_sprites->load(PARTY_PARTY_SPR);
|
||||||
|
|
||||||
m_readyToExit=false;
|
m_readyToExit=false;
|
||||||
CFader::setFadingIn(CFader::BLACK_FADE);
|
CFader::setFadingIn(CFader::BLACK_FADE);
|
||||||
|
|
||||||
initContinue();
|
CActorPool::Reset();
|
||||||
initGameOver();
|
m_actorSpongebob=CActorPool::GetActor(ACTORS_SPONGEBOB_SBK);
|
||||||
|
m_actorSpongebob->SetOtPos(5);
|
||||||
m_state=STATE__CONTINUE;
|
m_actorPatrick=CActorPool::GetActor(ACTORS_PATRICK_SBK);
|
||||||
|
m_actorPatrick->SetOtPos(5);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -118,9 +133,14 @@ void CGameOverScene::init()
|
||||||
Params:
|
Params:
|
||||||
Returns:
|
Returns:
|
||||||
---------------------------------------------------------------------- */
|
---------------------------------------------------------------------- */
|
||||||
void CGameOverScene::shutdown()
|
void CPartyScene::shutdown()
|
||||||
{
|
{
|
||||||
m_font->dump(); delete m_font;
|
delete m_actorPatrick;
|
||||||
|
delete m_actorSpongebob;
|
||||||
|
CActorPool::Reset();
|
||||||
|
|
||||||
|
m_sprites->dump(); delete m_sprites;
|
||||||
|
// m_font->dump(); delete m_font;
|
||||||
|
|
||||||
MemFree(m_image);
|
MemFree(m_image);
|
||||||
}
|
}
|
||||||
|
@ -132,26 +152,100 @@ void CGameOverScene::shutdown()
|
||||||
Params:
|
Params:
|
||||||
Returns:
|
Returns:
|
||||||
---------------------------------------------------------------------- */
|
---------------------------------------------------------------------- */
|
||||||
void CGameOverScene::render()
|
typedef struct
|
||||||
{
|
{
|
||||||
switch(m_state)
|
CShopScene::SHOPITEM_ID m_itemId;
|
||||||
|
int m_fh;
|
||||||
|
u8 m_xOffsetBroken,m_yOffsetBroken;
|
||||||
|
u8 m_ot;
|
||||||
|
}PARTY_IMAGE;
|
||||||
|
static PARTY_IMAGE images[]=
|
||||||
|
{
|
||||||
|
{ CShopScene::SHOPITEM_BLOWER, FRM_BALLOON1, 0,0, 2 },
|
||||||
|
{ CShopScene::SHOPITEM_BLOWER, FRM_BALLOON2, 1,0, 2 },
|
||||||
|
|
||||||
|
{ CShopScene::SHOPITEM_PARTYHAT, FRM_BANNER1, 0,0, 1 },
|
||||||
|
{ CShopScene::SHOPITEM_PARTYHAT, FRM_BANNER2, 0,0, 1 },
|
||||||
|
{ CShopScene::SHOPITEM_PARTYHAT, FRM_BANNER3, 1,0, 1 },
|
||||||
|
{ CShopScene::SHOPITEM_PARTYHAT, FRM_BANNER4, 1,0, 1 },
|
||||||
|
|
||||||
|
{ CShopScene::SHOPITEM_CAKE, FRM_BIGCAKE, 1,1, 4 },
|
||||||
|
{ CShopScene::SHOPITEM_CAKE, FRM_TABLE2, 1,1, 5 },
|
||||||
|
|
||||||
|
{ CShopScene::SHOPITEM_JELLY2, FRM_JELLY, 1,1, 3 },
|
||||||
|
{ CShopScene::SHOPITEM_JELLY2, FRM_TABLE2, 1,1, 5 },
|
||||||
|
|
||||||
|
{ CShopScene::SHOPITEM_PREZZIE, FRM_PRESENTS1, 0,1, 4 },
|
||||||
|
{ CShopScene::SHOPITEM_PREZZIE, FRM_PRESENTS2, 2,1, 5 },
|
||||||
|
|
||||||
|
{ CShopScene::SHOPITEM_SARNIE, FRM_SANDWICHES, 0,1, 5 },
|
||||||
|
{ CShopScene::SHOPITEM_SARNIE, FRM_LEFTTABLE, 0,1, 5 },
|
||||||
|
|
||||||
|
{ CShopScene::SHOPITEM_CUPCAKE, FRM_SMALLCAKES, 1,1, 4 },
|
||||||
|
{ CShopScene::SHOPITEM_CUPCAKE, FRM_TABLE2, 1,1, 5 },
|
||||||
|
|
||||||
|
{ CShopScene::SHOPITEM_TEDDY, FRM_TOYCHEST, 1,0, 6 },
|
||||||
|
};
|
||||||
|
static const int numimages=sizeof(images)/sizeof(PARTY_IMAGE);
|
||||||
|
|
||||||
|
static int itemsHeld[CShopScene::NUM_SHOP_ITEM_IDS]=
|
||||||
|
{
|
||||||
|
true, // SHOPITEM_BLOWER
|
||||||
|
true, // SHOPITEM_CAKE
|
||||||
|
true, // SHOPITEM_CUPCAKE
|
||||||
|
true, // SHOPITEM_JELLY2
|
||||||
|
true, // SHOPITEM_PARTYHAT
|
||||||
|
true, // SHOPITEM_PREZZIE
|
||||||
|
true, // SHOPITEM_SARNIE
|
||||||
|
true, // SHOPITEM_TEDDY
|
||||||
|
};
|
||||||
|
DVECTOR sbpos={100,100};
|
||||||
|
DVECTOR patpos={100,100};
|
||||||
|
void CPartyScene::render()
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
int drawn[FRM_TOYCHEST+1];
|
||||||
|
PARTY_IMAGE *pimage;
|
||||||
|
|
||||||
|
for(i=0;i<FRM_TOYCHEST+1;i++)
|
||||||
{
|
{
|
||||||
case STATE__CONTINUE:
|
drawn[i]=false;
|
||||||
renderContinue();
|
}
|
||||||
break;
|
|
||||||
case STATE__CONTINUE_TIMED_OUT:
|
pimage=images;
|
||||||
renderContinue();
|
for(i=0;i<numimages;i++)
|
||||||
renderGameOver();
|
{
|
||||||
break;
|
ASSERT(pimage->m_fh<=FRM_TOYCHEST);
|
||||||
case STATE__GAME_OVER:
|
if(itemsHeld[pimage->m_itemId]&&!drawn[pimage->m_fh])
|
||||||
renderGameOver();
|
{
|
||||||
break;
|
m_sprites->printFT4(pimage->m_fh,pimage->m_xOffsetBroken*256,pimage->m_yOffsetBroken*256,0,0,pimage->m_ot);
|
||||||
case STATE__EXITING_TO_GAME:
|
drawn[pimage->m_fh]=true;
|
||||||
renderContinue();
|
}
|
||||||
break;
|
pimage++;
|
||||||
case STATE__EXITING_TO_FRONT_END:
|
}
|
||||||
renderGameOver();
|
|
||||||
break;
|
// Actors
|
||||||
|
// m_actorSpongebob->Render(sbpos,0,0,0,0);
|
||||||
|
// m_actorPatrick->Render(patpos,0,0,0,0);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*----------------------------------------------------------------------
|
||||||
|
Function:
|
||||||
|
Purpose:
|
||||||
|
Params:
|
||||||
|
Returns:
|
||||||
|
---------------------------------------------------------------------- */
|
||||||
|
void CPartyScene::think(int _frames)
|
||||||
|
{
|
||||||
|
if(!CFader::isFading())
|
||||||
|
{
|
||||||
|
if(PadGetDown(0)&(PAD_CROSS|PAD_START))
|
||||||
|
{
|
||||||
|
m_readyToExit=true;
|
||||||
|
CFader::setFadingOut();
|
||||||
|
GameState::setNextScene(&FrontEndScene);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -162,229 +256,11 @@ void CGameOverScene::render()
|
||||||
Params:
|
Params:
|
||||||
Returns:
|
Returns:
|
||||||
---------------------------------------------------------------------- */
|
---------------------------------------------------------------------- */
|
||||||
void CGameOverScene::think(int _frames)
|
int CPartyScene::readyToShutdown()
|
||||||
{
|
|
||||||
switch(m_state)
|
|
||||||
{
|
|
||||||
case STATE__CONTINUE:
|
|
||||||
thinkContinue(_frames);
|
|
||||||
break;
|
|
||||||
case STATE__CONTINUE_TIMED_OUT:
|
|
||||||
thinkContinue(_frames);
|
|
||||||
thinkGameOver(_frames);
|
|
||||||
break;
|
|
||||||
case STATE__GAME_OVER:
|
|
||||||
thinkGameOver(_frames);
|
|
||||||
break;
|
|
||||||
case STATE__EXITING_TO_GAME:
|
|
||||||
thinkContinue(_frames);
|
|
||||||
break;
|
|
||||||
case STATE__EXITING_TO_FRONT_END:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
PAUL_DBGMSG("%d",m_state);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*----------------------------------------------------------------------
|
|
||||||
Function:
|
|
||||||
Purpose:
|
|
||||||
Params:
|
|
||||||
Returns:
|
|
||||||
---------------------------------------------------------------------- */
|
|
||||||
int CGameOverScene::readyToShutdown()
|
|
||||||
{
|
{
|
||||||
return m_readyToExit&&!CFader::isFading();
|
return m_readyToExit&&!CFader::isFading();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*----------------------------------------------------------------------
|
|
||||||
Function:
|
|
||||||
Purpose:
|
|
||||||
Params:
|
|
||||||
Returns:
|
|
||||||
---------------------------------------------------------------------- */
|
|
||||||
void CGameOverScene::initContinue()
|
|
||||||
{
|
|
||||||
m_continueFontSin=0;
|
|
||||||
m_continueFontOffset=100<<2;
|
|
||||||
m_continueTimer=10*COUNTDOWN_TIME_SECOND_LENGTH;
|
|
||||||
}
|
|
||||||
void CGameOverScene::thinkContinue(int _frames)
|
|
||||||
{
|
|
||||||
int move;
|
|
||||||
|
|
||||||
// Slide the text onscreen
|
|
||||||
if(m_state==STATE__CONTINUE)
|
|
||||||
{
|
|
||||||
if(!CFader::isFading())
|
|
||||||
{
|
|
||||||
if(m_continueFontOffset)
|
|
||||||
{
|
|
||||||
move=m_continueFontOffset/10;
|
|
||||||
if(move==0)
|
|
||||||
{
|
|
||||||
move=1;
|
|
||||||
}
|
|
||||||
m_continueFontOffset-=move;
|
|
||||||
if(m_continueFontOffset<0)
|
|
||||||
{
|
|
||||||
m_continueFontOffset=0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// Countdown ( wait for text to stop first )
|
|
||||||
if(m_continueTimer)
|
|
||||||
{
|
|
||||||
int pad=PadGetDown(0);
|
|
||||||
if(pad&PAD_CROSS)
|
|
||||||
{
|
|
||||||
m_continueTimer-=m_continueTimer%COUNTDOWN_TIME_SECOND_LENGTH;
|
|
||||||
}
|
|
||||||
else if(pad&PAD_START)
|
|
||||||
{
|
|
||||||
m_readyToExit=true;
|
|
||||||
CFader::setFadingOut(CFader::BLACK_FADE);
|
|
||||||
GameState::setNextScene(&GameScene);
|
|
||||||
m_state=STATE__EXITING_TO_GAME;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
m_continueTimer-=_frames;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(m_continueTimer<=0)
|
|
||||||
{
|
|
||||||
m_continueTimer=0;
|
|
||||||
m_state=STATE__CONTINUE_TIMED_OUT;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if(m_state==STATE__CONTINUE_TIMED_OUT||STATE__EXITING_TO_GAME)
|
|
||||||
{
|
|
||||||
// Slide text back off the screen
|
|
||||||
m_continueFontOffset=(100<<2)-m_continueFontOffset;
|
|
||||||
move=m_continueFontOffset/10;
|
|
||||||
if(move==0)
|
|
||||||
{
|
|
||||||
move=1;
|
|
||||||
}
|
|
||||||
m_continueFontOffset-=move;
|
|
||||||
if(m_continueFontOffset<0)
|
|
||||||
{
|
|
||||||
if(m_state==STATE__CONTINUE_TIMED_OUT)
|
|
||||||
{
|
|
||||||
m_state=STATE__GAME_OVER;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
m_continueFontOffset=(100<<2)-m_continueFontOffset;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Change the text size
|
|
||||||
m_continueFontSin=(m_continueFontSin+(_frames*CONTINUE_STROBE_SPEED))&4095;
|
|
||||||
}
|
|
||||||
void CGameOverScene::renderContinue()
|
|
||||||
{
|
|
||||||
int yOfs;
|
|
||||||
char buf[100];
|
|
||||||
|
|
||||||
m_font->setColour(242/2,245/2,15/2);
|
|
||||||
yOfs=m_continueFontOffset>>2;
|
|
||||||
|
|
||||||
sprintf(buf,TranslationDatabase::getString(STR__BACKEND__CONTINUE));
|
|
||||||
m_font->setScale(((msin(m_continueFontSin)*CONTINUE_FONT_SCALE)>>12)+CONTINUE_FONT_BASE_SIZE);
|
|
||||||
m_font->print(256,50-m_font->getStringHeight(buf)-yOfs,buf);
|
|
||||||
|
|
||||||
sprintf(buf,"%d",m_continueTimer/COUNTDOWN_TIME_SECOND_LENGTH);
|
|
||||||
m_font->setScale(CONTINUE_FONT_SCALE+CONTINUE_FONT_BASE_SIZE);
|
|
||||||
m_font->print(256,80-m_font->getStringHeight(buf)-yOfs,buf);
|
|
||||||
|
|
||||||
if(!CFader::isFading())
|
|
||||||
{
|
|
||||||
if(m_continueFontSin>512&m_state==STATE__CONTINUE)
|
|
||||||
{
|
|
||||||
sprintf(buf,TranslationDatabase::getString(STR__BACKEND__PRESS_START));
|
|
||||||
m_font->setColour(255,0,0);
|
|
||||||
m_font->print(256,200-m_font->getStringHeight(buf),buf);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*----------------------------------------------------------------------
|
|
||||||
Function:
|
|
||||||
Purpose:
|
|
||||||
Params:
|
|
||||||
Returns:
|
|
||||||
---------------------------------------------------------------------- */
|
|
||||||
void CGameOverScene::initGameOver()
|
|
||||||
{
|
|
||||||
m_gameOverTimer=0;
|
|
||||||
m_finishedGrowingText=false;
|
|
||||||
}
|
|
||||||
void CGameOverScene::thinkGameOver(int _frames)
|
|
||||||
{
|
|
||||||
if(!m_finishedGrowingText)
|
|
||||||
{
|
|
||||||
m_gameOverTimer+=_frames;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if(!CFader::isFading()&&!m_readyToExit&&
|
|
||||||
PadGetDown(0)&(PAD_START|PAD_CROSS))
|
|
||||||
{
|
|
||||||
m_readyToExit=true;
|
|
||||||
CFader::setFadingOut(CFader::BLACK_FADE);
|
|
||||||
GameState::setNextScene(&FrontEndScene);
|
|
||||||
m_state=STATE__EXITING_TO_FRONT_END;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
void CGameOverScene::renderGameOver()
|
|
||||||
{
|
|
||||||
char buf[100],*bufPtr;
|
|
||||||
char letter[]=" \0";
|
|
||||||
int i,len,step,x;
|
|
||||||
|
|
||||||
m_font->setColour(80/2,143/2,248/2);
|
|
||||||
|
|
||||||
sprintf(buf,TranslationDatabase::getString(STR__BACKEND__GAME_OVER));
|
|
||||||
|
|
||||||
bufPtr=buf;
|
|
||||||
len=strlen(buf);
|
|
||||||
step=(400<<2)/len;
|
|
||||||
x=(256<<2)-(((len-1)*step)/2);
|
|
||||||
|
|
||||||
for(i=0;i<strlen(buf);i++)
|
|
||||||
{
|
|
||||||
int sin,scale;
|
|
||||||
|
|
||||||
sin=(m_gameOverTimer*GAMEOVER_FONT_GROWSPEED)-(i*GAMEOVER_FONT_GROWSPACING);
|
|
||||||
if(sin>0)
|
|
||||||
{
|
|
||||||
if(sin>GAMEOVER_FONT_MAXSIN)
|
|
||||||
{
|
|
||||||
sin=GAMEOVER_FONT_MAXSIN;
|
|
||||||
if(i==strlen(buf)-1)
|
|
||||||
{
|
|
||||||
m_finishedGrowingText=true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
scale=(msin(sin)*GAMEOVER_FONT_SCALE)>>12;
|
|
||||||
if(scale>50)
|
|
||||||
{
|
|
||||||
m_font->setScale(scale);
|
|
||||||
letter[0]=*bufPtr;
|
|
||||||
m_font->print(x>>2,100,letter);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
bufPtr++;
|
|
||||||
x+=step;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*===========================================================================
|
/*===========================================================================
|
||||||
end */
|
end */
|
|
@ -1,6 +1,6 @@
|
||||||
/*=========================================================================
|
/*=========================================================================
|
||||||
|
|
||||||
gameover.h
|
party.h
|
||||||
|
|
||||||
Author: PKG
|
Author: PKG
|
||||||
Created:
|
Created:
|
||||||
|
@ -11,8 +11,8 @@
|
||||||
|
|
||||||
===========================================================================*/
|
===========================================================================*/
|
||||||
|
|
||||||
#ifndef __BACKEND_GAMEOVER_H__
|
#ifndef __BACKEND_PARTY_H__
|
||||||
#define __BACKEND_GAMEOVER_H__
|
#define __BACKEND_PARTY_H__
|
||||||
|
|
||||||
/*----------------------------------------------------------------------
|
/*----------------------------------------------------------------------
|
||||||
Includes
|
Includes
|
||||||
|
@ -34,7 +34,7 @@
|
||||||
Structure defintions
|
Structure defintions
|
||||||
-------------------- */
|
-------------------- */
|
||||||
|
|
||||||
class CGameOverScene: public CScene
|
class CPartyScene: public CScene
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
void init();
|
void init();
|
||||||
|
@ -42,52 +42,11 @@ public:
|
||||||
void render();
|
void render();
|
||||||
void think(int _frames);
|
void think(int _frames);
|
||||||
int readyToShutdown();
|
int readyToShutdown();
|
||||||
char *getSceneName() {return"GameOver/Continue";}
|
char *getSceneName() {return"Party";}
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
typedef enum
|
class SpriteBank *m_sprites;
|
||||||
{
|
|
||||||
STATE__CONTINUE,
|
|
||||||
STATE__CONTINUE_TIMED_OUT,
|
|
||||||
STATE__GAME_OVER,
|
|
||||||
STATE__EXITING_TO_GAME,
|
|
||||||
STATE__EXITING_TO_FRONT_END,
|
|
||||||
} GAMEOVER_STATE;
|
|
||||||
|
|
||||||
|
|
||||||
// Continue
|
|
||||||
enum
|
|
||||||
{
|
|
||||||
CONTINUE_STROBE_SPEED=75,
|
|
||||||
CONTINUE_FONT_SCALE=100,
|
|
||||||
CONTINUE_FONT_BASE_SIZE=400,
|
|
||||||
COUNTDOWN_TIME_SECOND_LENGTH=100, // Each 'second' on the countdown lasts this long
|
|
||||||
};
|
|
||||||
void initContinue();
|
|
||||||
void thinkContinue(int _frames);
|
|
||||||
void renderContinue();
|
|
||||||
int m_continueFontOffset;
|
|
||||||
int m_continueFontSin;
|
|
||||||
int m_continueTimer;
|
|
||||||
|
|
||||||
// Game over
|
|
||||||
enum
|
|
||||||
{
|
|
||||||
GAMEOVER_FONT_SCALE=511,
|
|
||||||
GAMEOVER_FONT_GROWSPEED=150,
|
|
||||||
GAMEOVER_FONT_GROWSPACING=900,
|
|
||||||
GAMEOVER_FONT_MAXSIN=1500,
|
|
||||||
};
|
|
||||||
void initGameOver();
|
|
||||||
void thinkGameOver(int _frames);
|
|
||||||
void renderGameOver();
|
|
||||||
int m_gameOverTimer;
|
|
||||||
int m_finishedGrowingText;
|
|
||||||
|
|
||||||
|
|
||||||
GAMEOVER_STATE m_state;
|
|
||||||
class ScalableFontBank *m_font;
|
|
||||||
int m_readyToExit;
|
int m_readyToExit;
|
||||||
unsigned char *m_image;
|
unsigned char *m_image;
|
||||||
|
|
||||||
|
@ -98,7 +57,7 @@ private:
|
||||||
Globals
|
Globals
|
||||||
------- */
|
------- */
|
||||||
|
|
||||||
extern CGameOverScene GameOverScene;
|
extern CPartyScene PartyScene;
|
||||||
|
|
||||||
|
|
||||||
/*----------------------------------------------------------------------
|
/*----------------------------------------------------------------------
|
||||||
|
@ -107,7 +66,7 @@ extern CGameOverScene GameOverScene;
|
||||||
|
|
||||||
/*---------------------------------------------------------------------- */
|
/*---------------------------------------------------------------------- */
|
||||||
|
|
||||||
#endif /* __BACKEND_GAMEOVER_H__ */
|
#endif /* __BACKEND_PARTY_H__ */
|
||||||
|
|
||||||
/*===========================================================================
|
/*===========================================================================
|
||||||
end */
|
end */
|
||||||
|
|
|
@ -63,6 +63,10 @@
|
||||||
#include "map\map.h"
|
#include "map\map.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef __BACKEND_PARTY_H__
|
||||||
|
#include "backend\party.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/* Std Lib
|
/* Std Lib
|
||||||
------- */
|
------- */
|
||||||
|
@ -99,6 +103,7 @@ CScene *CSceneSelector::s_sceneList[]=
|
||||||
&FmaScene,
|
&FmaScene,
|
||||||
&MapScene,
|
&MapScene,
|
||||||
&ShopScene,
|
&ShopScene,
|
||||||
|
&PartyScene,
|
||||||
};
|
};
|
||||||
int CSceneSelector::s_sceneCount=sizeof(s_sceneList)/sizeof(CScene*);
|
int CSceneSelector::s_sceneCount=sizeof(s_sceneList)/sizeof(CScene*);
|
||||||
|
|
||||||
|
|
|
@ -623,6 +623,20 @@ void CPlayerModeBase::jump()
|
||||||
moveVel.vy=-getPlayerMetrics()->m_metric[PM__JUMP_VELOCITY]<<VELOCITY_SHIFT;
|
moveVel.vy=-getPlayerMetrics()->m_metric[PM__JUMP_VELOCITY]<<VELOCITY_SHIFT;
|
||||||
setMoveVelocity(&moveVel);
|
setMoveVelocity(&moveVel);
|
||||||
}
|
}
|
||||||
|
int spr=2;
|
||||||
|
void CPlayerModeBase::spring()
|
||||||
|
{
|
||||||
|
DVECTOR moveVel;
|
||||||
|
moveVel=*m_player->getMoveVelocity();
|
||||||
|
// moveVel.vy=-getPlayerMetrics()->m_metric[PM__JUMP_VELOCITY]<<VELOCITY_SHIFT;
|
||||||
|
moveVel.vy-=spr;
|
||||||
|
if(moveVel.vy<-getPlayerMetrics()->m_metric[PM__JUMP_VELOCITY]<<VELOCITY_SHIFT)
|
||||||
|
{
|
||||||
|
moveVel.vy=-getPlayerMetrics()->m_metric[PM__JUMP_VELOCITY]<<VELOCITY_SHIFT;
|
||||||
|
}
|
||||||
|
setMoveVelocity(&moveVel);
|
||||||
|
PAUL_DBGMSG("%d",moveVel.vy);
|
||||||
|
}
|
||||||
void CPlayerModeBase::jumpback()
|
void CPlayerModeBase::jumpback()
|
||||||
{
|
{
|
||||||
DVECTOR moveVel;
|
DVECTOR moveVel;
|
||||||
|
|
|
@ -69,8 +69,8 @@ enum
|
||||||
DEFAULT_PLAYER_MAX_SAFE_FALL_FRAMES=30,
|
DEFAULT_PLAYER_MAX_SAFE_FALL_FRAMES=30,
|
||||||
DEFAULT_PLAYER_MAX_RUN_VELOCITY=6,
|
DEFAULT_PLAYER_MAX_RUN_VELOCITY=6,
|
||||||
DEFAULT_PLAYER_RUN_SPEEDUP=2<<2,
|
DEFAULT_PLAYER_RUN_SPEEDUP=2<<2,
|
||||||
DEFAULT_PLAYER_RUN_REVERSESLOWDOWN=4<<2,
|
DEFAULT_PLAYER_RUN_REVERSESLOWDOWN=3<<2,
|
||||||
DEFAULT_PLAYER_RUN_SLOWDOWN=3<<2,
|
DEFAULT_PLAYER_RUN_SLOWDOWN=2<<2,
|
||||||
DEFAULT_PLAYER_PLAYER_GRAVITY=2<<2,
|
DEFAULT_PLAYER_PLAYER_GRAVITY=2<<2,
|
||||||
DEFAULT_PLAYER_TERMINAL_VELOCITY=8,
|
DEFAULT_PLAYER_TERMINAL_VELOCITY=8,
|
||||||
DEFAULT_BUTT_FALL_VELOCITY=14,
|
DEFAULT_BUTT_FALL_VELOCITY=14,
|
||||||
|
@ -167,6 +167,7 @@ public:
|
||||||
void moveRight();
|
void moveRight();
|
||||||
int slowdown();
|
int slowdown();
|
||||||
void jump();
|
void jump();
|
||||||
|
void spring();
|
||||||
void jumpback();
|
void jumpback();
|
||||||
void fall();
|
void fall();
|
||||||
void buttFall();
|
void buttFall();
|
||||||
|
|
|
@ -103,6 +103,14 @@ SOURCE=..\..\..\source\backend\gameover.cpp
|
||||||
|
|
||||||
SOURCE=..\..\..\source\backend\gameover.h
|
SOURCE=..\..\..\source\backend\gameover.h
|
||||||
# End Source File
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=..\..\..\source\backend\party.cpp
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=..\..\..\source\backend\party.h
|
||||||
|
# End Source File
|
||||||
# End Group
|
# End Group
|
||||||
# Begin Group "enemy"
|
# Begin Group "enemy"
|
||||||
|
|
||||||
|
@ -2652,6 +2660,10 @@ SOURCE=..\..\..\out\USA\include\BigLump.h
|
||||||
# End Source File
|
# End Source File
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=..\..\..\out\USA\include\party.h
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
SOURCE=..\..\..\out\USA\include\shop.h
|
SOURCE=..\..\..\out\USA\include\shop.h
|
||||||
# End Source File
|
# End Source File
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
|
|