From 13b3e08d63e82d8dd98555477339557dedbb0a81 Mon Sep 17 00:00:00 2001 From: sigonasr2 Date: Sat, 29 Apr 2023 20:46:50 -0500 Subject: [PATCH] Temporary map sprite/decal re-rendering. --- Faceball2030/assets/enemies/IShoot.png | Bin 7590 -> 7755 bytes Faceball2030/main.cpp | 18 +++++++++++++++++- Faceball2030/main.h | 3 +++ TODO.txt | 5 +++++ 4 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 TODO.txt diff --git a/Faceball2030/assets/enemies/IShoot.png b/Faceball2030/assets/enemies/IShoot.png index 7faa4e02cb37af81fceebdce024ad153885e7a4f..b06088d8811cc5ffc8c3e9c285fa5dfa4e6efc89 100644 GIT binary patch delta 2750 zcmb7^c|6qlAICp)h;=oJH6b&_QfU~>#V-t_bfcA`95cq`$WbX&%ox#-tDQ`Ck!wSV zapfp6a+ip5A1SPBT~QRWU+q5jvH$-5`@TPq=jZi$y;F~zNf5NaG zeo@brxjrUu4F5{|K;dAYljr7>ZI+_^&yhbYgcSg8hG9>B$<$ugqG!-qi64~ z)vU`--8YTJ`|NlS5IN@wyJ&KPnVJz$*qzKb)rVAI8P2?ZBdj|-nLL97HJc!-= zni~=R`SPZw1su@edekrua)6bZu7^!>PlR(LpdyZ(v%W{=G*b!=+TPxDo-6dYUN`aU zi+Z#++5(T*qH#>6+ix2<(lKO`2g4|7WU@M&agX}k+KcTxU-ijE*3>;N3uIqfnwwEm zC+xKkFkeI`KgGJ)`wU!L9BkmUz?u;6R1@&^BfEdjitov6O$dq+Te5p{{_&`mt&^I; zPjV)O_s=m~3*2ksOT7EMR$>O0D87%?M#l@@#H3KxqAcGI=6~~DhkGm@h{pUrW4>-K zlQDzYIUc_CX#xzdeVE#>gY;#)RVH*`PgXWMG<#Sq)0%5`PBR34atQ8|i0RkjSHhfl zjw9dH`Xi_O%jRcyp3?TK;`PUttw}$waCbA}Jv;uM=%J8Q`R4NwI_gI8=SP+p>$w4e z5K-0lO>WWRHO7>UT$5X@QbblpP-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uW?wu4?AAPFn(vA5S6g5-GNDz*|VY{~ZYta}(6exI8s^D63qyZOs=X zr-VPBuDB7sd#+)%(p7ZpJsdz5i{4dm`Vi2cGQ~y!>Z)Fy$N;**Q9i__7hm-D2MT~u z@n?qrWDZh3{`$$Axp3<)D~eSP{~XARf|Pz1ZB?M}dAbs=H4 z+!sY?dSwveC|Xd3UJeq2+_xNuUP$RLE=wrhH#sYb{SGN!_$>lJab7wC6FUS{h~(pI zDO=&H*fl3m4!SoKCS;^pz#0<+AwKHbe>KIWwb*LWD2F5_;{f3F0{$}*ad~3B^mnrz XPe;atuP+%vNZ{ 0) { DrawPartialDecal({ hudOffset + float(ScreenWidth() / 10 - 16), float(ScreenHeight() / 4 + ScreenHeight() / 4 * 2 - 16 * 4) }, vf2d{ 32,32 }*4, powerups_tex, { 5 * 32,0 }, { 32,32 },camoDuration>7?WHITE:camoDuration>2?std::abs(std::sin(10*camoDuration))>0.65?WHITE:BLACK: std::abs(std::sin(30 * camoDuration)) > 0.75 ? WHITE : BLACK); } + vf2d mapCenter = {float(ScreenWidth()-364),float(164)}; + mapSpr= new Sprite{128,128}; + vf2d mapSprSize = {float(mapSpr->width),float(mapSpr->height)}; + SetDrawTarget(mapSpr); + Clear(BLACK); + vf2d center = mapSprSize/2; + FillCircle(center,5,GREEN); + SetDrawTarget(nullptr); + mapDecal=new Decal(mapSpr); + DrawRotatedDecal(mapCenter-mapSprSize,mapDecal,-fYaw,mapSprSize/2); SetDecalMode(DecalMode::NORMAL); } GradientFillRectDecal({ 0,0 }, vf2d{ (float)ScreenWidth()/2,(float)ScreenHeight()/2 }, { (uint8_t)screenCol.r,(uint8_t)screenCol.g,(uint8_t)screenCol.b,(uint8_t)(hudShakeTime>0.2f?120:hudShakeTime>0?64:0) }, { (uint8_t)screenCol.r,(uint8_t)screenCol.g,(uint8_t)screenCol.b,(uint8_t)(hudShakeTime>0.2f?120:hudShakeTime>0?64:0) }, { (uint8_t)screenCol.r,(uint8_t)screenCol.g,(uint8_t)screenCol.b,(uint8_t)(hudShakeTime > 0.2f ? 64 : 0) }, { (uint8_t)screenCol.r,(uint8_t)screenCol.g,(uint8_t)screenCol.b,(uint8_t)(hudShakeTime>0.2f?120:hudShakeTime>0?64:0) }); @@ -2106,7 +2119,8 @@ void FaceBall::RunEnemyAI(Enemy& e,float fElapsedTime,int myIndex) { }break; } }break; - case ISHOOT: { + case ISHOOT: + case ISHOOT_MAP: { e.rot += dat.rotSpd * fElapsedTime; if (e.CanShoot()) { e.ShootBullet(myIndex); @@ -2154,6 +2168,8 @@ void FaceBall::RunEnemyAI(Enemy& e,float fElapsedTime,int myIndex) { bool FaceBall::OnUserUpdate(float fElapsedTime) { + delete mapSpr; + delete mapDecal; fElapsedTime = std::min(0.01667f, fElapsedTime); gameTimer += fElapsedTime; switch (mode) { diff --git a/Faceball2030/main.h b/Faceball2030/main.h index 6df59fb..a9b09b7 100644 --- a/Faceball2030/main.h +++ b/Faceball2030/main.h @@ -263,6 +263,9 @@ class FaceBall : public PixelGameEngine enemy_Sonar, mapExit,enemy_ShootMe2,powerup,powerup2, enemy_IShoot; + Sprite*mapSpr; + Decal*mapDecal; + Decal* dot, * enemy_ShootMe_tex,*bullet_tex,*wall_tex,*floor_tex, *enemy_Sonar_tex,*hud,*exit_wall_tex,*enemy_ShootMe2_tex,*enemy_IShoot_tex, *life4,*life3,*life2,*life1,*crosshair,*hudmeter,*powerup_tex,*powerup2_tex, diff --git a/TODO.txt b/TODO.txt new file mode 100644 index 0000000..07736e2 --- /dev/null +++ b/TODO.txt @@ -0,0 +1,5 @@ +- Minimap +- Skybox +- Levels have distinguishing elements (skybox, walls, floor, fog color) +- Main Menu +- Sounds & Music \ No newline at end of file