Parcourir la source

Color of Sniper has been modified. Now it's blue (more visible).

Jovian (Toshiba) il y a 6 ans
Parent
commit
118860430a
1 fichiers modifiés avec 5 ajouts et 1 suppressions
  1. 5 1
      Shot/Sniper.cpp

+ 5 - 1
Shot/Sniper.cpp

@@ -45,7 +45,11 @@ void Sniper::update()
 void Sniper::draw( SDL_Surface* screen )
 {
     if ( m_exist )
-        stringRGBA(screen, m_x - 4, m_y - 4, "=", 255, 0, abs( m_velocity ) * 255 / SNIPER_MAX_SPEED, 255);
+        stringRGBA(screen, m_x - 4, m_y - 4, "=",
+                255 - (abs( m_velocity ) - SNIPER_MIN_SPEED) * 255 / (SNIPER_MAX_SPEED - SNIPER_MIN_SPEED),
+                255,
+                (abs( m_velocity ) - SNIPER_MIN_SPEED) * 255 / (SNIPER_MAX_SPEED - SNIPER_MIN_SPEED),
+                255);
 }
 
 bool Sniper::damageSolid( Uint8** solid, const Uint16 dimH, const Uint16 dimW, const SDL_Rect& hitbox )