From 6c5e152bb8e63f1b5a7065bffb91564d0d1cee4c Mon Sep 17 00:00:00 2001 From: Paul Date: Sun, 25 Mar 2001 20:36:28 +0000 Subject: [PATCH] --- Graphics/pickups/+balloon.bmp | Bin 742 -> 534 bytes Graphics/pickups/+bubblemixture.bmp | Bin 502 -> 502 bytes Graphics/pickups/+glasses.bmp | Bin 326 -> 454 bytes Graphics/pickups/+health100.bmp | Bin 294 -> 614 bytes Graphics/pickups/+health25.bmp | Bin 250 -> 514 bytes Graphics/pickups/+health50.bmp | Bin 250 -> 526 bytes Graphics/pickups/+jellyammo.bmp | Bin 502 -> 526 bytes Graphics/pickups/+pants.bmp | Bin 582 -> 550 bytes Graphics/pickups/+spatula.bmp | Bin 646 -> 630 bytes makefile.gaz | 1 + source/game/pause.cpp | 27 +- source/pickups/pballoon.cpp | 18 +- source/player/player.cpp | 14 +- source/player/player.h | 2 +- source/player/pmbloon.cpp | 600 +----------------- source/player/pmbloon.h | 5 +- source/player/pmfly.h | 2 +- source/player/pmodes.cpp | 78 +-- source/player/pmodes.h | 39 +- source/player/psbutt.cpp | 12 +- source/player/psbutt.h | 12 +- source/player/psduck.cpp | 12 +- source/player/psduck.h | 12 +- source/player/psfall.cpp | 8 +- source/player/psfall.h | 8 +- source/player/psidle.cpp | 12 +- source/player/psidle.h | 12 +- source/player/psjump.cpp | 4 +- source/player/psjump.h | 4 +- source/player/psrun.cpp | 4 +- source/player/psrun.h | 4 +- source/player/pstates.h | 4 +- .../spongebob project/spongebob project.dsp | 8 + 33 files changed, 171 insertions(+), 731 deletions(-) diff --git a/Graphics/pickups/+balloon.bmp b/Graphics/pickups/+balloon.bmp index 7e730010d9f9b07b3d3c9e0b9a6ffd5b4f796f0d..2a80450975dcbb4ea4db5e30b588c9c1ad9c48b4 100644 GIT binary patch literal 534 zcmY*VF-yZx5WW*Pm%JJR3I$W42yV5wH%;Rp4oVtFq2yhu(oHH9XPsPBbP`1hMWOU3 zbQKf?I~B>?!NIXZhUdMcMS9`;-uH!f-#gCPvlbw!7V`!p%UER~EHVQ;A;8vB3WL3d z;;*^Zf<6pjusnp}<`0Z_6#Skjm|Q9tKPrg(tOtzu7$)B_D5aqL8N=?;jgAEnB0Z;! z4bsv7m9712tybne=5vA@geF~?1{H+BoSnuBw_5cJBI7!V#|m+U1@o|D>)R&z6v*vz zrkQy3PK&Y_7Q=Pg*Lg@CcCs8unZzS?D`An!9)(kX{&DA17*HwoUcDFHpYapvbDZCf zqUepJYwHUlPt<;W(K8(IJm``iXj3xl#PgUW9b0&gFz|R(Gr)Sd%`w*mpx66i6^(3` vlCw-bfz{)wkuDqqP_Ge5D^ItkmF(7vu4g{^YhFFic?^?POk4PvtrGqK?)Pd+ literal 742 zcmYk3UrbU_9LEoig+{^NzZWoZ~>8AW?`GP=TIGd&@^^%6*ALi6jVPH$w2B|%0 zQHj#lW;!!@OGLfA^rG`}R_m=dduVO8a@`C5*?c%1u$td~}(9r=v2ly32fH{9I-!?Dt2rehoIC27tACF!`#{YpNm}Vz((kuUh zU?$ZxAt+V1j{`|!!^F2Bg~);vpQ>hRx)M?z(E1anuEFV=AF!f-|Vi?}1Ak?m}*GuU9D7ha(WK_w4R+JC774g4yPu zOF;Ndy*aaLc8QS1IiB>TGxH4#52v5iOZXh&$~3<#*C^Jw*wZRtk_yIV$Trlzq&pYY z^*~g?5ThN_^D3n^9#G(UkaV_s(SMiVsq3@9@c=|fXNd*+bN7wG-agDlyu+K$a5rgk u8ehkvWWhN6nIuE*`T~m)?^GyK??k>AO)j-)fo$KT)&j`S7vB3v6)c-?q|QT_|?j?@7{!d?QSs)Olm!z13pWo8~mPkF$PI^gdB5K)$8 zWb&qmSlY5oChG#zbJo!`wI=0QiWm!73b16zCIwhB!@1iyQ_St0=e-v>>4{3p6T)xq zmH?dEmhk;aZ?CMl9|S?ft~u8SVF{g%?(vthS8@lSZn)TgiKhp0U?zu* zSYz>=b@F3w%B3)ali6}7pmEo&J(Sh1fK=y?s!MYkh>dE-KY#+>4%yFgjF3v9U!LO$w`n5$PT@P=weznGzWU z8C^<}LMjilhdM-*7IcVyNazv~nNaitUAAx5zTq97d3PD6qxZWEwDIBIg3)8@F=e2` z9UzF`XPHu}@l2!Q8VdG9WY`Hi(J43>+lAwK1r9fM;W3ei)X555pXA{FB@6H8Z}9W{ z0l&W=psFeia2!CDi)k89(dz-C*m4sI$_lkn62w8@5qkYg5=l1eb)ZK(MZaGu5bCx; zi7139?bMwTjz353=@JBcm(cB?Rt;v>Y&J}z*Y$lSo@b3g^b*7JtJ`fdwe!;?r;;%% zb%-&oUF72}nhmTidB(e`os2a$X)$SbF>7~n%o3-)D|{ZdSw^*c+?xyhWUis)d)X?7 zYHuU>kGqar&UnXLsXfgZDe#a>JJ3;laiCau+N1UgA|b__BlL_IAeXOmr?gKC3b`nf z4DEHI=oKaZK6RyCFmofBMkGMFs_JXl9?e&Jqfrh8OSUeilG<|sZjDKtgx14WSpL@^ Dbd{t| diff --git a/Graphics/pickups/+glasses.bmp b/Graphics/pickups/+glasses.bmp index eda8cdc27584c95824b2430bb6f2eb7ed5782746..25c639c0fd884b1f66b01000d5b4f0c0f6d8a628 100644 GIT binary patch literal 454 zcmZ9Iu}i~16vn?oK#vRx(J6yN7M&dGDjf2#w4orx|3GkYvsN<4(o7$o_sTKle;D~+_daaY4ET6S7 zL==UHqlk);#8eWaz1s%ck!2ZP&Q9=A+~U3{@cI6X$25brmTn`IZU9Tw{mU@<&w-IE zmVy3eB{HD*%VzRg-f(mJMrg>gnsS)YM0c}itEm9TIb<>$<*H8}LkU!GS(Q3)Jkn-} zAZ0bIdEDis;LbVT7fx8IJBw>~I_DcaOS+hC$e!D%_8-oL;g(x{+|h}lAvBy} zT3kHCqRJ|UgYy?KT-m*!;qke14A1Y~V|f4Q8N>J2uNl67|IY9qg#Z6%2vSi2ng9W% z|G$73>`-p~f0zFs7#P^TF))O<1OTlGjcobKz>xm|r15_N+n30lJN`4U{ZC-~|3B>i z2iE^9XJq{k@c+iZ@<01T{#VwoGt-a9{|6eu|LtYyvj6^H?kzv%0<@BW|5r=cYM|k+ z@h)H+_`iLLTm~`|2;6~|^Z)k``SRu4|NmbTz)k^)e{m^*It%C!AP9%^7#QlI>R>_u DT9ACT diff --git a/Graphics/pickups/+health100.bmp b/Graphics/pickups/+health100.bmp index a51f706e22011e7adb5ec407486a5748227ddf53..7eb075c3d7cddb51b8b676ca8792618680288317 100644 GIT binary patch literal 614 zcmZWlze^lJ6n=*7(&SFDH4+fP${R>yGk9~kNJwR53#)K499USyD0{ZS2q|m~%MP&% zEb~}%We%=L6%L0v?jP8_*2Y`YrATpkGlv$*x4g%G@5eXqz0KG15qKPtUnP4=wnR1u z0eOI5a{%n|%$^W;Hl=Uvd;?gw4)xJCtkqkv(TZVrH-%RxT{w9+g6;DWw9*^srg!l1 z`yHgC-!QnL&gs<2{tw~t5Eo$-CrK>$EF!`L9n7H*1dRwa>MSqJ8&@Dgg-RpZ@#Lo~ z5Id1h2$>z<5)T^TaqRS)i7mbo7dt|n5%$E^)qq1FiS?!2r$~$(UYxc2eYv>4^5aiW zba>G2_vG_sR;#p64|+`=d^(l$tX8E!ZROwtz{|I+w&3)ivC3kPgJcUda1y^46;_oz zn0M6Ae<4_v2g{-nDTT&#P>XdA)EOamGHVU$I?W@(IHhHWg-!9$&EKT{c)yr=$6^^o;Fv<3G+|GK{miO%i- literal 294 zcmbV`u?>JQ3we#Wj|C(`2|HVzyW4M(=bJ>Dy)Y_@MhH~C#g3}?Dfgr^!`ulv_j36$GYa8 NeUHx4XCWr%mKV)$HRb>S diff --git a/Graphics/pickups/+health25.bmp b/Graphics/pickups/+health25.bmp index f12fbeed1541856a632226e6da155a14cc6ef8de..62d687ef50ae2a26fbb2859f97d8d0ab7a3aab6c 100644 GIT binary patch literal 514 zcmY*UF-rq682wV*x-_A8c0EK9I+gwcZ3m$^MDg}0nVf`Ti*_j#dN~W?WKRUgmh0fy zp@ZXz6dXG`_9r;jm%A3}3orM+m-l_i9iQfMl;RfqAy@)EkkJlyq5&hS<}(&hTduIE zd`0>5M{3-^)86xfuHP0k`u?Tz#}bJt_>(4UjTKdw=ve&|2V3C4+Tan86)cG2$tSD#0O7B|D zYeIY4m390Lt9aTu5En)J9xkQtO3tAPU+rkuv+wt%RAA0L9m4$Q%yb(nyaSdLG*IGun>c2e6(j`LN$i?V|a%%Ew4r5mgW ziG@C)E?&P;tQpM=^n+isoTh9p2e<2MaR-C=p#h5`VX5A BH1Gfb diff --git a/Graphics/pickups/+health50.bmp b/Graphics/pickups/+health50.bmp index e0ddf16676790a57ed3932342bdecbbb847a9401..d840b01a5a10971aa8ca81d420de23eb7e2f4c1b 100644 GIT binary patch literal 526 zcmY+Bze~eF6vtmmz@bze+_FfrI5%UK5Z{tPBRDwtC%6_tGU|}cB}0!4U0l?$ff8;g zG=m78T%~mEP)Rq3gc{%Fw|9IWpZnaq%R#L3!yXjlj_N7pn4(f7kf{QUB>=r&=7`oJ zIZaJbh-Q>E=(+({h63)H0SffNy>(zRd4T!*3^rdexNZ)dZz0Pzkmnhl`8N&_%}Pl3 z?DhGwT-X6mQomx(lRPZhG8&duT~G4J6dQtZ9#h#U-<;zHFFJJIudZ&y#)K zA0j#xqs`c3`D$c7qV1u0f?s-%J|H6tIDhd(lg!@c>CJC6798x->(Nv3P&vHV?H60$ z7M}m0HAE*Q1{6L*ai_S6yjdWX!J;OB-mqoz)t@Z9c2aE(Vl}QAwD_|*F;E*_yFW?; BfY|^5 literal 250 zcmbV_F%E?=3`0}tZ!8TGci10-)W AfB*mh diff --git a/Graphics/pickups/+jellyammo.bmp b/Graphics/pickups/+jellyammo.bmp index 90fc0fd93e7b9e3fd824a35052ff48a3c322d03b..8b6959964a1d1f5c6608f1ce7cfc479fd70ace5e 100644 GIT binary patch literal 526 zcmYk3F;Bu!5XVo`#DRoZNz}xo#B%>&I5nBWl1KJzUpHb-?cFm)1B>9+!jrO=6OExFb zsn4g9aV+XuV<*c8M!TV>j;lgRFkj8FkRa40(@u24z4}1BgX{SOJI`8CZZM149E)UWgll1%P}I{ttw~CZ-Je-o6Y~@d*r* zlTsOGS5`5s?CE7VIDH1giS-*9?(E#f@aWumh7b22FnoRclHvEq&kX;+e`omr|33o* z|Npypch3MB&%l|YDC9nK)l3kZO~go0*~K-?0mx1hTXpWv{X2Uafb5dm&Bmtd|NlP` z0c0;xRPF5e|MzA(14Hpf;nn|d{J(j#oPnWmqQw9If74F=0J4iFX#?4zZ8w3QN_m|9 z|KI!Ott(4`>>sPjmuCOla|mSqFkhNr~Kcbz}czSX$X0A~R}@@q z9JX5-$X560QC{{e>UR-Pjau#UAgSN7w}I@yRLwuj*Kf7k*UZ4sSf;lB|NmzF_X~mH zZMhB@G=J8=5Cw*V*xC30-`?332nq;8l@!&=m4$+!fZz}eatRFt9>y7ztnu>gp;vXB4( diff --git a/Graphics/pickups/+pants.bmp b/Graphics/pickups/+pants.bmp index 880d6034b576d1b0e825033c4ad3cb9e451ca73a..9e5299b16e0e8e2071770cbbc65ed3ea92cf7b70 100644 GIT binary patch literal 550 zcmYk2u}i~H5XN7{OfJ?{5HTPQPDZdupi(OiMy#ptbx-=5q1|fZ=;S7JaS$Awg+c`j zjs;UG)q^fV|Aa0=2irt!;dw7<#TUNI{l2?at%P|K(ona4=TV~h}W zA<`nUl)$HI+oV~4CjDNQh+u$jos^3`Qoj$#ppOay5}<^@e9*^SkU-!hYI1~?) zV(pNbI!tR_UVP0Rg#%2}0h%L|mmnN4JG%gPK4k!H*OZNak@N-Ys zu|cua2d(xYINky+$!oVYxCv-u##-XjtNP49KEZiv8{+4El~b=3DJ_kMer8qvF*>4)j#J3&Axp=> Y-J=td3|K^`^2gF)?sS7wSD|?QFZ$uUQvd(} literal 582 zcmX|-L14dA#l^=kGqVlL%WbGsw&AUO59{k+U~B6ubUGc_-~SA| z-5+pp@Qu%Zpx-Cx6T#Hfnr^GLw=th@505%_R4funzxaQV4Q#itaB;*FO1Uoj;Zeel zNik29X?B=kB*J7D#R~n_+^%Os88eE45{LYS5h3ci*3U*ID9{st@$i)#7D~UcG>sM) z?A(=N(=7*REs3jK(DI71A?mcCJbXyEz=;dV;wGN!TRpfFN6k0M_E45+GHIh=t|`|; z^l2h#OKeKH(({-xIsPmrBqx~DOajv%mSVP)O=+Id_~`5>n)8cI?9vVW{_=Eo+Xt@m=rB5PjJE0Yrdr}q!MHW=rh+=0bbK#{<%q+2Ku75 z#sk^i2+~fLC|bk^@0bC)PAK2HPNb}V6E*6W)48f+>H!U9R3oWe^)?T1q`j7t%8X#J I8z1k(UuSvwkN^Mx diff --git a/Graphics/pickups/+spatula.bmp b/Graphics/pickups/+spatula.bmp index 590138a5c31c4c7ff1ed68412ccbbe5c0dccc751..aab0b50c62ebbf0cff705f477835f3134646aa66 100644 GIT binary patch literal 630 zcma)3Jxjw-6upX0zQJIpC=bO&=w?SJbu0#dfC%E~qA1N!%;MlrsGAicg$z2z&2$n< z`doy7)Zzst5YpGNW4vizqS-v*gnQmSxgU8udyQF`qCxKs;;P~d%uz(3{L(_kMUp8K zdZ4-sTgNS^Hy>fS>B4#|fRoz*s?Q-@yJP6QPM{Vh@IpKvC*V%#t0W^6aay^6(70C! z3c9tmk^yfvO9rf8l?4W&|NqU_z(qJLch3m1M|g|l=bqhL-Rvj86tMl=wKBXp-Uh+nU0vcC_T>ar zfbGZbh;6|w@y*bXiFy*%91`SS;e0zdQ3282B$JK-BPfcgBO<{9 diff --git a/makefile.gaz b/makefile.gaz index 3bf5e54c1..b462ddffc 100644 --- a/makefile.gaz +++ b/makefile.gaz @@ -157,6 +157,7 @@ player_src := demoplay \ panimsfx \ player \ pmodes \ + pmbloon \ pmfly \ psbutt \ psduck \ diff --git a/source/game/pause.cpp b/source/game/pause.cpp index 411513050..8d28522fb 100644 --- a/source/game/pause.cpp +++ b/source/game/pause.cpp @@ -99,26 +99,25 @@ void CPauseMenu::init() (FRAME_WIDTH-TEXT_BOX_WIDTH)/2,TEXT_SPACING*5,TEXT_BOX_WIDTH,TEXT_BOX_HEIGHT, STR__DEBUG__BASICUNARMED_MODE, &newmode,PLAYER_MODE_BASICUNARMED); -/* + #ifdef __USER_paul__ - CGUIFactory::createValueButtonFrame(m_guiFrame, - (FRAME_WIDTH-TEXT_BOX_WIDTH)/2,TEXT_SPACING*6,TEXT_BOX_WIDTH,TEXT_BOX_HEIGHT, - STR__DEBUG__FULLUNARMED_MODE, - &newmode,PLAYER_MODE_FULLUNARMED); - CGUIFactory::createValueButtonFrame(m_guiFrame, - (FRAME_WIDTH-TEXT_BOX_WIDTH)/2,TEXT_SPACING*7,TEXT_BOX_WIDTH,TEXT_BOX_HEIGHT, - STR__DEBUG__NET_MODE, - &newmode,PLAYER_MODE_NET); +// CGUIFactory::createValueButtonFrame(m_guiFrame, +// (FRAME_WIDTH-TEXT_BOX_WIDTH)/2,TEXT_SPACING*6,TEXT_BOX_WIDTH,TEXT_BOX_HEIGHT, +// STR__DEBUG__FULLUNARMED_MODE, +// &newmode,PLAYER_MODE_FULLUNARMED); +// CGUIFactory::createValueButtonFrame(m_guiFrame, +// (FRAME_WIDTH-TEXT_BOX_WIDTH)/2,TEXT_SPACING*7,TEXT_BOX_WIDTH,TEXT_BOX_HEIGHT, +// STR__DEBUG__NET_MODE, +// &newmode,PLAYER_MODE_NET); CGUIFactory::createValueButtonFrame(m_guiFrame, (FRAME_WIDTH-TEXT_BOX_WIDTH)/2,TEXT_SPACING*8,TEXT_BOX_WIDTH,TEXT_BOX_HEIGHT, STR__DEBUG__BALLOON_MODE, &newmode,PLAYER_MODE_BALLOON); - CGUIFactory::createValueButtonFrame(m_guiFrame, - (FRAME_WIDTH-TEXT_BOX_WIDTH)/2,TEXT_SPACING*9,TEXT_BOX_WIDTH,TEXT_BOX_HEIGHT, - STR__DEBUG__CORALBLOWER_MODE, - &newmode,PLAYER_MODE_CORALBLOWER); +// CGUIFactory::createValueButtonFrame(m_guiFrame, +// (FRAME_WIDTH-TEXT_BOX_WIDTH)/2,TEXT_SPACING*9,TEXT_BOX_WIDTH,TEXT_BOX_HEIGHT, +// STR__DEBUG__CORALBLOWER_MODE, +// &newmode,PLAYER_MODE_CORALBLOWER); #endif -*/ m_active=false; } diff --git a/source/pickups/pballoon.cpp b/source/pickups/pballoon.cpp index df47806ec..9fc12e8bc 100644 --- a/source/pickups/pballoon.cpp +++ b/source/pickups/pballoon.cpp @@ -94,7 +94,7 @@ void CBalloonPickup::init() ---------------------------------------------------------------------- */ void CBalloonPickup::collect(class CPlayer *_player) { -// _player->setMode(PLAYER_MODE_BALLOON); + _player->setMode(PLAYER_MODE_BALLOON); CBaseRespawningPickup::collect(_player); } @@ -105,14 +105,18 @@ void CBalloonPickup::collect(class CPlayer *_player) Returns: ---------------------------------------------------------------------- */ int balloon_height=30; -int balloon_r=180; -int balloon_g=180; -int balloon_b=180; +int balloon_r1=251; +int balloon_g1=207; +int balloon_b1=167; +int balloon_r2=147; +int balloon_g2=95; +int balloon_b2=75; int balloon_speed=25; int balloon_scale1=5; int balloon_scale2=2; int balloon_phase=1024; int balloon_vissize=40; +int balloon_stringx=-3; int CBalloonPickup::getVisibilityRadius() { return balloon_vissize; @@ -163,9 +167,11 @@ void CBalloonPickup::renderPickup(DVECTOR *_pos) sprites->printFT4(fh,x+xo1,y,0,0,PICKUPS_OT_POS); setCollisionCentreOffset(xo1,0); - x=_pos->vx; + x=_pos->vx+balloon_stringx; y=_pos->vy+(fh->H/2); - DrawLine(x+xo1,y,x+xo2,y+balloon_height,balloon_r,balloon_g,balloon_b,PICKUPS_OT_POS); + DrawLine(x+xo1,y,x+xo2,y+balloon_height,balloon_r1,balloon_g1,balloon_b1,PICKUPS_OT_POS); + x++; + DrawLine(x+xo1,y,x+xo2,y+balloon_height,balloon_r2,balloon_g2,balloon_b2,PICKUPS_OT_POS); } /*=========================================================================== diff --git a/source/player/player.cpp b/source/player/player.cpp index 6e48afabb..b71ba2660 100644 --- a/source/player/player.cpp +++ b/source/player/player.cpp @@ -37,6 +37,10 @@ #include "player\pmfly.h" #endif +#ifndef __PLAYER_PMBLOON_H__ +#include "player\pmbloon.h" +#endif + // to be removed #include "gfx\tpage.h" @@ -127,7 +131,7 @@ static const char *s_modeText[NUM_PLAYERMODES]= { "BASICUNARMED", // "FULLUNARMED", -// "BALLOON", + "BALLOON", // "NET", // "CORALBLOWER", "FLY", @@ -158,13 +162,15 @@ int CAMERA_SCROLLSPEED=60; // Speed of the scroll ( 60=1 tile scrolled every -CPlayerModeBasic PLAYERMODE; +CPlayerModeBase PLAYERMODE; +CPlayerModeBalloon PLAYERMODEBALLOON; CPlayerModeFly PLAYERMODEFLY; CPlayerMode *CPlayer::s_playerModes[NUM_PLAYERMODES]= { - &PLAYERMODE, // PLAYER_MODE_BASICUNARMED - &PLAYERMODEFLY, // PLAYER_MODE_FLY + &PLAYERMODE, // PLAYER_MODE_BASICUNARMED + &PLAYERMODEBALLOON, // PLAYER_MODE_BALLOON + &PLAYERMODEFLY, // PLAYER_MODE_FLY }; diff --git a/source/player/player.h b/source/player/player.h index c311a4702..725b0a07e 100644 --- a/source/player/player.h +++ b/source/player/player.h @@ -50,7 +50,7 @@ typedef enum { PLAYER_MODE_BASICUNARMED, // PLAYER_MODE_FULLUNARMED, -// PLAYER_MODE_BALLOON, + PLAYER_MODE_BALLOON, //PLAYER_MODE_BUBBLE_MIXTURE, //PLAYER_MODE_HELMET, // PLAYER_MODE_NET, diff --git a/source/player/pmbloon.cpp b/source/player/pmbloon.cpp index f16a523ae..307f4a357 100644 --- a/source/player/pmbloon.cpp +++ b/source/player/pmbloon.cpp @@ -11,51 +11,11 @@ ===========================================================================*/ -void a(){} -#if 0 - /*---------------------------------------------------------------------- Includes -------- */ -#include "player\pmodes.h" - -#ifndef __PLAYER_PLAYER_H__ -#include "player\player.h" -#endif - -#ifndef __PLAYER_PSTATES_H__ -#include "player\pstates.h" -#endif - -#ifndef __LAYER_COLLISION_H__ -#include "level\layercollision.h" -#endif - -// States -#ifndef __PLAYER__PSJUMP_H__ -#include "player\psjump.h" -#endif - -#ifndef __PLAYER__PSRUN_H__ -#include "player\psrun.h" -#endif - -#ifndef __PLAYER__PSFALL_H__ -#include "player\psfall.h" -#endif - -#ifndef __PLAYER__PSIDLE_H__ -#include "player\psidle.h" -#endif - -#ifndef __PLAYER__PSBUTT_H__ -#include "player\psbutt.h" -#endif - -#ifndef __PLAYER__PSDUCK_H__ -#include "player\psduck.h" -#endif +#include "player\pmbloon.h" /* Std Lib @@ -64,11 +24,6 @@ void a(){} /* Data ---- */ -#ifndef __ANIM_SPONGEBOB_HEADER__ -#include -#endif - - /*---------------------------------------------------------------------- Tyepdefs && Defines ------------------- */ @@ -85,570 +40,31 @@ void a(){} Vars ---- */ -static CPlayerStateUnarmedIdle stateUnarmedIdle; -static CPlayerStateTeeterIdle stateTeeterIdle; -static CPlayerStateJump stateJump; -static CPlayerStateRun stateRun; -static CPlayerStateFall stateFall; -static CPlayerStateFallFar stateFallFar; -static CPlayerStateDuck stateDuck; -static CPlayerStateSoakUp stateSoakUp; -static CPlayerStateGetUp stateGetUp; -static CPlayerStateButtBounce stateButtBounce; -static CPlayerStateButtBounceFall stateButtBounceFall; -static CPlayerStateButtBounceLand stateButtBounceLand; - -/* -static CPlayerStateDead stateDead; -*/ - -CPlayerState *CPlayerModeBasic::s_stateTable[]= -{ - &stateUnarmedIdle, // STATE_IDLE - &stateTeeterIdle, // STATE_IDLETEETER - &stateJump, // STATE_JUMP - &stateRun, // STATE_RUN - &stateFall, // STATE_FALL - &stateFallFar, // STATE_FALLFAR - &stateButtBounce, // STATE_BUTTBOUNCE - &stateButtBounceFall, // STATE_BUTTFALL - &stateButtBounceLand, // STATE_BUTTLAND - &stateDuck, // STATE_DUCK - &stateSoakUp, // STATE_SOAKUP - &stateGetUp, // STATE_GETUP -}; - -PlayerMetrics CPlayerModeBasic::s_playerMetrics= +static PlayerMetrics s_playerMetrics= { { DEFAULT_PLAYER_JUMP_VELOCITY, // PM__JUMP_VELOCITY - DEFAULT_PLAYER_MAX_JUMP_FRAMES, // PM__MAX_JUMP_FRAMES + DEFAULT_PLAYER_MAX_JUMP_FRAMES, // PM__MAX_JUMP_FRAMES DEFAULT_PLAYER_MAX_SAFE_FALL_FRAMES, // PM__MAX_SAFE_FALL_FRAMES DEFAULT_PLAYER_MAX_RUN_VELOCITY, // PM__MAX_RUN_VELOCITY - DEFAULT_PLAYER_RUN_SPEEDUP, // PM__RUN_SPEEDUP - DEFAULT_PLAYER_RUN_REVERSESLOWDOWN, // PM__RUN_REVERSESLOWDOWN + DEFAULT_PLAYER_RUN_SPEEDUP, // PM__RUN_SPEEDUP + DEFAULT_PLAYER_RUN_REVERSESLOWDOWN, // PM__RUN_REVERSESLOWDOWN DEFAULT_PLAYER_RUN_SLOWDOWN, // PM__RUN_SLOWDOWN + DEFAULT_PLAYER_PLAYER_GRAVITY/3, // PM__GRAVITY + DEFAULT_PLAYER_TERMINAL_VELOCITY/3, // PM__TERMINAL_VELOCITY } }; - - - - - - - - - - /*---------------------------------------------------------------------- Function: Purpose: Params: Returns: ---------------------------------------------------------------------- */ -int CPlayerMode::getPadInputHeld() {return m_player->getPadInputHeld();} -int CPlayerMode::getPadInputDown() {return m_player->getPadInputDown();} -DVECTOR CPlayerMode::getPlayerPos() {return m_player->getPlayerPos();} -void CPlayerMode::setPlayerPos(DVECTOR *_pos) {m_player->setPlayerPos(_pos);} - -/*---------------------------------------------------------------------- - Function: - Purpose: - Params: - Returns: - ---------------------------------------------------------------------- */ -void CPlayerModeBasic::enter() -{ - m_fallFrames=0; - setState(STATE_IDLE); - m_moveVelocity.vx=m_moveVelocity.vy=0; -} - -/*---------------------------------------------------------------------- - Function: - Purpose: - Params: - Returns: - ---------------------------------------------------------------------- */ -void CPlayerModeBasic::think() -{ - s_stateTable[m_currentState]->think(this); - thinkVerticalMovement(); - thinkHorizontalMovement(); - - // Teeter if on an edge - if(canTeeter()&&isOnEdge()) - { - setState(STATE_IDLETEETER); - } - -} - -/*---------------------------------------------------------------------- - Function: - Purpose: - Params: - Returns: - ---------------------------------------------------------------------- */ -void CPlayerModeBasic::render() -{ -} - -/*---------------------------------------------------------------------- - Function: - Purpose: - Params: - Returns: - ---------------------------------------------------------------------- */ -void CPlayerModeBasic::thinkVerticalMovement() -{ - CLayerCollision *collision; - DVECTOR pos; - int colHeight; - - collision=m_player->getLayerCollision(); - pos=m_player->getPlayerPos(); - - colHeight=collision->getHeightFromGround(pos.vx,pos.vy,1); - -//New collision stuff (pkg) -//if(m_layerCollision->getCollisionType(Pos.vx,Pos.vy+(m_moveVelocity.vy>>VELOCITY_SHIFT))&COLLISION_TYPE_MASK) -//{ -// m_moveVelocity.vy=0; -// return; -//} - if(colHeight>=0) - { - // Above or on the ground - // Are we falling? - if(m_moveVelocity.vy>0) - { - // Yes.. Check to see if we're about to hit/go through the ground - colHeight=collision->getHeightFromGround(pos.vx,pos.vy+(m_moveVelocity.vy>>VELOCITY_SHIFT),PLAYER_TERMINAL_VELOCITY+1); - - if(colHeight<=0) - { - // Just hit the ground - // Stick at ground level - pos.vy+=(m_moveVelocity.vy>>VELOCITY_SHIFT)+colHeight; - m_moveVelocity.vy=0; - m_fallFrames=0; - if(m_currentState==STATE_BUTTFALL) - { - // Landed from a butt bounce - setState(STATE_BUTTLAND); - } - else if(m_currentState==STATE_FALLFAR) - { - // Landed from a painfully long fall - setState(STATE_IDLE); - m_player->takeDamage(DAMAGE__FALL); - m_moveVelocity.vx=0; - CSoundMediator::playSfx(CSoundMediator::SFX_SPONGEBOB_LAND_AFTER_FALL); - } - else if(m_moveVelocity.vx) - { - // Landed from a jump with x movement - setState(STATE_RUN); - } - else - { - // Landed from a jump with no x movement - setState(STATE_IDLE); - setAnimNo(ANIM_SPONGEBOB_JUMPEND); - } - } - } - else if(colHeight) - { - if(m_currentState!=STATE_FALL&&m_currentState!=STATE_FALLFAR&& - m_currentState!=STATE_BUTTFALL&&m_currentState!=STATE_BUTTBOUNCE&& - m_currentState!=STATE_JUMP) - { - // Was floating in the air.. fall! - -// if ( !m_onPlatform ) -// { - setState(STATE_FALL); -// } - } - } - } - else - { -/* - // Below ground - // Perhaps we should be falling? - if(m_currentState!=STATE_FALL&&m_currentState!=STATE_FALLFAR&& - m_currentState!=STATE_BUTTFALL&&m_currentState!=STATE_BUTTBOUNCE&& - m_currentState!=STATE_JUMP) - { - setState(STATE_FALL); - } -*/ - } - - pos.vy+=m_moveVelocity.vy>>VELOCITY_SHIFT; - m_player->setPlayerPos(&pos); -} - -/*---------------------------------------------------------------------- - Function: - Purpose: - Params: - Returns: - ---------------------------------------------------------------------- */ -void CPlayerModeBasic::thinkHorizontalMovement() -{ - if(m_moveVelocity.vx) - { - CLayerCollision *collision; - DVECTOR pos; - - collision=m_player->getLayerCollision(); - pos=m_player->getPlayerPos(); -//New collision stuff (pkg) -//if(m_layerCollision->getCollisionType(Pos.vx+(m_moveVelocity.vx>>VELOCITY_SHIFT),Pos.vy)&COLLISION_TYPE_MASK) -//{ -// m_moveVelocity.vx=0; -// return; -//} - int colHeight; - colHeight=collision->getHeightFromGround(pos.vx,pos.vy,5); - if(colHeight==0) - { - // Ok.. we're on the ground. What happens if we move left/right - colHeight=collision->getHeightFromGround(pos.vx+(m_moveVelocity.vx>>VELOCITY_SHIFT),pos.vy); - if(colHeight<-8) - { - // Big step up. Stop at the edge of the obstruction - int dir,vx,cx,i; - if(m_moveVelocity.vx<0) - { - dir=-1; - vx=-m_moveVelocity.vx>>VELOCITY_SHIFT; - } - else - { - dir=+1; - vx=m_moveVelocity.vx>>VELOCITY_SHIFT; - } - cx=pos.vx; - for(i=0;igetHeightFromGround(cx,pos.vy)<-8) - { - break; - } - cx+=dir; - } - pos.vx=cx-dir; - - // If running then go to idle, otherwise leave in same state - if(m_currentState==STATE_RUN) - { - setState(STATE_IDLE); - } - m_moveVelocity.vx=0; - - // Get the height at this new position and then try the step-up code below. - // Without this, there are problems when you run up a slope and hit a wall at the same time - colHeight=collision->getHeightFromGround(pos.vx,pos.vy); - } - if(colHeight&&colHeight>=-8&&colHeight<=8) - { - // Small step up/down. Follow the contour of the level - pos.vy+=colHeight; - } - } - else - { - // In the air -// if(!(colHeight<0&&m_currentState==STATE_JUMP)) // Lets you jump through platforms from below - if(colHeight>=0) // Lets you jump through platforms from below - { - colHeight=collision->getHeightFromGround(pos.vx+(m_moveVelocity.vx>>VELOCITY_SHIFT),pos.vy,5); - if(colHeight<0) - { - // Stop at the edge of the obstruction - int dir,vx,cx,i; - if(m_moveVelocity.vx<0) - { - dir=-1; - vx=-m_moveVelocity.vx>>VELOCITY_SHIFT; - } - else - { - dir=+1; - vx=m_moveVelocity.vx>>VELOCITY_SHIFT; - } - cx=pos.vx; - for(i=0;igetHeightFromGround(cx,pos.vy)<0) - { - break; - } - cx+=dir; - } - pos.vx=cx-dir; - m_moveVelocity.vx=0; - } - } - } - pos.vx+=m_moveVelocity.vx>>VELOCITY_SHIFT; - m_player->setPlayerPos(&pos); - } -} - -/*---------------------------------------------------------------------- - Function: - Purpose: - Params: - Returns: - ---------------------------------------------------------------------- */ -const struct PlayerMetrics *CPlayerModeBasic::getPlayerMetrics() +const struct PlayerMetrics *CPlayerModeBalloon::getPlayerMetrics() { return &s_playerMetrics; } -/*---------------------------------------------------------------------- - Function: - Purpose: - Params: - Returns: - ---------------------------------------------------------------------- */ -int CPlayerModeBasic::setState(int _state) -{ - CPlayerState *nextState; - int ret=false; - - nextState=s_stateTable[_state]; - if(nextState) - { - m_currentStateClass=nextState; - m_currentStateClass->enter(this); - m_currentState=(PLAYER_STATE)_state; - ret=true; - } - return ret; -} - -/*---------------------------------------------------------------------- - Function: - Purpose: - Params: - Returns: - ---------------------------------------------------------------------- */ -int CPlayerModeBasic::getFacing() {return m_player->getFacing();} -void CPlayerModeBasic::setFacing(int _facing) {m_player->setFacing(_facing);} -void CPlayerModeBasic::setAnimNo(int _animNo) {m_player->setAnimNo(_animNo);} -void CPlayerModeBasic::setAnimFrame(int _animFrame) {m_player->setAnimFrame(_animFrame);} - -/*---------------------------------------------------------------------- - Function: - Purpose: - Params: - Returns: - ---------------------------------------------------------------------- */ -int CPlayerModeBasic::advanceAnimFrameAndCheckForEndOfAnim() -{ - int animFrame,frameCount; - int looped; - animFrame=m_player->getAnimFrame()+1; - frameCount=m_player->getAnimFrameCount(); - looped=false; - if(animFrame>=frameCount) - { - looped=true; - animFrame=0; - } - m_player->setAnimFrame(animFrame); - return looped; - -} - -/*---------------------------------------------------------------------- - Function: - Purpose: - Params: - Returns: - ---------------------------------------------------------------------- */ -DVECTOR CPlayerModeBasic::getMoveVelocity() {return m_moveVelocity;} -void CPlayerModeBasic::zeroMoveVelocity() {m_moveVelocity.vx=m_moveVelocity.vy=0;} -void CPlayerModeBasic::setMoveVelocity(DVECTOR *_moveVel) {m_moveVelocity=*_moveVel;} - -/*---------------------------------------------------------------------- - Function: - Purpose: - Params: - Returns: FACING_LEFT if left half of player is hanging, FACING_RIGHT - if right half of player is hanging or 0 if no part of the - player is hanging - ---------------------------------------------------------------------- */ -int csize=5; -int cheight=15; -int CPlayerModeBasic::isOnEdge() -{ - CLayerCollision *collision; - DVECTOR pos; - int ret; - - collision=m_player->getLayerCollision(); - pos=m_player->getPlayerPos(); - ret=0; - if(collision->getHeightFromGround(pos.vx-csize,pos.vy,cheight+1)>cheight) - { - ret=FACING_LEFT; - } - else if(collision->getHeightFromGround(pos.vx+csize,pos.vy,cheight+1)>cheight) - { - ret=FACING_RIGHT; - } - return ret; -} - -/*---------------------------------------------------------------------- - Function: - Purpose: - Params: - Returns: - ---------------------------------------------------------------------- */ -int CPlayerModeBasic::canMoveLeft() -{ - DVECTOR pos; - pos=m_player->getPlayerPos(); - return m_player->getLayerCollision()->getHeightFromGround(pos.vx-1,pos.vy,16)>-8?true:false; -} - -int CPlayerModeBasic::canMoveRight() -{ - DVECTOR pos; - pos=m_player->getPlayerPos(); - return m_player->getLayerCollision()->getHeightFromGround(pos.vx+1,pos.vy,16)>-8?true:false; -} - -/*---------------------------------------------------------------------- - Function: - Purpose: - Params: - Returns: - ---------------------------------------------------------------------- */ -void CPlayerModeBasic::moveLeft() -{ - const PlayerMetrics *metrics; - metrics=getPlayerMetrics(); - - setFacing(FACING_LEFT); - if(m_moveVelocity.vx<=0) - { - m_moveVelocity.vx-=metrics->m_metric[PM__RUN_SPEEDUP]; - if(m_moveVelocity.vx<-metrics->m_metric[PM__MAX_RUN_VELOCITY]<m_metric[PM__MAX_RUN_VELOCITY]<m_metric[PM__RUN_REVERSESLOWDOWN]; - } - - /* - if(m_moveVelocity.vx<-CAMERA_STARTMOVETHRESHOLD||m_cameraScrollPos.vx<-CAMERA_SCROLLTHRESHOLD<<8) - { - m_cameraScrollDir=+1; - } - else if(m_moveVelocity.vx>-CAMERA_STOPMOVETHRESHOLD) - { - m_cameraScrollDir=0; - } - */ -} - -void CPlayerModeBasic::moveRight() -{ - const PlayerMetrics *metrics; - metrics=getPlayerMetrics(); - - setFacing(FACING_RIGHT); - if(m_moveVelocity.vx>=0) - { - m_moveVelocity.vx+=metrics->m_metric[PM__RUN_SPEEDUP]; - if(m_moveVelocity.vx>metrics->m_metric[PM__MAX_RUN_VELOCITY]<m_metric[PM__MAX_RUN_VELOCITY]<m_metric[PM__RUN_REVERSESLOWDOWN]; - } - - /* - if(m_moveVelocity.vx>CAMERA_STARTMOVETHRESHOLD||m_cameraScrollPos.vx>CAMERA_SCROLLTHRESHOLD<<8) - { - m_cameraScrollDir=-1; - } - else if(m_moveVelocity.vxm_metric[PM__RUN_SLOWDOWN]; - if(m_moveVelocity.vx>=0) - { - m_moveVelocity.vx=0; - ret=true; - } - } - else if(m_moveVelocity.vx>0) - { - m_moveVelocity.vx-=metrics->m_metric[PM__RUN_SLOWDOWN]; - if(m_moveVelocity.vx<=0) - { - m_moveVelocity.vx=0; - ret=true; - } - } - return ret; -} -void CPlayerModeBasic::jump() -{ - const PlayerMetrics *metrics; - metrics=getPlayerMetrics(); - m_moveVelocity.vy=-metrics->m_metric[PM__JUMP_VELOCITY]<=PLAYER_TERMINAL_VELOCITY<metrics->m_metric[PM__MAX_SAFE_FALL_FRAMES]) - { - setState(STATE_FALLFAR); - } - } - } -} - - /*=========================================================================== end */ - -#endif \ No newline at end of file diff --git a/source/player/pmbloon.h b/source/player/pmbloon.h index c54f240e6..26b269ba5 100644 --- a/source/player/pmbloon.h +++ b/source/player/pmbloon.h @@ -34,8 +34,11 @@ Structure defintions -------------------- */ -class CPlayerModeBalloon : public CPlayerModeBasic +class CPlayerModeBalloon : public CPlayerModeBase { +public: + virtual int canFallForever() {return true;} + virtual const struct PlayerMetrics *getPlayerMetrics(); }; diff --git a/source/player/pmfly.h b/source/player/pmfly.h index b6770cb1a..bda302299 100644 --- a/source/player/pmfly.h +++ b/source/player/pmfly.h @@ -34,7 +34,7 @@ Structure defintions -------------------- */ -class CPlayerModeFly : public CPlayerModeBasic +class CPlayerModeFly : public CPlayerModeBase { public: virtual void enter(); diff --git a/source/player/pmodes.cpp b/source/player/pmodes.cpp index 2e78013a6..67af86801 100644 --- a/source/player/pmodes.cpp +++ b/source/player/pmodes.cpp @@ -99,7 +99,7 @@ static CPlayerStateButtBounceLand stateButtBounceLand; static CPlayerStateDead stateDead; */ -CPlayerState *CPlayerModeBasic::s_stateTable[]= +CPlayerState *CPlayerModeBase::s_stateTable[]= { &stateUnarmedIdle, // STATE_IDLE &stateTeeterIdle, // STATE_IDLETEETER @@ -115,15 +115,17 @@ CPlayerState *CPlayerModeBasic::s_stateTable[]= &stateGetUp, // STATE_GETUP }; -PlayerMetrics CPlayerModeBasic::s_playerMetrics= +static PlayerMetrics s_playerMetrics= { { DEFAULT_PLAYER_JUMP_VELOCITY, // PM__JUMP_VELOCITY - DEFAULT_PLAYER_MAX_JUMP_FRAMES, // PM__MAX_JUMP_FRAMES + DEFAULT_PLAYER_MAX_JUMP_FRAMES, // PM__MAX_JUMP_FRAMES DEFAULT_PLAYER_MAX_SAFE_FALL_FRAMES, // PM__MAX_SAFE_FALL_FRAMES DEFAULT_PLAYER_MAX_RUN_VELOCITY, // PM__MAX_RUN_VELOCITY - DEFAULT_PLAYER_RUN_SPEEDUP, // PM__RUN_SPEEDUP - DEFAULT_PLAYER_RUN_REVERSESLOWDOWN, // PM__RUN_REVERSESLOWDOWN + DEFAULT_PLAYER_RUN_SPEEDUP, // PM__RUN_SPEEDUP + DEFAULT_PLAYER_RUN_REVERSESLOWDOWN, // PM__RUN_REVERSESLOWDOWN DEFAULT_PLAYER_RUN_SLOWDOWN, // PM__RUN_SLOWDOWN + DEFAULT_PLAYER_PLAYER_GRAVITY, // PM__GRAVITY + DEFAULT_PLAYER_TERMINAL_VELOCITY, // PM__TERMINAL_VELOCITY } }; @@ -145,8 +147,8 @@ PlayerMetrics CPlayerModeBasic::s_playerMetrics= ---------------------------------------------------------------------- */ int CPlayerMode::getPadInputHeld() {return m_player->getPadInputHeld();} int CPlayerMode::getPadInputDown() {return m_player->getPadInputDown();} -DVECTOR CPlayerMode::getPlayerPos() {return m_player->getPlayerPos();} -void CPlayerMode::setPlayerPos(DVECTOR *_pos) {m_player->setPlayerPos(_pos);} +DVECTOR CPlayerMode::getPlayerPos() {return m_player->getPlayerPos();} +void CPlayerMode::setPlayerPos(DVECTOR *_pos) {m_player->setPlayerPos(_pos);} /*---------------------------------------------------------------------- Function: @@ -154,7 +156,7 @@ void CPlayerMode::setPlayerPos(DVECTOR *_pos) {m_player->setPlayerPos(_pos);} Params: Returns: ---------------------------------------------------------------------- */ -void CPlayerModeBasic::enter() +void CPlayerModeBase::enter() { m_fallFrames=0; setState(STATE_IDLE); @@ -167,7 +169,7 @@ void CPlayerModeBasic::enter() Params: Returns: ---------------------------------------------------------------------- */ -void CPlayerModeBasic::think() +void CPlayerModeBase::think() { s_stateTable[m_currentState]->think(this); thinkVerticalMovement(); @@ -187,7 +189,7 @@ void CPlayerModeBasic::think() Params: Returns: ---------------------------------------------------------------------- */ -void CPlayerModeBasic::render() +void CPlayerModeBase::render() { } @@ -197,7 +199,7 @@ void CPlayerModeBasic::render() Params: Returns: ---------------------------------------------------------------------- */ -void CPlayerModeBasic::thinkVerticalMovement() +void CPlayerModeBase::thinkVerticalMovement() { CLayerCollision *collision; DVECTOR pos; @@ -221,7 +223,7 @@ void CPlayerModeBasic::thinkVerticalMovement() if(m_moveVelocity.vy>0) { // Yes.. Check to see if we're about to hit/go through the ground - colHeight=collision->getHeightFromGround(pos.vx,pos.vy+(m_moveVelocity.vy>>VELOCITY_SHIFT),PLAYER_TERMINAL_VELOCITY+1); + colHeight=collision->getHeightFromGround(pos.vx,pos.vy+(m_moveVelocity.vy>>VELOCITY_SHIFT),getPlayerMetrics()->m_metric[PM__TERMINAL_VELOCITY]+1); if(colHeight<=0) { @@ -295,7 +297,7 @@ void CPlayerModeBasic::thinkVerticalMovement() Params: Returns: ---------------------------------------------------------------------- */ -void CPlayerModeBasic::thinkHorizontalMovement() +void CPlayerModeBase::thinkHorizontalMovement() { if(m_moveVelocity.vx) { @@ -404,7 +406,7 @@ void CPlayerModeBasic::thinkHorizontalMovement() Params: Returns: ---------------------------------------------------------------------- */ -const struct PlayerMetrics *CPlayerModeBasic::getPlayerMetrics() +const struct PlayerMetrics *CPlayerModeBase::getPlayerMetrics() { return &s_playerMetrics; } @@ -415,7 +417,7 @@ const struct PlayerMetrics *CPlayerModeBasic::getPlayerMetrics() Params: Returns: ---------------------------------------------------------------------- */ -int CPlayerModeBasic::setState(int _state) +int CPlayerModeBase::setState(int _state) { CPlayerState *nextState; int ret=false; @@ -437,10 +439,10 @@ int CPlayerModeBasic::setState(int _state) Params: Returns: ---------------------------------------------------------------------- */ -int CPlayerModeBasic::getFacing() {return m_player->getFacing();} -void CPlayerModeBasic::setFacing(int _facing) {m_player->setFacing(_facing);} -void CPlayerModeBasic::setAnimNo(int _animNo) {m_player->setAnimNo(_animNo);} -void CPlayerModeBasic::setAnimFrame(int _animFrame) {m_player->setAnimFrame(_animFrame);} +int CPlayerModeBase::getFacing() {return m_player->getFacing();} +void CPlayerModeBase::setFacing(int _facing) {m_player->setFacing(_facing);} +void CPlayerModeBase::setAnimNo(int _animNo) {m_player->setAnimNo(_animNo);} +void CPlayerModeBase::setAnimFrame(int _animFrame) {m_player->setAnimFrame(_animFrame);} /*---------------------------------------------------------------------- Function: @@ -448,7 +450,7 @@ void CPlayerModeBasic::setAnimFrame(int _animFrame) {m_player->setAnimFrame(_ Params: Returns: ---------------------------------------------------------------------- */ -int CPlayerModeBasic::advanceAnimFrameAndCheckForEndOfAnim() +int CPlayerModeBase::advanceAnimFrameAndCheckForEndOfAnim() { int animFrame,frameCount; int looped; @@ -471,9 +473,9 @@ int CPlayerModeBasic::advanceAnimFrameAndCheckForEndOfAnim() Params: Returns: ---------------------------------------------------------------------- */ -DVECTOR CPlayerModeBasic::getMoveVelocity() {return m_moveVelocity;} -void CPlayerModeBasic::zeroMoveVelocity() {m_moveVelocity.vx=m_moveVelocity.vy=0;} -void CPlayerModeBasic::setMoveVelocity(DVECTOR *_moveVel) {m_moveVelocity=*_moveVel;} +DVECTOR CPlayerModeBase::getMoveVelocity() {return m_moveVelocity;} +void CPlayerModeBase::zeroMoveVelocity() {m_moveVelocity.vx=m_moveVelocity.vy=0;} +void CPlayerModeBase::setMoveVelocity(DVECTOR *_moveVel) {m_moveVelocity=*_moveVel;} /*---------------------------------------------------------------------- Function: @@ -485,7 +487,7 @@ void CPlayerModeBasic::setMoveVelocity(DVECTOR *_moveVel) {m_moveVelocity=*_mo ---------------------------------------------------------------------- */ int csize=5; int cheight=15; -int CPlayerModeBasic::isOnEdge() +int CPlayerModeBase::isOnEdge() { CLayerCollision *collision; DVECTOR pos; @@ -511,14 +513,14 @@ int CPlayerModeBasic::isOnEdge() Params: Returns: ---------------------------------------------------------------------- */ -int CPlayerModeBasic::canMoveLeft() +int CPlayerModeBase::canMoveLeft() { DVECTOR pos; pos=m_player->getPlayerPos(); return m_player->getLayerCollision()->getHeightFromGround(pos.vx-1,pos.vy,16)>-8?true:false; } -int CPlayerModeBasic::canMoveRight() +int CPlayerModeBase::canMoveRight() { DVECTOR pos; pos=m_player->getPlayerPos(); @@ -531,7 +533,7 @@ int CPlayerModeBasic::canMoveRight() Params: Returns: ---------------------------------------------------------------------- */ -void CPlayerModeBasic::moveLeft() +void CPlayerModeBase::moveLeft() { const PlayerMetrics *metrics; metrics=getPlayerMetrics(); @@ -562,7 +564,7 @@ void CPlayerModeBasic::moveLeft() */ } -void CPlayerModeBasic::moveRight() +void CPlayerModeBase::moveRight() { const PlayerMetrics *metrics; metrics=getPlayerMetrics(); @@ -592,7 +594,7 @@ void CPlayerModeBasic::moveRight() } */ } -int CPlayerModeBasic::slowdown() +int CPlayerModeBase::slowdown() { const PlayerMetrics *metrics; int ret=false; @@ -618,18 +620,20 @@ int CPlayerModeBasic::slowdown() } return ret; } -void CPlayerModeBasic::jump() +void CPlayerModeBase::jump() +{ + m_moveVelocity.vy=-getPlayerMetrics()->m_metric[PM__JUMP_VELOCITY]<m_metric[PM__JUMP_VELOCITY]<=PLAYER_TERMINAL_VELOCITY<m_metric[PM__GRAVITY]; + if(m_moveVelocity.vy>=metrics->m_metric[PM__TERMINAL_VELOCITY]<m_metric[PM__TERMINAL_VELOCITY]<zeroMoveVelocity(); _playerMode->setAnimNo(ANIM_SPONGEBOB_BUTTBOUNCESTART); @@ -78,7 +78,7 @@ void CPlayerStateButtBounce::enter(CPlayerModeBasic *_playerMode) Params: Returns: ---------------------------------------------------------------------- */ -void CPlayerStateButtBounce::think(CPlayerModeBasic *_playerMode) +void CPlayerStateButtBounce::think(CPlayerModeBase *_playerMode) { if(_playerMode->advanceAnimFrameAndCheckForEndOfAnim()) { @@ -93,7 +93,7 @@ void CPlayerStateButtBounce::think(CPlayerModeBasic *_playerMode) Params: Returns: ---------------------------------------------------------------------- */ -void CPlayerStateButtBounceFall::enter(CPlayerModeBasic *_playerMode) +void CPlayerStateButtBounceFall::enter(CPlayerModeBase *_playerMode) { _playerMode->setAnimNo(ANIM_SPONGEBOB_BUTTBOUNCEEND); } @@ -105,7 +105,7 @@ void CPlayerStateButtBounceFall::enter(CPlayerModeBasic *_playerMode) Params: Returns: ---------------------------------------------------------------------- */ -void CPlayerStateButtBounceFall::think(CPlayerModeBasic *_playerMode) +void CPlayerStateButtBounceFall::think(CPlayerModeBase *_playerMode) { _playerMode->fall(); } @@ -117,7 +117,7 @@ void CPlayerStateButtBounceFall::think(CPlayerModeBasic *_playerMode) Params: Returns: ---------------------------------------------------------------------- */ -void CPlayerStateButtBounceLand::enter(CPlayerModeBasic *_playerMode) +void CPlayerStateButtBounceLand::enter(CPlayerModeBase *_playerMode) { // DVECTOR pos; // @@ -132,7 +132,7 @@ void CPlayerStateButtBounceLand::enter(CPlayerModeBasic *_playerMode) Params: Returns: ---------------------------------------------------------------------- */ -void CPlayerStateButtBounceLand::think(CPlayerModeBasic *_playerMode) +void CPlayerStateButtBounceLand::think(CPlayerModeBase *_playerMode) { if(_playerMode->advanceAnimFrameAndCheckForEndOfAnim()) { diff --git a/source/player/psbutt.h b/source/player/psbutt.h index 3d1beca5a..d3abab5cf 100644 --- a/source/player/psbutt.h +++ b/source/player/psbutt.h @@ -35,24 +35,24 @@ class CPlayerStateButtBounce : public CPlayerState { public: - virtual void enter(class CPlayerModeBasic *_playerMode); - virtual void think(class CPlayerModeBasic *_playerMode); + virtual void enter(class CPlayerModeBase *_playerMode); + virtual void think(class CPlayerModeBase *_playerMode); }; class CPlayerStateButtBounceFall : public CPlayerState { public: - virtual void enter(class CPlayerModeBasic *_playerMode); - virtual void think(class CPlayerModeBasic *_playerMode); + virtual void enter(class CPlayerModeBase *_playerMode); + virtual void think(class CPlayerModeBase *_playerMode); }; class CPlayerStateButtBounceLand : public CPlayerState { public: - virtual void enter(class CPlayerModeBasic *_playerMode); - virtual void think(class CPlayerModeBasic *_playerMode); + virtual void enter(class CPlayerModeBase *_playerMode); + virtual void think(class CPlayerModeBase *_playerMode); private: diff --git a/source/player/psduck.cpp b/source/player/psduck.cpp index 1f5a00364..78e493436 100644 --- a/source/player/psduck.cpp +++ b/source/player/psduck.cpp @@ -61,7 +61,7 @@ Params: Returns: ---------------------------------------------------------------------- */ -void CPlayerStateDuck::enter(CPlayerModeBasic *_playerMode) +void CPlayerStateDuck::enter(CPlayerModeBase *_playerMode) { _playerMode->setAnimNo(ANIM_SPONGEBOB_SOAKUP); } @@ -73,7 +73,7 @@ void CPlayerStateDuck::enter(CPlayerModeBasic *_playerMode) Params: Returns: ---------------------------------------------------------------------- */ -void CPlayerStateDuck::think(CPlayerModeBasic *_playerMode) +void CPlayerStateDuck::think(CPlayerModeBase *_playerMode) { _playerMode->slowdown(); if(_playerMode->advanceAnimFrameAndCheckForEndOfAnim()) @@ -89,7 +89,7 @@ void CPlayerStateDuck::think(CPlayerModeBasic *_playerMode) Params: Returns: ---------------------------------------------------------------------- */ -void CPlayerStateSoakUp::enter(CPlayerModeBasic *_playerMode) +void CPlayerStateSoakUp::enter(CPlayerModeBase *_playerMode) { _playerMode->zeroMoveVelocity(); _playerMode->setAnimNo(ANIM_SPONGEBOB_GETUP); @@ -102,7 +102,7 @@ void CPlayerStateSoakUp::enter(CPlayerModeBasic *_playerMode) Params: Returns: ---------------------------------------------------------------------- */ -void CPlayerStateSoakUp::think(CPlayerModeBasic *_playerMode) +void CPlayerStateSoakUp::think(CPlayerModeBase *_playerMode) { int controlHeld; @@ -120,7 +120,7 @@ void CPlayerStateSoakUp::think(CPlayerModeBasic *_playerMode) Params: Returns: ---------------------------------------------------------------------- */ -void CPlayerStateGetUp::enter(CPlayerModeBasic *_playerMode) +void CPlayerStateGetUp::enter(CPlayerModeBase *_playerMode) { _playerMode->setAnimNo(ANIM_SPONGEBOB_GETUP); } @@ -132,7 +132,7 @@ void CPlayerStateGetUp::enter(CPlayerModeBasic *_playerMode) Params: Returns: ---------------------------------------------------------------------- */ -void CPlayerStateGetUp::think(CPlayerModeBasic *_playerMode) +void CPlayerStateGetUp::think(CPlayerModeBase *_playerMode) { if(_playerMode->advanceAnimFrameAndCheckForEndOfAnim()) { diff --git a/source/player/psduck.h b/source/player/psduck.h index c6813c272..d91d073a7 100644 --- a/source/player/psduck.h +++ b/source/player/psduck.h @@ -35,8 +35,8 @@ class CPlayerStateDuck : public CPlayerState { public: - void enter(class CPlayerModeBasic *_playerMode); - void think(class CPlayerModeBasic *_playerMode); + void enter(class CPlayerModeBase *_playerMode); + void think(class CPlayerModeBase *_playerMode); }; @@ -44,8 +44,8 @@ public: class CPlayerStateSoakUp : public CPlayerState { public: - void enter(class CPlayerModeBasic *_playerMode); - void think(class CPlayerModeBasic *_playerMode); + void enter(class CPlayerModeBase *_playerMode); + void think(class CPlayerModeBase *_playerMode); }; @@ -53,8 +53,8 @@ public: class CPlayerStateGetUp : public CPlayerState { public: - void enter(class CPlayerModeBasic *_playerMode); - void think(class CPlayerModeBasic *_playerMode); + void enter(class CPlayerModeBase *_playerMode); + void think(class CPlayerModeBase *_playerMode); }; diff --git a/source/player/psfall.cpp b/source/player/psfall.cpp index 41028c5ae..61359ab50 100644 --- a/source/player/psfall.cpp +++ b/source/player/psfall.cpp @@ -60,7 +60,7 @@ Params: Returns: ---------------------------------------------------------------------- */ -void CPlayerStateFall::enter(CPlayerModeBasic *_playerMode) +void CPlayerStateFall::enter(CPlayerModeBase *_playerMode) { _playerMode->setAnimNo(ANIM_SPONGEBOB_HOVER); } @@ -72,7 +72,7 @@ void CPlayerStateFall::enter(CPlayerModeBasic *_playerMode) Params: Returns: ---------------------------------------------------------------------- */ -void CPlayerStateFall::think(CPlayerModeBasic *_playerMode) +void CPlayerStateFall::think(CPlayerModeBase *_playerMode) { const PlayerMetrics *metrics; int controlHeld,controlDown; @@ -109,7 +109,7 @@ void CPlayerStateFall::think(CPlayerModeBasic *_playerMode) Params: Returns: ---------------------------------------------------------------------- */ -void CPlayerStateFallFar::enter(CPlayerModeBasic *_playerMode) +void CPlayerStateFallFar::enter(CPlayerModeBase *_playerMode) { _playerMode->setAnimNo(ANIM_SPONGEBOB_FALL); } @@ -121,7 +121,7 @@ void CPlayerStateFallFar::enter(CPlayerModeBasic *_playerMode) Params: Returns: ---------------------------------------------------------------------- */ -void CPlayerStateFallFar::think(CPlayerModeBasic *_playerMode) +void CPlayerStateFallFar::think(CPlayerModeBase *_playerMode) { int controlHeld; DVECTOR move; diff --git a/source/player/psfall.h b/source/player/psfall.h index 281106711..392043949 100644 --- a/source/player/psfall.h +++ b/source/player/psfall.h @@ -35,8 +35,8 @@ class CPlayerStateFall : public CPlayerState { public: - void enter(class CPlayerModeBasic *_playerMode); - void think(class CPlayerModeBasic *_playerMode); + void enter(class CPlayerModeBase *_playerMode); + void think(class CPlayerModeBase *_playerMode); }; @@ -44,8 +44,8 @@ public: class CPlayerStateFallFar : public CPlayerStateFall { private: - void enter(class CPlayerModeBasic *_playerMode); - void think(class CPlayerModeBasic *_playerMode); + void enter(class CPlayerModeBase *_playerMode); + void think(class CPlayerModeBase *_playerMode); }; diff --git a/source/player/psidle.cpp b/source/player/psidle.cpp index 369a00058..cb3f8744d 100644 --- a/source/player/psidle.cpp +++ b/source/player/psidle.cpp @@ -61,7 +61,7 @@ Params: Returns: ---------------------------------------------------------------------- */ -void CPlayerStateBaseIdle::thinkControl(CPlayerModeBasic *_playerMode) +void CPlayerStateBaseIdle::thinkControl(CPlayerModeBase *_playerMode) { int controlDown,controlHeld; controlDown=_playerMode->getPadInputDown(); @@ -98,7 +98,7 @@ void CPlayerStateBaseIdle::thinkControl(CPlayerModeBasic *_playerMode) Params: Returns: ---------------------------------------------------------------------- */ -void CPlayerStateTeeterIdle::enter(CPlayerModeBasic *_playerMode) +void CPlayerStateTeeterIdle::enter(CPlayerModeBase *_playerMode) { int edgeType,dir; int anim; @@ -124,7 +124,7 @@ void CPlayerStateTeeterIdle::enter(CPlayerModeBasic *_playerMode) Params: Returns: ---------------------------------------------------------------------- */ -void CPlayerStateTeeterIdle::think(CPlayerModeBasic *_playerMode) +void CPlayerStateTeeterIdle::think(CPlayerModeBase *_playerMode) { _playerMode->advanceAnimFrameAndCheckForEndOfAnim(); thinkControl(_playerMode); @@ -137,7 +137,7 @@ void CPlayerStateTeeterIdle::think(CPlayerModeBasic *_playerMode) Params: Returns: ---------------------------------------------------------------------- */ -void CPlayerStateIdle::enter(CPlayerModeBasic *_playerMode) +void CPlayerStateIdle::enter(CPlayerModeBase *_playerMode) { m_idleTime=0; m_currentIdleAnim=0; @@ -153,7 +153,7 @@ void CPlayerStateIdle::enter(CPlayerModeBasic *_playerMode) Params: Returns: ---------------------------------------------------------------------- */ -void CPlayerStateIdle::think(CPlayerModeBasic *_playerMode) +void CPlayerStateIdle::think(CPlayerModeBase *_playerMode) { if(_playerMode->advanceAnimFrameAndCheckForEndOfAnim()) { @@ -169,7 +169,7 @@ void CPlayerStateIdle::think(CPlayerModeBasic *_playerMode) Params: Returns: ---------------------------------------------------------------------- */ -void CPlayerStateIdle::setNextIdleAnim(CPlayerModeBasic *_playerMode) +void CPlayerStateIdle::setNextIdleAnim(CPlayerModeBase *_playerMode) { IdleAnims *anims; int finished=false; diff --git a/source/player/psidle.h b/source/player/psidle.h index 2ee5dee1c..84a0f26a3 100644 --- a/source/player/psidle.h +++ b/source/player/psidle.h @@ -36,7 +36,7 @@ class CPlayerStateBaseIdle : public CPlayerState { public: - void thinkControl(class CPlayerModeBasic *CPlayerMode); + void thinkControl(class CPlayerModeBase *CPlayerMode); }; @@ -44,8 +44,8 @@ public: class CPlayerStateTeeterIdle : public CPlayerStateBaseIdle { public: - virtual void enter(class CPlayerModeBasic *_playerMode); - virtual void think(class CPlayerModeBasic *_playerMode); + virtual void enter(class CPlayerModeBase *_playerMode); + virtual void think(class CPlayerModeBase *_playerMode); }; @@ -62,8 +62,8 @@ typedef struct class CPlayerStateIdle : public CPlayerStateBaseIdle { public: - virtual void enter(class CPlayerModeBasic *_playerMode); - virtual void think(class CPlayerModeBasic *_playerMode); + virtual void enter(class CPlayerModeBase *_playerMode); + virtual void think(class CPlayerModeBase *_playerMode); private: typedef enum @@ -73,7 +73,7 @@ private: ANIMSTATE_END, } ANIMSTATE; - void setNextIdleAnim(class CPlayerModeBasic *_playerMode); + void setNextIdleAnim(class CPlayerModeBase *_playerMode); virtual IdleAnims *getIdleAnimsDb(int _animNo)=0; virtual int getNumIdleAnims()=0; diff --git a/source/player/psjump.cpp b/source/player/psjump.cpp index 3670f95b6..f96740132 100644 --- a/source/player/psjump.cpp +++ b/source/player/psjump.cpp @@ -65,7 +65,7 @@ Params: Returns: ---------------------------------------------------------------------- */ -void CPlayerStateJump::enter(CPlayerModeBasic *_playerMode) +void CPlayerStateJump::enter(CPlayerModeBase *_playerMode) { _playerMode->setAnimNo(ANIM_SPONGEBOB_HOVER); m_jumpFrames=0; @@ -82,7 +82,7 @@ void CPlayerStateJump::enter(CPlayerModeBasic *_playerMode) Params: Returns: ---------------------------------------------------------------------- */ -void CPlayerStateJump::think(CPlayerModeBasic *_playerMode) +void CPlayerStateJump::think(CPlayerModeBase *_playerMode) { const PlayerMetrics *metrics; int controlHeld,controlDown; diff --git a/source/player/psjump.h b/source/player/psjump.h index 3f6f6083b..49a058db6 100644 --- a/source/player/psjump.h +++ b/source/player/psjump.h @@ -35,8 +35,8 @@ class CPlayerStateJump : public CPlayerState { public: - void enter(class CPlayerModeBasic *_playerMode); - void think(class CPlayerModeBasic *_playerMode); + void enter(class CPlayerModeBase *_playerMode); + void think(class CPlayerModeBase *_playerMode); private: int m_jumpFrames; diff --git a/source/player/psrun.cpp b/source/player/psrun.cpp index e0114c7dc..3b13da8c5 100644 --- a/source/player/psrun.cpp +++ b/source/player/psrun.cpp @@ -60,7 +60,7 @@ Params: Returns: ---------------------------------------------------------------------- */ -void CPlayerStateRun::enter(CPlayerModeBasic *_playerMode) +void CPlayerStateRun::enter(CPlayerModeBase *_playerMode) { int controlHeld; controlHeld=_playerMode->getPadInputHeld(); @@ -93,7 +93,7 @@ void CPlayerStateRun::enter(CPlayerModeBasic *_playerMode) Params: Returns: ---------------------------------------------------------------------- */ -void CPlayerStateRun::think(CPlayerModeBasic *_playerMode) +void CPlayerStateRun::think(CPlayerModeBase *_playerMode) { int controlDown,controlHeld; int switchedState=false; diff --git a/source/player/psrun.h b/source/player/psrun.h index b1e61f0c2..376b4b474 100644 --- a/source/player/psrun.h +++ b/source/player/psrun.h @@ -35,8 +35,8 @@ class CPlayerStateRun : public CPlayerState { public: - void enter(class CPlayerModeBasic *_playerMode); - void think(class CPlayerModeBasic *_playerMode); + void enter(class CPlayerModeBase *_playerMode); + void think(class CPlayerModeBase *_playerMode); private: int m_numberOfTimeAnimHasLooped; diff --git a/source/player/pstates.h b/source/player/pstates.h index 7f1890c3d..1ca7bf4ec 100644 --- a/source/player/pstates.h +++ b/source/player/pstates.h @@ -32,8 +32,8 @@ class CPlayerState { public: - virtual void enter(class CPlayerModeBasic *_playerMode) {;} - virtual void think(class CPlayerModeBasic *_playerMode) {;} + virtual void enter(class CPlayerModeBase *_playerMode) {;} + virtual void think(class CPlayerModeBase *_playerMode) {;} }; diff --git a/users/paul/spongebob project/spongebob project.dsp b/users/paul/spongebob project/spongebob project.dsp index 5107ec914..1a42acc0d 100644 --- a/users/paul/spongebob project/spongebob project.dsp +++ b/users/paul/spongebob project/spongebob project.dsp @@ -820,6 +820,14 @@ SOURCE=..\..\..\source\player\pstates.h # End Group # Begin Source File +SOURCE=..\..\..\source\player\pmbloon.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\..\source\player\pmbloon.h +# End Source File +# Begin Source File + SOURCE=..\..\..\source\player\pmfly.cpp # End Source File # Begin Source File