diff --git a/Faceball2030/assets/crosshair.png b/Faceball2030/assets/crosshair.png new file mode 100644 index 0000000..fe35615 Binary files /dev/null and b/Faceball2030/assets/crosshair.png differ diff --git a/Faceball2030/main.cpp b/Faceball2030/main.cpp index 535ed74..427e6ad 100644 --- a/Faceball2030/main.cpp +++ b/Faceball2030/main.cpp @@ -1284,6 +1284,7 @@ bool FaceBall::OnUserCreate() life3 = new Decal(new Sprite("assets/life3.png")); life2 = new Decal(new Sprite("assets/life2.png")); life1 = new Decal(new Sprite("assets/life1.png")); + crosshair = new Decal(new Sprite("assets/crosshair.png")); enemy_ShootMe = { "assets/enemies/ShootMe.obj", enemy_ShootMe_tex }; enemy_IShoot = { "assets/enemies/IShoot.obj", enemy_IShoot_tex }; @@ -1519,6 +1520,7 @@ void FaceBall::RenderHud(float fElapsedTime) { DrawStringDecal(vf2d{ 112 + hudOffset+32,4+18 }+hudAdjustment, "Triangles: " + std::to_string(triRenderCount), BLACK, { 2,4 }); std::string hudText = "Tags Left: " + std::to_string(tagsRemaining) + " Lives: " + std::to_string(lives); DrawStringPropDecal(vf2d{ hudOffset + (float)(ScreenWidth() / 2 - GetTextSizeProp(hudText).x * 3 / 2)+32,(float)(ScreenHeight() - 64 - GetTextSizeProp(hudText).y * 6)+18 } + hudAdjustment, hudText, WHITE, { 3,6 }); + DrawDecal({ float(ScreenWidth() / 2 - crosshair->sprite->width / 2),float(ScreenHeight() / 2 - crosshair->sprite->height / 2) }, crosshair, { 1,1 }, {255,255,255,128}); } 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) }); GradientFillRectDecal({ float(ScreenWidth()/2),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 ? 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?120:hudShakeTime>0?64:0)}); diff --git a/Faceball2030/main.h b/Faceball2030/main.h index 954f494..f338789 100644 --- a/Faceball2030/main.h +++ b/Faceball2030/main.h @@ -237,7 +237,7 @@ 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; + *life4,*life3,*life2,*life1,*crosshair; vi2d MAP_SIZE; vi2d exitCoords = { 0,0 }; std::vector>map;