Wenzil

Member
  • Content count

    3
  • Joined

  • Last visited

Community Reputation

659 Good

About Wenzil

  • Rank
    Newbie
  1. Using global variables - really so bad?

    Inject the sound system in Level1's constructor.   public int main() { SoundSystem* soundSystem = new SoundSystem(); Level1* level1 = new Level1(soundSystem); } class Level1 { private: Player player; SoundSystem* soundSystem; public: Level1(SoundSystem* soundSystem) : soundSystem(soundSystem) { } void Logic() { if(something) soundSystem->Play("shot.wav"); } };
  2. OOP Newb: Am I doing this right?

    This is just a general OOP guideline, but it fits this particular example very well. According to Law of Demeter (see http://en.wikipedia.org/wiki/Law_of_Demeter), the clients of your Player class (in this case, Game) should not know about the Sprite subcomponent. So in your Player class you would have a Move(float x, float y) method defined like this:   void Player::Move(float x, float y) { sprite.move(x, y) }   Then, inside Game.cpp, instead of moving the player's sprite directly, you just tell the player to move, and the player will take care of moving its sprite.   Similarly, you should define the Player constructor to set the sprite's origin and initial position, instead of having Game.cpp do it.    
  3. Looking for completely honest feed-back

    I'm no musician so I can only give an opinion: I like it a lot!   I feel like the first piece could start at the 1 min 12 (or 16?) second mark and be totally awesome all the way through. 0:00-1:12 has its moments but I feel like its missing something, too repetitive maybe?   The second one is perfect from what I can hear. Nice job :)