|
|
|
@ -1694,6 +1694,9 @@ bool FaceBall::OnUserCreate() |
|
|
|
|
mapWalls.texture = wall_tex; |
|
|
|
|
mapFloor.texture = floor_tex; |
|
|
|
|
|
|
|
|
|
mapSpr=new Sprite(128,128); |
|
|
|
|
mapDecal=new Decal(mapSpr); |
|
|
|
|
|
|
|
|
|
InitializeEnemyData(); |
|
|
|
|
InitializePowerupColors(); |
|
|
|
|
|
|
|
|
@ -1982,6 +1985,16 @@ void FaceBall::RenderHud(float fElapsedTime) { |
|
|
|
|
if (camoDuration > 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) { |
|
|
|
|