Guest User

Untitled

a guest
Nov 24th, 2017
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.09 KB | None | 0 0
  1. void ECE::Game::Clocks()
  2. {
  3. duration += _updateClock.restart().asSeconds();
  4. if (duration >= _updateTime.asSeconds())
  5. {
  6. Update();
  7. duration -= _updateTime.asSeconds();
  8. }
  9.  
  10. }
  11.  
  12. void ECE::Game::Update()
  13. {
  14. if (SceneManager::GetCurrentScene() != nullptr)
  15. {
  16. SceneManager::GetCurrentScene()->Update();
  17. }
  18. }
  19.  
  20. void ECE::Scene::Update()
  21. {
  22. for (std::list<GameObject*>::iterator it = gameObjects.begin(); it != gameObjects.end(); it++)
  23. {
  24. it._Ptr->_Myval->Update();
  25. }
  26. CollisionChecking();
  27. }
  28.  
  29. void Beam::Update
  30. {
  31. //....
  32. if (hasCreated == false)
  33. {
  34. hasCreated = true;
  35. b = new Beam();
  36. b->GetCollider().SetPosition(_C_nextPos.GetPosition());
  37. b->GetCollider().SetRotation(_C_nextPos.GetRotation() + 270);
  38. b->originPoint = _C_nextPos.GetPosition();
  39. ECE::SceneManager::GetCurrentScene()->AddGameObject(*b);
  40. }
  41. //...
  42. void ECE::Scene::AddGameObject(GameObject & go)
  43. {
  44. gameObjects.insert(gameObjects.end(), &go);
  45. go.Start();
  46. }
Add Comment
Please, Sign In to add comment