Powerups display inside powerup capsule.

linux_template
sigonasr2 2 years ago
parent 78b7aef32f
commit f2b89a6d01
  1. BIN
      Faceball2030/assets/powerups.png
  2. 11
      Faceball2030/main.cpp
  3. 3
      Faceball2030/main.h

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

@ -958,6 +958,16 @@ void FaceBall::RenderPowerupMesh(mat4x4& matView, std::vector<Triangle>& 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<Triangle>& 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 };

@ -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<std::vector<MapSquare>>map;
std::vector<Object>objects;

Loading…
Cancel
Save