Selaa lähdekoodia

Merge remote-tracking branch 'origin/developer' into feature/weaponCollision
Added waeponswitch to backbutton of controller

# Conflicts:
# Enemy.cpp
# Player.cpp
# Weapon.cpp
# Weapon.h

jancoow 9 vuotta sitten
vanhempi
commit
ba0482ee0a

+ 1 - 0
Controller.h

@@ -9,6 +9,7 @@ public:
     Vec3f ypr;
     Vec2f joystick;
     bool button, joystickButton, magnetSwitch;
+    bool lastButton, lastJoystickButton, lastMagetSwitch;
     int controllerId;
 
     void setConnected(bool connected);

+ 5 - 0
ControllerHandler.cpp

@@ -120,6 +120,11 @@ void ControllerHandler::commandControllerData(std::vector<std::string> data) {
 
             c->joystick.x = std::stoi(data[2])/2000.0f;
             c->joystick.y = std::stoi(data[3])/2000.0f;
+
+            c->lastButton = c->button;
+            c->lastJoystickButton = c->joystickButton;
+            c->lastMagetSwitch = c->magnetSwitch;
+
             c->joystickButton = !(data[4] == "0");
             c->button = !(data[8] == "0");
             c->magnetSwitch = !(data[9] == "0");

+ 7 - 2
Crystal.cpp

@@ -7,18 +7,22 @@ Crystal::Crystal(const std::string & filled, const std::string & empty, const Ve
 {
 	this->filled = Model::load(filled);
 	this->empty = Model::load(empty);
-	model = this->filled;
-	
+	model = this->filled;	
 
 	this->position = position;
 	this->rotation = rotation;
 	this->scale = scale;
 	this->canCollide = true;
 	isFilled = true;
+
+	sound_id = CrystalPoint::GetSoundSystem().LoadSound("WAVE/Crystal.wav", false);
+	music = CrystalPoint::GetSoundSystem().GetSound(sound_id);
+	music->SetPos(position, Vec3f());
 }
 
 Crystal::~Crystal()
 {
+	CrystalPoint::GetSoundSystem().UnloadSound(sound_id);
 	if (model)
 		Model::unload(model);
 
@@ -41,6 +45,7 @@ void Crystal::collide()
 {
 	if (isFilled)
 	{
+		music->Play();
 		Player::getInstance()->crystals++;
 		isFilled = false;
 		model = empty;

+ 3 - 0
Crystal.h

@@ -1,6 +1,7 @@
 #pragma once
 #include "Entity.h"
 #include <string>
+#include "CrystalPoint.h"
 
 class Crystal :
 	public Entity
@@ -14,6 +15,8 @@ public:
 	void draw();
 	void collide();
 private:
+	int sound_id;
+	Sound* music;
 	Model* filled;
 	Model* empty;
 };

+ 23 - 9
CrystalPoint.cpp

@@ -71,15 +71,18 @@ void CrystalPoint::update()
 
 	if (state)
 	{
+		Player* player = Player::getInstance();
+
 		if (keyboardState.special[GLUT_KEY_LEFT] && !prevKeyboardState.special[GLUT_KEY_LEFT])
 			worldhandler->PreviousWorld();
 		if (keyboardState.special[GLUT_KEY_RIGHT] && !prevKeyboardState.special[GLUT_KEY_RIGHT])
 			worldhandler->NextWorld();
+		if (keyboardState.special[GLUT_KEY_UP] && !prevKeyboardState.special[GLUT_KEY_UP])
+			player->NextLeftWeapon();
+		if (keyboardState.special[GLUT_KEY_DOWN] && !prevKeyboardState.special[GLUT_KEY_DOWN])
+			player->PreviousLeftWeapon();
 		if (keyboardState.keys[27])
 			state = false;
-		
-
-		Player* player = Player::getInstance();
 
 		//testing code
 		if (keyboardState.keys['u'])
@@ -106,10 +109,6 @@ void CrystalPoint::update()
 		if (leftcontroller != nullptr) {
 			Vec2f *leftControllerJoystick = &leftcontroller->joystick;
 
-			if (leftcontroller->joystickButton) {
-				controller.rumble(leftcontroller->controllerId, 100, 100);
-			}
-
 			if (leftControllerJoystick->y > 0.3 || leftControllerJoystick->y < -0.3) {
 				player->rotation.x += leftControllerJoystick->y/4;
 			}
@@ -122,7 +121,12 @@ void CrystalPoint::update()
 
 			if(leftcontroller->button && leftcontroller->joystickButton){
 				state = !state;
-			}
+			}else if(!leftcontroller->lastButton && leftcontroller->button){
+                leftcontroller->lastButton = leftcontroller->button;
+                controller.rumble(leftcontroller->controllerId, 100, 200);
+                player->NextLeftWeapon();
+            }
+
 		}
 		if(rightcontroller != nullptr){
 			Vec2f *rightControllerJoystick = &rightcontroller->joystick;
@@ -140,6 +144,12 @@ void CrystalPoint::update()
 				player->setPosition(0, rightControllerJoystick->x * -1 * deltaTime * 2.0f, false);
 			}
 
+            if(!rightcontroller->lastButton && rightcontroller->button){
+                rightcontroller->lastButton = rightcontroller->button;
+                controller.rumble(rightcontroller->controllerId, 100, 200);
+                player->NextRightWeapon();
+            }
+            
             player->rightWeapon->rotateWeapon(Vec3f(rightcontroller->ypr.y + 140, 0, -rightcontroller->ypr.z));
         }
 
@@ -148,9 +158,13 @@ void CrystalPoint::update()
 		if (player->rotation.x < -90)
 			player->rotation.x = -90;
 
+		player->position.y = worldhandler->getHeight(player->position.x, player->position.z) + 1.7f;
+
 		if (!worldhandler->isPlayerPositionValid())
 			player->position = oldPosition;
-		player->position.y = worldhandler->getHeight(player->position.x, player->position.z) + 1.7f;
+		/*else if (player->position.y > oldPosition.y + 1.2)
+			player->position = oldPosition;
+		*/
 		worldhandler->update(deltaTime);
 	}	
 	else

+ 4 - 2
CrystalPoint.vcxproj

@@ -230,8 +230,10 @@
     <None Include="worlds\worlds.json" />
   </ItemGroup>
   <ItemGroup>
-    <Media Include="WAVE\bond.wav" />
-    <Media Include="WAVE\Sound.wav" />
+    <Media Include="WAVE\Crystal.wav" />
+    <Media Include="WAVE\ghostEnemy.wav" />
+    <Media Include="WAVE\portal.wav" />
+    <Media Include="WAVE\world1.wav" />
   </ItemGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
   <ImportGroup Label="ExtensionTargets">

+ 8 - 2
CrystalPoint.vcxproj.filters

@@ -243,10 +243,16 @@
     </None>
   </ItemGroup>
   <ItemGroup>
-    <Media Include="WAVE\Sound.wav">
+    <Media Include="WAVE\Crystal.wav">
       <Filter>Resource Files</Filter>
     </Media>
-    <Media Include="WAVE\bond.wav">
+    <Media Include="WAVE\portal.wav">
+      <Filter>Resource Files</Filter>
+    </Media>
+    <Media Include="WAVE\ghostEnemy.wav">
+      <Filter>Resource Files</Filter>
+    </Media>
+    <Media Include="WAVE\world1.wav">
       <Filter>Resource Files</Filter>
     </Media>
   </ItemGroup>

+ 2 - 9
Enemy.cpp

@@ -35,11 +35,10 @@ Enemy::Enemy(const std::string &fileName,
 
 Enemy::~Enemy()
 {
-	
+	music->Stop();
+	CrystalPoint::GetSoundSystem().UnloadSound(hit_sound_id);
 	if (model)
 		Model::unload(model);
-
-	CrystalPoint::GetSoundSystem().UnloadSound(hit_sound_id);
 }
 
 void Enemy::draw()
@@ -123,13 +122,7 @@ void Enemy::update(float delta)
 		else
 		{	
 			attack = true;
-			if (music->IsPlaying() == true)
-			{
-//				music->Pause();
-				music->Stop();
-			}
 		}
-
 		rotation.y = atan2f(dx, dz) * 180 / M_PI;		
 	}
 	Player *player = Player::getInstance();

+ 4 - 0
Interface.cpp

@@ -87,6 +87,10 @@ void Interface::draw()
 	glColor4f(1.0f, 1.0f, 0.1f, 1.0);
 	Util::glutBitmapString("Level: " + std::to_string(player->level), 490, 900);
 
+	//Text: weapons
+	Util::glutBitmapString(player->leftWeapon->name, 850, 900);
+	Util::glutBitmapString(player->rightWeapon->name, 10, 900);
+
 	for (int i = 0; i < maxCrystals; i++)
 	{
 		glBegin(GL_QUADS);

+ 106 - 3
Player.cpp

@@ -3,6 +3,10 @@
 #include "Player.h"
 #include <GL/freeglut.h>
 
+#include <string>
+#include <iostream>
+#include <fstream>
+
 Player* Player::instance = NULL;
 
 Player::Player()
@@ -12,13 +16,17 @@ Player::Player()
 	health = maxHp;
 	xp = 0;
 	maxXp = 100;
-	level = 1;
+	level = 5;
 	crystals = 0;
 
-	leftWeapon = new Weapon("models/weapons/ZwaardMetTextures/TextureZwaard.obj", 1, position, rotation, Vec3f(4.5, -8, -1), Vec3f(-2.0f, 6.0f, -2.1f), Vec3f(-2.0f, 0.5f, -2.1f), Vec2f(170, 70), Vec2f(20, -80));
+	loadWeapons();
+
+	currentleftweapon = 0;
+	leftWeapon = leftweapons[0];
 	leftWeapon->rotateWeapon(Vec3f(150, 0, 60));
 
-	rightWeapon = new Weapon("models/weapons/ZwaardMetTextures/TextureZwaard.obj", 1, position, rotation, Vec3f(0.5, -8, -1), Vec3f(-2.0f, 6.0f, -2.1f), Vec3f(-2.0f, 0.5f, -2.1f), Vec2f(170, 70), Vec2f(20, -80));
+	currentrightweapon = 0;
+	rightWeapon = rightweapons[0];
 	rightWeapon->rotateWeapon(Vec3f(150, 0, 60));
 }
 
@@ -115,4 +123,99 @@ void Player::levelUp()
 	maxXp += 50;
 	maxHp += 10;
 	health = maxHp;
+}
+
+void Player::loadWeapons()
+{
+	std::string fileName = "weapons.json";
+
+	//Open world json file
+	std::ifstream file(fileName);
+	if (!file.is_open())
+		std::cout << "Error, can't open world file - " << fileName << "\n";
+
+	json::Value v = json::readJson(file);
+	file.close();
+
+	//Check file
+	if (v["weapons"].isNull())
+		std::cout << "Invalid weapons file: " << fileName << "\n";
+
+	//Load object templates
+	for (auto w : v["weapons"])
+	{
+		Weapon* lweapon;
+		Weapon* rweapon;
+
+		std::string name = w["name"].asString();
+		std::string fileN = w["file"].asString();
+		float damage = w["damage"].asFloat();
+
+		Weapon::Element e = Weapon::FIRE;
+
+		if(w["element"].asString() == "fire")
+			e = Weapon::FIRE;
+		else if (w["element"].asString() == "water")
+			e = Weapon::WATER;
+		else if (w["element"].asString() == "earth")
+			e = Weapon::EARTH;
+		else if (w["element"].asString() == "air")
+			e = Weapon::AIR;
+		else
+			e = Weapon::FIRE;
+
+
+		Vec3f leftoffset = Vec3f(w["left"]["offset"][0].asFloat(), w["left"]["offset"][1].asFloat(), w["left"]["offset"][2].asFloat());
+		Vec3f rightoffset = Vec3f(w["right"]["offset"][0].asFloat(), w["right"]["offset"][1].asFloat(), w["right"]["offset"][2].asFloat());
+
+		Vec3f anchor = Vec3f(w["anchor"][0].asFloat(), w["anchor"][1].asFloat(), w["anchor"][2].asFloat());
+		Vec3f collision = Vec3f(w["collision"][0].asFloat(), w["collision"][1].asFloat(), w["collision"][2].asFloat());
+
+		Vec2f maxRot = Vec2f(w["maxRotation"][0].asFloat(), w["maxRotation"][1].asFloat());
+		Vec2f minRot = Vec2f(w["minRotation"][0].asFloat(), w["minRotation"][1].asFloat());
+
+		lweapon = new Weapon(name, damage, e, fileN, 1, position, rotation, leftoffset, anchor, maxRot, minRot, collision);
+		rweapon = new Weapon(name, damage, e, fileN, 1, position, rotation, rightoffset, anchor, maxRot, minRot, collision);
+
+		leftweapons.push_back(lweapon);
+		rightweapons.push_back(rweapon);
+	}
+	
+}
+
+void Player::PreviousRightWeapon()
+{
+	currentrightweapon--;
+
+	if (currentrightweapon < 0)
+		currentrightweapon = (rightweapons.size() > level ? level - 1 : rightweapons.size() - 1);
+
+	rightWeapon = rightweapons[currentrightweapon];
+}
+void Player::NextRightWeapon(void)
+{
+	currentrightweapon++;
+
+	if (currentrightweapon > level - 1 || currentrightweapon > rightweapons.size() - 1)
+		currentrightweapon = 0;
+
+	rightWeapon = rightweapons[currentrightweapon];
+}
+void Player::PreviousLeftWeapon(void)
+{
+	currentleftweapon--;
+
+	if (currentleftweapon < 0)
+		currentleftweapon = (leftweapons.size() > level ? level - 1 : leftweapons.size() - 1);
+
+	leftWeapon = leftweapons[currentleftweapon];
+}
+void Player::NextLeftWeapon(void)
+{
+	currentleftweapon++;
+
+	if (currentleftweapon > level - 1 || currentleftweapon > leftweapons.size() - 1)
+		currentleftweapon = 0;
+
+	leftWeapon = leftweapons[currentleftweapon];
 }

+ 16 - 0
Player.h

@@ -1,12 +1,23 @@
 #pragma once
 #include "Vector.h"
 #include "Weapon.h"
+#include "json.h"
+
+#include <vector>
 
 class Player
 {
 private:
 	static Player* instance;
 	void levelUp();
+
+	std::vector<Weapon*> leftweapons;
+	std::vector<Weapon*> rightweapons;
+	void loadWeapons(void);
+
+	int currentrightweapon;
+	int currentleftweapon;
+
 public:
 	Player();
 	~Player();
@@ -34,4 +45,9 @@ public:
 	void HpUp(int);
 	void HpDown(int);
 	void XpUp(int);
+
+	void PreviousRightWeapon(void);
+	void NextRightWeapon(void);
+	void PreviousLeftWeapon(void);
+	void NextLeftWeapon(void);
 };

BIN
WAVE/Crystal.wav


BIN
WAVE/enemy.wav


BIN
WAVE/ghostEnemy.wav


BIN
WAVE/test1.wav


BIN
WAVE/test2.wav → WAVE/world1.wav


+ 9 - 3
Weapon.cpp

@@ -9,14 +9,20 @@
 #include <cmath>
 
 
-Weapon::Weapon(std::string modelFilename, float scale, Vec3f location, Vec2f rotation,
-               Vec3f offsetPlayer, Vec3f ankerPoint, Vec3f collisionPoint,
-               Vec2f maxRotation, Vec2f minRotation){
+Weapon::Weapon(std::string name, int damage, Element e, std::string modelFilename, float scale, Vec3f location, Vec2f rotation,
+               Vec3f offsetPlayer, Vec3f ankerPoint,
+               Vec2f maxRotation, Vec2f minRotation,
+			   Vec3f collision){
+
     weaponmodel = Model::load(modelFilename);
     rotate(rotation);
     move(location);
     this->scale = scale;
 
+	this->name = name;
+	this->damage = damage;
+	this->element = e;
+
     this->offsetPlayer = offsetPlayer;
     this->ankerPoint = ankerPoint;
     this->maxRotation = maxRotation;

+ 10 - 4
Weapon.h

@@ -11,17 +11,23 @@
 
 class Weapon {
 public:
-    Weapon(std::string modelFilename, float scale, Vec3f location, Vec2f rotation,
-           Vec3f offsetPlayer, Vec3f ankerPoint, Vec3f collisionPoint,
-           Vec2f maxRotation, Vec2f minXRotation);
+	enum Element {FIRE, WATER, EARTH, AIR};
+
+    Weapon(std::string name, int damage, Element element, std::string modelFilename, float scale, Vec3f location, Vec2f rotation,
+           Vec3f offsetPlayer, Vec3f ankerPoint,
+           Vec2f maxRotation, Vec2f minXRotation,
+		   Vec3f collisionPoint);
     ~Weapon();
 
     void draw();
     void rotateWeapon(Vec3f rotation);
     void rotate(Vec2f rotation);
     void move(Vec3f location);
-
+	
+	std::string name;
     unsigned int damage;
+	Element element;
+
     Model* weaponmodel;
 
     float scale;

+ 2 - 1
World.cpp

@@ -64,8 +64,8 @@ World::World(const std::string &fileName)
 
 	//Set player starting position
 	player->position.x = v["player"]["startposition"][0].asFloat();
-	player->position.y = v["player"]["startposition"][1].asFloat();
 	player->position.z = v["player"]["startposition"][2].asFloat();
+	player->position.y = heightmap->GetHeight(player->position.x, player->position.z);
 
 	//Load and place objects into world
 	for (auto object : v["objects"])
@@ -329,6 +329,7 @@ void World::update(float elapsedTime)
 
 	if (remove)
 	{
+		delete enemies[count];
 		player->XpUp(enemies[count]->xp);
 		enemies.erase(enemies.begin() + count);
 		player->HpUp(10);		

BIN
models/weapons/ZwaardMetTextures2/HANDVAT.png


+ 134 - 0
models/weapons/ZwaardMetTextures2/TextureZwaard.mtl

@@ -0,0 +1,134 @@
+newmtl initialShadingGroup
+illum 4
+Kd 0.22 0.22 0.22
+Ka 0.00 0.00 0.00
+Tf 1.00 1.00 1.00
+Ni 1.00
+newmtl lambert2SG
+illum 4
+Kd 0.50 0.32 0.25
+Ka 0.00 0.00 0.00
+Tf 1.00 1.00 1.00
+Ni 1.00
+newmtl lambert3SG
+illum 4
+Kd 0.45 0.45 0.45
+Ka 0.00 0.00 0.00
+Tf 1.00 1.00 1.00
+Ni 1.00
+newmtl lambert4SG
+illum 4
+Kd 0.12 0.12 0.12
+Ka 0.00 0.00 0.00
+Tf 1.00 1.00 1.00
+Ni 1.00
+newmtl lambert5SG
+illum 4
+Kd 0.10 0.05 0.02
+Ka 0.00 0.00 0.00
+Tf 1.00 1.00 1.00
+Ni 1.00
+newmtl pasted__lambert3SG
+illum 4
+Kd 0.45 0.45 0.45
+Ka 0.00 0.00 0.00
+Tf 1.00 1.00 1.00
+Ni 1.00
+newmtl pasted__lambert4SG
+illum 4
+Kd 0.12 0.12 0.12
+Ka 0.00 0.00 0.00
+Tf 1.00 1.00 1.00
+Ni 1.00
+newmtl pasted__lambert4SG1
+illum 4
+Kd 0.12 0.12 0.12
+Ka 0.00 0.00 0.00
+Tf 1.00 1.00 1.00
+Ni 1.00
+newmtl pasted__lambert4SG2
+illum 4
+Kd 0.00 0.00 0.00
+Ka 0.00 0.00 0.00
+Tf 1.00 1.00 1.00
+map_Kd ZWAARD.png
+Ni 1.00
+newmtl pasted__lambert5SG
+illum 4
+Kd 0.10 0.05 0.02
+Ka 0.00 0.00 0.00
+Tf 1.00 1.00 1.00
+Ni 1.00
+newmtl pasted__lambert5SG1
+illum 4
+Kd 0.10 0.05 0.02
+Ka 0.00 0.00 0.00
+Tf 1.00 1.00 1.00
+Ni 1.00
+newmtl pasted__lambert5SG2
+illum 4
+Kd 0.00 0.00 0.00
+Ka 0.00 0.00 0.00
+Tf 1.00 1.00 1.00
+map_Kd HANDVAT.png
+Ni 1.00
+newmtl pasted__pasted__lambert4SG
+illum 4
+Kd 0.12 0.12 0.12
+Ka 0.00 0.00 0.00
+Tf 1.00 1.00 1.00
+Ni 1.00
+newmtl pasted__pasted__lambert4SG1
+illum 4
+Kd 0.12 0.12 0.12
+Ka 0.00 0.00 0.00
+Tf 1.00 1.00 1.00
+Ni 1.00
+newmtl pasted__pasted__lambert4SG2
+illum 4
+Kd 0.12 0.12 0.12
+Ka 0.00 0.00 0.00
+Tf 1.00 1.00 1.00
+Ni 1.00
+newmtl pasted__pasted__lambert4SG3
+illum 4
+Kd 0.12 0.12 0.12
+Ka 0.00 0.00 0.00
+Tf 1.00 1.00 1.00
+Ni 1.00
+newmtl pasted__pasted__lambert5SG
+illum 4
+Kd 0.10 0.05 0.02
+Ka 0.00 0.00 0.00
+Tf 1.00 1.00 1.00
+Ni 1.00
+newmtl pasted__pasted__lambert5SG1
+illum 4
+Kd 0.10 0.05 0.02
+Ka 0.00 0.00 0.00
+Tf 1.00 1.00 1.00
+Ni 1.00
+newmtl pasted__pasted__lambert5SG2
+illum 4
+Kd 0.10 0.05 0.02
+Ka 0.00 0.00 0.00
+Tf 1.00 1.00 1.00
+Ni 1.00
+newmtl pasted__pasted__lambert5SG3
+illum 4
+Kd 0.10 0.05 0.02
+Ka 0.00 0.00 0.00
+Tf 1.00 1.00 1.00
+Ni 1.00
+newmtl pasted__pasted__pasted__lambert4SG
+illum 4
+Kd 0.12 0.12 0.12
+Ka 0.00 0.00 0.00
+Tf 1.00 1.00 1.00
+Ni 1.00
+newmtl pasted__pasted__pasted__lambert5SG
+illum 4
+Kd 0.10 0.05 0.02
+Ka 0.00 0.00 0.00
+Tf 1.00 1.00 1.00
+Ni 1.00

+ 436 - 0
models/weapons/ZwaardMetTextures2/TextureZwaard.obj

@@ -0,0 +1,436 @@
+# This file uses centimeters as units for non-parametric coordinates.
+
+mtllib TextureZwaard.mtl
+g default
+v -2.214711 4.435681 -1.922955
+v -2.214711 4.829163 -1.922955
+v -2.214711 4.829163 -2.316437
+v -2.214711 4.435681 -2.316437
+v -1.821229 4.435681 -2.316437
+v -1.821229 4.829163 -2.316437
+v -1.821229 4.829163 -1.922955
+v -1.821229 4.435681 -1.922955
+v -1.908670 5.978167 -2.010395
+v -2.127271 5.978167 -2.010395
+v -1.908670 5.978167 -2.228996
+v -2.127271 5.978167 -2.228996
+v -2.127271 4.523121 -3.000496
+v -1.908670 4.523121 -3.000496
+v -2.127271 4.741723 -2.990724
+v -1.908670 4.741723 -2.990724
+v -1.908670 4.523121 -1.238895
+v -2.127271 4.523121 -1.238895
+v -1.908670 4.741723 -1.248667
+v -2.127271 4.741723 -1.248667
+v -2.017970 5.567809 -1.922955
+v -1.870414 5.567809 -1.972140
+v -2.017970 6.121793 -1.972140
+v -2.165526 5.567809 -1.972140
+v -2.017970 4.829163 -1.922955
+v -1.821229 5.567809 -2.119696
+v -1.870414 5.567809 -2.267251
+v -1.870414 6.121793 -2.119696
+v -1.821229 4.829163 -2.119696
+v -2.017970 6.306454 -2.119696
+v -2.017970 6.121793 -2.267251
+v -2.165526 6.121793 -2.119696
+v -2.214711 5.567809 -2.119696
+v -2.165526 5.567809 -2.267251
+v -2.214711 4.829163 -2.119696
+v -2.017970 5.567809 -2.316437
+v -2.017970 4.829163 -2.316437
+v -2.017970 4.435681 -2.756189
+v -2.017970 4.484866 -3.086004
+v -1.870414 4.484866 -2.756189
+v -2.017970 4.435681 -2.316437
+v -2.165526 4.484866 -2.756189
+v -2.214711 4.632422 -2.756189
+v -2.165526 4.632422 -3.086004
+v -2.214711 4.632422 -2.316437
+v -2.165526 4.779978 -2.734202
+v -2.017970 4.632422 -3.195942
+v -2.017970 4.779978 -3.064016
+v -1.870414 4.632422 -3.086004
+v -1.821229 4.632422 -2.756189
+v -1.870414 4.779978 -2.734202
+v -1.821229 4.632422 -2.316437
+v -2.017970 4.829163 -2.668239
+v -2.116341 4.829163 -2.316437
+v -1.919600 4.829163 -2.316437
+v -2.017970 4.435681 -1.483202
+v -1.870414 4.484866 -1.483202
+v -2.017970 4.484866 -1.153388
+v -2.165526 4.484866 -1.483202
+v -2.017970 4.435681 -1.922955
+v -1.821229 4.632422 -1.483202
+v -1.870414 4.779978 -1.505190
+v -1.870414 4.632422 -1.153388
+v -1.821229 4.632422 -1.922955
+v -2.017970 4.632422 -1.043449
+v -2.017970 4.779978 -1.175375
+v -2.165526 4.632422 -1.153388
+v -2.214711 4.632422 -1.483202
+v -2.165526 4.779978 -1.505190
+v -2.214711 4.632422 -1.922955
+v -2.017970 4.829163 -1.571153
+v -1.919600 4.829163 -1.922955
+v -2.116341 4.829163 -1.922955
+v -2.145140 1.194092 -2.004379
+v -1.894884 1.194092 -2.004379
+v -2.145140 4.476328 -2.004379
+v -1.894884 4.476328 -2.004379
+v -2.145140 4.476328 -2.254635
+v -1.894884 4.476328 -2.254635
+v -2.145140 1.194092 -2.254635
+v -1.894884 1.194092 -2.254635
+v -2.020800 1.194092 -1.837458
+v -2.020800 1.194092 -2.421667
+v -2.020800 4.476328 -2.421667
+v -2.020800 4.476328 -1.837458
+v -2.020800 0.395449 -2.130295
+v -2.020012 0.395449 -2.129507
+v -2.020800 0.395449 -2.128719
+vt 0.375000 0.175791
+vt 0.375000 0.183595
+vt 0.375000 0.191400
+vt 0.250000 0.191400
+vt 0.125000 0.191400
+vt 0.125000 0.183595
+vt 0.125000 0.175791
+vt 0.875000 0.175791
+vt 0.875000 0.183595
+vt 0.875000 0.191400
+vt 0.750000 0.191400
+vt 0.625000 0.191400
+vt 0.625000 0.183595
+vt 0.625000 0.175791
+vt 0.500000 0.191400
+vt 0.562500 0.191400
+vt 0.625000 0.220700
+vt 0.500000 0.220700
+vt 0.875000 0.220700
+vt 0.750000 0.220700
+vt 0.375000 0.375000
+vt 0.375000 0.250000
+vt 0.500000 0.273925
+vt 0.500000 0.375000
+vt 0.375000 0.220700
+vt 0.250000 0.220700
+vt 0.375000 0.529300
+vt 0.375000 0.500000
+vt 0.500000 0.476075
+vt 0.500000 0.529300
+vt -1.#IND00 -1.#IND00
+vt 0.375000 0.000000
+vt 0.500000 0.000000
+vt 0.500000 0.051075
+vt -1.#IND00 -1.#IND00
+vt 0.125000 0.000000
+vt 0.250000 0.000000
+vt -1.#IND00 -1.#IND00
+vt 0.375000 0.875000
+vt 0.375000 0.750000
+vt 0.500000 0.765928
+vt 0.500000 0.875000
+vt -1.#IND00 -1.#IND00
+vt 0.625000 0.000000
+vt 0.750000 0.000000
+vt -1.#IND00 -1.#IND00
+vt 0.562500 0.647850
+vt 0.625000 0.647850
+vt 0.625000 0.698925
+vt 0.500000 0.688710
+vt 0.500000 0.147850
+vt 0.625000 0.147850
+vt -1.#IND00 -1.#IND00
+vt 0.500000 0.198925
+vt -1.#IND00 -1.#IND00
+vt -1.#IND00 -1.#IND00
+vt -1.#IND00 -1.#IND00
+vt -1.#IND00 -1.#IND00
+vt 0.375000 0.375000
+vt 0.375000 0.250000
+vt 0.500000 0.268481
+vt 0.500000 0.375000
+vt -1.#IND00 -1.#IND00
+vt 0.375000 0.147850
+vt -1.#IND00 -1.#IND00
+vt -1.#IND00 -1.#IND00
+vt 0.375000 0.551075
+vt 0.375000 0.500000
+vt 0.500000 0.484072
+vt 0.500000 0.561290
+vt 0.375000 0.102150
+vt 0.625000 0.138970
+vt 0.500000 0.161821
+vt 0.625000 0.250000
+vt 0.437500 0.191400
+vt 0.875000 0.250000
+vt 0.750000 0.250000
+vt 0.625000 0.375000
+vt 0.625000 0.500000
+vt 0.250000 0.250000
+vt 0.125000 0.250000
+vt 0.125000 0.220700
+vt 0.625000 0.529300
+vt 0.625000 0.558600
+vt 0.562500 0.558600
+vt 0.500000 0.558600
+vt 0.437500 0.558600
+vt 0.375000 0.558600
+vt 0.625000 0.102150
+vt 0.500000 0.102150
+vt -1.#IND00 -1.#IND00
+vt -1.#IND00 -1.#IND00
+vt 0.625000 0.750000
+vt 0.625000 0.875000
+vt 0.625000 1.000000
+vt 0.500000 1.000000
+vt 0.375000 1.000000
+vt 0.875000 0.000000
+vt -1.#IND00 -1.#IND00
+vt -1.#IND00 -1.#IND00
+vt -1.#IND00 -1.#IND00
+vt 0.375000 0.698925
+vt 0.375000 0.647850
+vt 0.437500 0.647850
+vt 0.500000 0.647850
+vt 0.625000 0.250000
+vt 0.875000 0.250000
+vt 0.750000 0.250000
+vt 0.625000 0.375000
+vt 0.625000 0.500000
+vt 0.250000 0.250000
+vt 0.125000 0.250000
+vt -1.#IND00 -1.#IND00
+vt -1.#IND00 -1.#IND00
+vt 0.625000 0.551075
+vt 0.625000 0.602150
+vt 0.562500 0.602150
+vt 0.500000 0.602150
+vt 0.437500 0.602150
+vt 0.375000 0.602150
+vt 0.499213 0.250000
+vt 0.499213 0.000000
+vt 0.625000 0.000000
+vt 0.625000 0.250000
+vt 0.499213 0.500000
+vt 0.625000 0.500000
+vt 0.499213 0.750000
+vt 0.625000 0.750000
+vt 0.500000 0.875471
+vt 0.499213 0.875361
+vt 0.499213 0.874686
+vt 0.875000 0.000000
+vt 0.875000 0.250000
+vt 0.125000 0.000000
+vt 0.375000 0.000000
+vt 0.375000 0.250000
+vt 0.125000 0.250000
+vt 0.375000 0.750000
+vt 0.375000 1.000000
+vt 0.375000 0.500000
+vt 0.625000 1.000000
+vt 0.499213 1.000000
+vn -0.706849 -0.706849 0.027027
+vn -0.999778 -0.000000 0.021082
+vn -0.916167 0.161747 0.366710
+vn -0.999853 0.017156 0.000000
+vn -0.916167 0.161747 -0.366710
+vn -0.999778 0.000000 -0.021082
+vn -0.706848 -0.706849 -0.027027
+vn 0.706849 -0.706848 -0.027027
+vn 0.999778 -0.000000 -0.021082
+vn 0.916167 0.161747 -0.366710
+vn 0.999853 0.017156 0.000000
+vn 0.916167 0.161747 0.366710
+vn 0.999778 0.000000 0.021082
+vn 0.706849 -0.706848 0.027027
+vn 0.000000 0.296282 0.955101
+vn 0.165279 0.343682 0.924427
+vn 0.705454 0.068331 0.705454
+vn -0.000000 0.059769 0.998212
+vn 0.705454 0.068331 -0.705454
+vn 0.998212 0.059770 0.000000
+vn -0.926131 0.377203 0.000000
+vn -0.699145 0.149633 0.699147
+vn -0.000000 0.377204 0.926130
+vn -0.000000 1.000000 -0.000000
+vn -0.705454 0.068331 0.705454
+vn -0.998212 0.059770 0.000000
+vn -0.705454 0.068331 -0.705454
+vn -0.699146 0.149633 -0.699146
+vn 0.000000 0.377204 -0.926130
+vn -0.000000 0.059769 -0.998212
+vn -0.702552 -0.702552 -0.113318
+vn -0.680278 -0.680278 -0.272843
+vn -0.000000 -0.871334 -0.490690
+vn 0.000000 -0.995011 -0.099770
+vn -0.764530 0.632514 -0.124178
+vn -0.647141 0.717488 -0.257720
+vn -0.867188 0.029145 -0.497127
+vn -0.994694 0.006104 -0.102697
+vn -0.000000 0.901897 -0.431952
+vn 0.000000 0.041614 -0.999134
+vn 0.702553 -0.702552 -0.113318
+vn 0.680279 -0.680278 -0.272842
+vn 0.867188 0.029145 -0.497127
+vn 0.994694 0.006104 -0.102697
+vn 0.165279 0.343682 -0.924427
+vn 0.764531 0.632513 -0.124177
+vn -0.000000 0.994023 -0.109172
+vn 0.000000 -0.999780 0.020984
+vn 0.702552 -0.702552 0.113318
+vn 0.000000 -0.995011 0.099770
+vn 0.764531 0.632513 0.124177
+vn 0.994694 0.006104 0.102697
+vn -0.867188 0.029145 0.497128
+vn -0.680278 -0.680278 0.272843
+vn -0.000000 -0.871334 0.490690
+vn -0.000000 0.041614 0.999134
+vn -0.702552 -0.702552 0.113318
+vn -0.994694 0.006104 0.102697
+vn -0.764530 0.632514 0.124178
+vn -0.647140 0.717488 0.257721
+vn -0.000000 0.901897 0.431952
+vn 0.000000 0.994023 0.109172
+vn 0.000000 -0.999780 -0.020984
+vn 0.699145 0.149633 0.699147
+vn -0.165279 0.343682 0.924427
+vn 0.699146 0.149633 -0.699145
+vn 0.926130 0.377204 -0.000000
+vn -0.000000 0.296282 -0.955101
+vn -0.165279 0.343682 -0.924427
+vn 0.647141 0.717488 -0.257720
+vn 0.680279 -0.680278 0.272842
+vn 0.647141 0.717488 0.257720
+vn 0.867188 0.029145 0.497128
+vn 0.000000 0.000000 1.000000
+vn 0.000000 0.000000 1.000000
+vn 0.798332 0.000000 0.602218
+vn 0.798332 0.000000 0.602218
+vn 0.000000 1.000000 0.000000
+vn 0.000000 1.000000 0.000000
+vn 0.000000 1.000000 0.000000
+vn 0.000000 1.000000 0.000000
+vn -0.000000 0.000000 -1.000000
+vn -0.000000 0.000000 -1.000000
+vn 0.798524 0.000000 -0.601963
+vn 0.798524 0.000000 -0.601963
+vn 0.967785 -0.251777 0.000042
+vn -0.485721 -0.462486 0.741742
+vn -0.485344 -0.462668 -0.741875
+vn 1.000000 0.000000 0.000000
+vn 1.000000 0.000000 0.000000
+vn 1.000000 0.000000 0.000000
+vn 1.000000 0.000000 0.000000
+vn -1.000000 0.000000 0.000000
+vn -1.000000 0.000000 0.000000
+vn -1.000000 0.000000 0.000000
+vn -1.000000 0.000000 0.000000
+vn -0.935019 -0.191988 -0.298128
+vn -0.934995 -0.191995 0.298198
+vn -0.802147 0.000000 -0.597126
+vn -0.802147 0.000000 -0.597126
+vn 0.000000 1.000000 0.000000
+vn 0.000000 1.000000 0.000000
+vn -0.801957 0.000000 0.597382
+vn -0.801957 0.000000 0.597382
+vn 0.003575 -0.342600 -0.939475
+vn 0.932888 -0.193820 -0.303570
+vn 0.932863 -0.193827 0.303641
+vn 0.003576 -0.342485 0.939516
+s 1
+g polySurface10
+usemtl pasted__lambert5SG2
+f 1/1/1 70/2/2 2/3/3 35/4/4 3/5/5 45/6/6 4/7/7
+f 5/8/8 52/9/9 6/10/10 29/11/11 7/12/12 64/13/13 8/14/14
+f 25/15/15 72/16/16 7/12/12 22/17/17 21/18/18
+f 29/11/11 6/10/10 27/19/19 26/20/20
+f 32/21/21 10/22/22 23/23/23 30/24/24
+f 35/4/4 2/3/3 24/25/25 33/26/26
+f 34/27/27 12/28/28 31/29/29 36/30/30
+f 42/31/31 13/32/32 39/33/33 38/34/34
+f 46/35/35 15/36/36 44/37/37 43/38/38
+f 44/39/37 15/40/36 48/41/39 47/42/40
+f 40/43/41 14/44/42 49/45/43 50/46/44
+f 55/47/45 6/48/10 51/49/46 53/50/47
+f 60/51/48 8/52/14 57/53/49 56/54/50
+f 64/55/13 7/56/12 62/57/51 61/58/52
+f 67/59/53 18/60/54 58/61/55 65/62/56
+f 70/63/2 1/64/1 59/65/57 68/66/58
+f 69/67/59 20/68/60 66/69/61 71/70/62
+f 1/1/1 4/71/7 41/72/63 5/8/8 8/52/14 60/73/48
+f 22/17/17 9/74/64 23/23/23 21/18/18
+f 23/23/23 10/22/22 24/25/25 21/18/18
+f 24/25/25 2/3/3 73/75/65 25/15/15 21/18/18
+f 27/19/19 11/76/66 28/77/67 26/20/20
+f 28/77/67 9/74/64 22/17/17 26/20/20
+f 22/17/17 7/12/12 29/11/11 26/20/20
+f 23/23/23 9/74/64 28/78/67 30/24/24
+f 28/78/67 11/79/66 31/29/29 30/24/24
+f 31/29/29 12/28/28 32/21/21 30/24/24
+f 24/25/25 10/22/22 32/80/21 33/26/26
+f 32/80/21 12/81/28 34/82/27 33/26/26
+f 34/82/27 3/5/5 35/4/4 33/26/26
+f 31/29/29 11/79/66 27/83/19 36/30/30
+f 27/83/19 6/84/10 55/85/45 37/86/68 36/30/30
+f 37/86/68 54/87/69 3/88/5 34/27/27 36/30/30
+f 39/33/33 14/44/42 40/43/41 38/34/34
+f 40/43/41 5/89/8 41/90/63 38/34/34
+f 41/90/63 4/71/7 42/31/31 38/34/34
+f 44/37/37 13/32/32 42/31/31 43/38/38
+f 42/31/31 4/71/7 45/91/6 43/38/38
+f 45/91/6 3/92/5 46/35/35 43/38/38
+f 48/41/39 16/93/70 49/94/43 47/42/40
+f 49/94/43 14/95/42 39/96/33 47/42/40
+f 39/96/33 13/97/32 44/39/37 47/42/40
+f 49/45/43 16/98/70 51/99/46 50/46/44
+f 51/99/46 6/100/10 52/101/9 50/46/44
+f 52/101/9 5/89/8 40/43/41 50/46/44
+f 51/49/46 16/93/70 48/41/39 53/50/47
+f 48/41/39 15/40/36 46/102/35 53/50/47
+f 46/102/35 3/103/5 54/104/69 53/50/47
+f 54/104/69 37/105/68 55/47/45 53/50/47
+f 57/53/49 17/106/71 58/61/55 56/54/50
+f 58/61/55 18/60/54 59/65/57 56/54/50
+f 59/65/57 1/64/1 60/51/48 56/54/50
+f 62/57/51 19/107/72 63/108/73 61/58/52
+f 63/108/73 17/106/71 57/53/49 61/58/52
+f 57/53/49 8/52/14 64/55/13 61/58/52
+f 58/61/55 17/106/71 63/109/73 65/62/56
+f 63/109/73 19/110/72 66/69/61 65/62/56
+f 66/69/61 20/68/60 67/59/53 65/62/56
+f 59/65/57 18/60/54 67/111/53 68/66/58
+f 67/111/53 20/112/60 69/113/59 68/66/58
+f 69/113/59 2/114/3 70/63/2 68/66/58
+f 66/69/61 19/110/72 62/115/51 71/70/62
+f 62/115/51 7/116/12 72/117/16 71/70/62
+f 72/117/16 25/118/15 73/119/65 71/70/62
+f 73/119/65 2/120/3 69/67/59 71/70/62
+s 10
+usemtl pasted__lambert4SG2
+f 85/121/74 82/122/75 75/123/76 77/124/77
+s 11
+f 84/125/78 85/121/79 77/124/80 79/126/81
+s 12
+f 83/127/82 84/125/83 79/126/84 81/128/85
+s 13
+f 87/129/86 88/130/87 86/131/88
+s off
+f 75/123/89 81/132/90 79/133/91 77/124/92
+f 80/134/93 74/135/94 76/136/95 78/137/96
+s 13
+f 80/138/97 86/131/88 88/130/87 74/139/98
+s 12
+f 78/140/99 84/125/83 83/127/82 80/138/100
+s 11
+f 76/136/101 85/121/79 84/125/78 78/140/102
+s 10
+f 74/135/103 82/122/75 85/121/74 76/136/104
+s 13
+f 80/138/97 83/127/105 86/131/88
+f 81/128/106 87/129/86 86/131/88 83/127/105
+f 75/141/107 87/129/86 81/128/106
+f 82/142/108 88/130/87 87/129/86 75/141/107
+f 74/139/98 88/130/87 82/142/108

BIN
models/weapons/ZwaardMetTextures2/ZWAARD.png


+ 2 - 2
weapons.json

@@ -4,7 +4,7 @@
       "name": "Fire reaper",
       "damage": 1,
       "element": "fire",
-      "file": "models/weapons/ZwaardMetTextures/TextureZwaard.obj",
+      "file": "models/weapons/ZwaardMetTextures2/TextureZwaard.obj",
 
       "anchor": [ -2.0, 6.0, -2.1 ],
       "collision": [ 0, 0, 0 ],
@@ -21,7 +21,7 @@
     {
       "name": "Ice breaker",
       "damage": 2,
-      "element": "ice",
+      "element": "water",
       "file": "models/weapons/ZwaardMetTextures/TextureZwaard.obj",
 
       "anchor": [ -2.0, 6.0, -2.1 ],

+ 6 - 6
worlds/rock.json

@@ -3,7 +3,7 @@
     "heightmap": "worlds/rockHeightmap.png",
     "texture": "worlds/rockStone2.png",
 	"skybox": "skyboxes/water/",
-	"music":  "WAVE/test2.wav",
+	"music":  "WAVE/world1.wav",
     "object-templates": [
       {
         "color": 50,
@@ -83,7 +83,7 @@
     ]
   },
   "player": {
-    "startposition": [ 1, 5, 20 ]
+    "startposition": [ 20, 5, 20 ]
   },
   "objects": [ ],
   "portal": {     
@@ -92,10 +92,10 @@
   },
   "enemies": [
   {
-      "file": "models/squid/Blooper.obj",
-      "pos": [ 20, 5, 10 ],
-      "scale": 0.01,
-      "music": "WAVE/enemy.wav"
+	"file": "models/squid/Blooper.obj",
+	"pos": [ 30, 10, 10 ],
+	"scale": 0.01,
+	"music": "WAVE/ghostEnemy.wav"
   }],
   "crystal": {
     "full texture": "models/crystal/Crystal.obj",

+ 4 - 4
worlds/small.json

@@ -9,7 +9,7 @@
         "collision": true
       }
     ],
-	"music": "WAVE/test1.wav"
+	"music": "WAVE/world1.wav"
   },
   "player": {
     "startposition": [ 20, 0, 20 ]
@@ -24,7 +24,7 @@
       "file": "models/squid/Blooper.obj",
       "pos": [ 20, 5, 10 ],
       "scale": 0.01,
-      "music": "WAVE/enemy.wav",
+      "music": "WAVE/ghostEnemy.wav",
       "health": 10,
       "damage": 2
     },
@@ -32,13 +32,13 @@
       "file": "models/squid/Blooper.obj",
       "pos": [ 30, 10, 10 ],
       "scale": 0.01,
-      "music": "WAVE/enemy.wav",
+      "music": "WAVE/ghostEnemy.wav",
       "health": 15,
       "damage": 2
   }],
   "crystal": {
     "full texture": "models/crystal/Crystal.obj",
-    "empty texture": "models/crystal/PickedUpCrystal.obj",
+	"empty texture": "models/crystal/PickedUpCrystal.obj",
     "instances": [
       {
         "pos": [ 31, 5, 33 ],