Changeset 11645
- Timestamp:
- Dec 9, 2017, 1:29:44 PM (7 years ago)
- Location:
- code/branches/Asteroid_HS17
- Files:
-
- 3 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/Asteroid_HS17/data/levels/templates/spaceshipAsteroids2D.oxt
r11637 r11645 43 43 > 44 44 <engines> 45 <MultiStateEngine position=" 7.6, 0, 6" template=spaceship invaderengine />46 <MultiStateEngine position="-7.6, 0, 0" template=spaceship invaderengine />45 <MultiStateEngine position=" 7.6, 0, 6" template=spaceshipasteroids2dengine /> 46 <MultiStateEngine position="-7.6, 0, 0" template=spaceshipasteroids2dengine /> 47 47 </engines> 48 48 <attached> … … 72 72 </explosion> 73 73 <?lua 74 include("../includes/ invaderWeapon.oxi")74 include("../includes/asteroids2DWeapon.oxi") 75 75 ?> 76 76 </Asteroids2DShip> … … 93 93 </Template> 94 94 95 <Template name=spaceship invaderengine baseclass=MultiStateEngine>95 <Template name=spaceshipasteroids2dengine baseclass=MultiStateEngine> 96 96 <MultiStateEngine 97 97 boostfactor = 2.2 … … 111 111 accelerationupdown = 500 112 112 > 113 114 <!-- backlight error if you fly over the edge 113 115 <EffectContainer condition="idle"> 114 116 <WorldSound mainstate="activity" source="sounds/Engine_idle.ogg" looping=1 active=false/> … … 130 132 </EffectContainer> 131 133 134 --> 135 132 136 </MultiStateEngine> 133 137 </Template> -
code/branches/Asteroid_HS17/data/overlays/Asteroids2DHUD.oxo
r11608 r11645 6 6 <Template name="Asteroids2DHUD"> 7 7 <OverlayGroup name="Asteroids2DHUD" scale = "1, 1"> 8 9 <OverlayText 10 position = "0.02, 0.1" 11 pickpoint = "0.0, 0.0" 12 font = "ShareTechMono" 13 textsize = 0.04 14 colour = "1.0, 1.0, 1.0, 1.0" 15 align = "left" 16 caption = "Lives: " 17 /> 18 19 <Asteroids2DHUDinfo 20 position = "0.14, 0.1" 21 pickpoint = "0.0, 0.0" 22 font = "ShareTechMono" 23 textsize = 0.04 24 colour = "1.0, 1.0, 1.0, 1.0" 25 align = "left" 26 27 showlives = true 28 showlevel = false 29 showpoints = false 30 /> 8 31 9 32 <OverlayText … … 28 51 /> 29 52 53 <OverlayText 54 position = "0.02, 0.055" 55 pickpoint = "0.0, 0.0" 56 font = "ShareTechMono" 57 textsize = 0.04 58 colour = "1.0, 1.0, 1.0, 1.0" 59 align = "left" 60 caption = "Level: " 61 /> 62 63 <Asteroids2DHUDinfo 64 position = "0.14, 0.055" 65 pickpoint = "0.0, 0.0" 66 font = "ShareTechMono" 67 textsize = 0.04 68 colour = "1.0, 1.0, 1.0, 1.0" 69 align = "left" 70 71 showlives = false 72 showlevel = true 73 showpoints = false 74 /> 75 30 76 31 77 </OverlayGroup> -
code/branches/Asteroid_HS17/src/modules/asteroids2D/Asteroids2D.cc
r11637 r11645 52 52 53 53 bEndGame = false; 54 lives = 5;54 lives = 1000; 55 55 level = 1; 56 56 point = 0; … … 158 158 }; 159 159 160 160 //Funktion wird als erstes im Level aufgerufen 161 161 void Asteroids2D::start() 162 162 { -
code/branches/Asteroid_HS17/src/modules/asteroids2D/Asteroids2DHUDinfo.cc
r11637 r11645 41 41 42 42 this->Asteroids2DGame = nullptr; 43 this->Ship = nullptr;43 //this->Ship = nullptr; 44 44 this->bShowPoints_ = true; 45 45 this->bShowHealth_ = true; … … 51 51 52 52 XMLPortParam(Asteroids2DHUDinfo,"showPoints", setShowPoints, getShowPoints, xmlelement, mode).defaultValues(false); 53 XMLPortParam(Asteroids2DHUDinfo,"showHealth", setShowHealth, getShowHealth, xmlelement, mode).defaultValues(false);54 53 } 55 54 -
code/branches/Asteroid_HS17/src/modules/asteroids2D/Asteroids2DHUDinfo.h
r11637 r11645 61 61 private: 62 62 Asteroids2D* Asteroids2DGame; 63 Asteroids2DShip* Ship; 63 bool bShowLives_; 64 bool bShowLevel_; 64 65 bool bShowPoints_; 65 66 bool bShowHealth_; 67 66 68 }; 67 69 } -
code/branches/Asteroid_HS17/src/modules/asteroids2D/Asteroids2DShip.cc
r11643 r11645 98 98 { 99 99 100 orxout() << "touched" << endl;101 100 Asteroids2DStone* stone = orxonox_cast<Asteroids2DStone*>(otherObject); 102 if(stone != nullptr && (stone != lastStone || lastStone == nullptr))101 if(stone != nullptr && !bImmune) 103 102 { 104 103 removeHealth(100); 105 lastStone = stone; 106 104 this->getGame()->addPoints(10); 105 106 //The ship will be immune for 3 seconds after it has been hit by an asteroid 107 bImmune = true; 108 isimmune.setTimer(3.0f, false, createExecutor(createFunctor(&Asteroids2DShip::toggleImmune, this))); 109 orxout()<< "touched" << endl; 107 110 } 108 111 return false; -
code/branches/Asteroid_HS17/src/modules/asteroids2D/Asteroids2DShip.h
r11643 r11645 68 68 virtual void rotateRoll(const Vector2& value) override{}; // Rotate in roll direction. 69 69 70 71 72 70 virtual void updateLevel(); 73 71 … … 77 75 bool isFireing; 78 76 void showposition(); 77 void toggleImmune() 78 { 79 bImmune = !bImmune; 80 } 79 81 80 82 protected: … … 86 88 float width, height; 87 89 WeakPtr<Asteroids2D> game; 88 WeakPtr<Asteroids2DStone> lastStone; 89 90 bool bImmune; 90 91 Timer timer; 92 Timer isimmune; 91 93 }; 92 94 } -
code/branches/Asteroid_HS17/src/modules/asteroids2D/CMakeLists.txt
r11616 r11645 5 5 Asteroids2DStone.cc 6 6 Asteroids2DHUDinfo.cc 7 Asteroids2DWeapon.cc 7 8 ) 8 9
Note: See TracChangeset
for help on using the changeset viewer.