From f2b89a6d0136fc079613dd5fa8f4fefa432c7539 Mon Sep 17 00:00:00 2001 From: sigonasr2 Date: Thu, 20 Apr 2023 17:44:17 -0500 Subject: [PATCH] Powerups display inside powerup capsule. --- Faceball2030/assets/powerups.png | Bin 0 -> 2769 bytes Faceball2030/main.cpp | 11 +++++++++++ Faceball2030/main.h | 3 ++- 3 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 Faceball2030/assets/powerups.png diff --git a/Faceball2030/assets/powerups.png b/Faceball2030/assets/powerups.png new file mode 100644 index 0000000000000000000000000000000000000000..8c4cc7e0c01286857fb24183de55b538f20d6c09 GIT binary patch literal 2769 zcmV;?3NH1DP)EX>4Tx04R}tkv&MmKpe$i(~6=MK{JRrWT;LSii$W&6^me@v=v%)FuC*#nlvOS zE{=k0!NHHks)LKOt`4q(Aou~|>f)s6A|?JWDYS_7;J6>}?mh0_0YbgZG%FARG~G6n zv8a^Eu1ejn2tdRjBIuKuWyDj9X>=T4_we!cF3ht!pZjz4t2v7SK8bja8KzCVK|Hf* z8=UuvMOKtm;&b8&lP*a7$aTfzH_io@1)eFI>Et}INGuiFSZQNcG&SOB;*hH8lrLmF zRyl8R*2-1ZyeEHQFsHAixK48vF)SgD1SBY^qJ%PRglW}Dv5=(wXb1m@>raqNAy)~E z91EyGgY5dj|KNAGR(@*IOA1DTt{2Do7z4U@fkw@7zKjJ_!g4BY~~YhG{7eVjf3Y3geE1~@nb z#tW3a-r?On?Y;ebrrF;Qj#hHACryt_00006VoOIv089Yi04q)@g?a!0010qNS#tmY z3ljhU3ljkVnw%H_000McNliru=L8fM5jJV2j@bYJ2+m1FK~#9!?VU}CBxf1Nf6wgf zRI{=@y*fP~sH5a2ih>6ZvK|aflMQ&#FyfL%gTrPa7YSJqVLe3%>PqmkU|=B8k%bJN zyl4;T!8v&m#o$2<$p)Q|UY+iq?4)b5vyX>@{{QFy zJoVPQFd&<~k1`}XuYG5hS&&T)3Iz3y;eg@1_MKT~VQhL(AQ)Ekos_=s5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9o2?W49Pe`v33khX|?bfpagu;41(o~`X3sAJ7n-b;9Xiz z0^T(wV7u~vi9tkx_WX;;jdJe`?>F-Q`08P#_Ec0rJGVU(^<71>ajyP%@2d;^5<*EX zdDIWwN_9L4;I5S91+8eud*Atz(5RTFg0gH1ZHfq>wka0wfwsL-2c$1f~Fw?M+qDO$5O04?or%H)`Mb#{5r_J?E$j1Nx_4zBz6y0g0&z{0#3W z0z!M9zpQWQ9gpJ+Nk{(0&my~T)jVedCjK&z+cC}zUVg5wPY9tUc z^1Dgj@16fBQQlbvD2^|5=kIB*2-F390g7h7*ad#C`2pgyKZpr&>DB-|Q-UFY|2$aY zBoI;dcdrE*ckz#YfIkAMz=8|tixG%J1IS>ciyonX?Kh}NO8$iMxv?doMAisMU}a#x zv|xhdKB~I2R+iKk?O5N?-6YloOkzbK>BlMjqQ?jpb>!TUK!VGHhgAb(9QECcf`*Ck z(EELtz=%Kg1Tcn@?tGCzO8+N7)YXDB8*R%5Yn(_RVjUs7Ynf%1S!S7KmRV+*owff1 XlqOl<;6-W900000NkvXXu0mjfbW|iT literal 0 HcmV?d00001 diff --git a/Faceball2030/main.cpp b/Faceball2030/main.cpp index 80c66f6..f99cbdc 100644 --- a/Faceball2030/main.cpp +++ b/Faceball2030/main.cpp @@ -958,6 +958,16 @@ void FaceBall::RenderPowerupMesh(mat4x4& matView, std::vector& vecTria } } } + if (p.opened) { + Mesh mesh; + float uv = ((int)p.type - 1) * 0.125f; + mesh.tris.push_back({ {{-0.25,0,0},{0.25,0,0},{-0.25,0.5,0}},{{uv,1},{uv + 0.125f,1},{uv,0}},{WHITE,WHITE,WHITE},powerups_tex }); + mesh.tris.push_back({ {{-0.25,0.5,0},{0.25,0,0},{0.25,0.5,0}},{{uv,0},{uv + 0.125f,1},{uv + 0.125f,0}},{WHITE,WHITE,WHITE},powerups_tex }); + Object billboard = { + mesh,p.pos,std::atan2f(player.GetPos().z - p.pos.z,player.GetPos().x - p.pos.x) - PI / 2,0.25f + }; + RenderMesh(matView, vecTrianglesToRaster, billboard, false); + } } void FaceBall::RenderMeshDeathScreen(mat4x4& matView, std::vector& vecTrianglesToRaster, Object& o) { @@ -1508,6 +1518,7 @@ bool FaceBall::OnUserCreate() hudmeter = new Decal(new Sprite("assets/hudmeter.png")); powerup_tex = new Decal(new Sprite("assets/powerup.png")); powerup2_tex = new Decal(new Sprite("assets/powerup2.png")); + powerups_tex = new Decal(new Sprite("assets/powerups.png")); enemy_ShootMe = { "assets/enemies/ShootMe.obj", enemy_ShootMe_tex }; enemy_IShoot = { "assets/enemies/IShoot.obj", enemy_IShoot_tex }; diff --git a/Faceball2030/main.h b/Faceball2030/main.h index 250db53..65f0461 100644 --- a/Faceball2030/main.h +++ b/Faceball2030/main.h @@ -267,7 +267,8 @@ class FaceBall : public PixelGameEngine Decal* dot, * enemy_ShootMe_tex,*bullet_tex,*wall_tex,*floor_tex, *enemy_Sonar_tex,*hud,*exit_wall_tex,*enemy_IShoot_tex, - *life4,*life3,*life2,*life1,*crosshair,*hudmeter,*powerup_tex,*powerup2_tex; + *life4,*life3,*life2,*life1,*crosshair,*hudmeter,*powerup_tex,*powerup2_tex, + *powerups_tex; vi2d exitCoords = { 0,0 }; std::vector>map; std::vectorobjects;