diff --git a/CrystalPoint.cpp b/CrystalPoint.cpp
index 8e9c54b..6b59afd 100644
--- a/CrystalPoint.cpp
+++ b/CrystalPoint.cpp
@@ -68,15 +68,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'])
@@ -144,9 +147,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
diff --git a/CrystalPoint.vcxproj b/CrystalPoint.vcxproj
index e9dff21..6435a83 100644
--- a/CrystalPoint.vcxproj
+++ b/CrystalPoint.vcxproj
@@ -222,6 +222,7 @@
+
diff --git a/CrystalPoint.vcxproj.filters b/CrystalPoint.vcxproj.filters
index 902a3bc..84737cb 100644
--- a/CrystalPoint.vcxproj.filters
+++ b/CrystalPoint.vcxproj.filters
@@ -238,6 +238,9 @@
Source Files\json
+
+ Source Files\json
+
diff --git a/Enemy.cpp b/Enemy.cpp
index 42e5019..b16231a 100644
--- a/Enemy.cpp
+++ b/Enemy.cpp
@@ -6,6 +6,8 @@
Enemy::Enemy(const std::string &fileName,
const std::string &fileMusic,
+ float damage,
+ float health,
const Vec3f &position,
const Vec3f &rotation,
const float &scale)
@@ -18,7 +20,11 @@ Enemy::Enemy(const std::string &fileName,
target = position;
speed = 1;
radius = 10;
- xp = 10;
+
+ xp = health;
+ this->health = health;
+ this->damage = damage;
+
hasTarget = false;
hit_sound_id = CrystalPoint::GetSoundSystem().LoadSound(fileMusic.c_str(), false);
music = CrystalPoint::GetSoundSystem().GetSound(hit_sound_id);
diff --git a/Enemy.h b/Enemy.h
index 61ab4f4..eb503b4 100644
--- a/Enemy.h
+++ b/Enemy.h
@@ -8,7 +8,7 @@
class Enemy : public Entity
{
public:
- Enemy(const std::string &fileName, const std::string &fileMusic, const Vec3f &position, const Vec3f &rotation, const float &scale);
+ Enemy(const std::string &fileName, const std::string &fileMusic, float damage, float health, const Vec3f &position, const Vec3f &rotation, const float &scale);
~Enemy();
Sound* music;
@@ -16,6 +16,8 @@ public:
bool hasTarget;
Vec3f target;
float speed,radius;
+ float health;
+ float damage;
int xp;
bool attack;
diff --git a/Interface.cpp b/Interface.cpp
index db016ee..297a743 100644
--- a/Interface.cpp
+++ b/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);
diff --git a/Player.cpp b/Player.cpp
index 303a9d4..54888ad 100644
--- a/Player.cpp
+++ b/Player.cpp
@@ -3,6 +3,10 @@
#include "Player.h"
#include
+#include
+#include
+#include
+
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), 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), 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];
}
\ No newline at end of file
diff --git a/Player.h b/Player.h
index 8d171d4..b843153 100644
--- a/Player.h
+++ b/Player.h
@@ -1,12 +1,23 @@
#pragma once
#include "Vector.h"
#include "Weapon.h"
+#include "json.h"
+
+#include
class Player
{
private:
static Player* instance;
void levelUp();
+
+ std::vector leftweapons;
+ std::vector 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);
};
\ No newline at end of file
diff --git a/Weapon.cpp b/Weapon.cpp
index 7a26355..878433b 100644
--- a/Weapon.cpp
+++ b/Weapon.cpp
@@ -9,18 +9,25 @@
#include
-Weapon::Weapon(std::string modelFilename, float scale, Vec3f location, Vec2f rotation,
+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){
+ 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;
this->minRotation = minRotation;
+ this->collision = collision;
};
Weapon::~Weapon(){
diff --git a/Weapon.h b/Weapon.h
index 8d5e672..187b5b0 100644
--- a/Weapon.h
+++ b/Weapon.h
@@ -11,22 +11,28 @@
class Weapon {
public:
- Weapon(std::string modelFilename, float scale, Vec3f location, Vec2f rotation,
+ 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);
+ Vec2f maxRotation, Vec2f minXRotation,
+ Vec3f collision);
~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;
Vec3f position, rotation, rotationWeapon;
- Vec3f offsetPlayer, ankerPoint;
+ Vec3f offsetPlayer, ankerPoint, collision;
Vec2f maxRotation, minRotation;
};
diff --git a/World.cpp b/World.cpp
index ebf2d52..0803c32 100644
--- a/World.cpp
+++ b/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"])
@@ -126,12 +126,20 @@ World::World(const std::string &fileName)
if (e["music"].isNull())
std::cout << "Invalid world file: enemies music - " << fileName << "\n";
+ //Damage
+ if (e["damage"].isNull())
+ std::cout << "Invalid world file: enemies damage - " << fileName << "\n";
+
+ //Health
+ if (e["health"].isNull())
+ std::cout << "Invalid world file: enemies health - " << fileName << "\n";
+
//Create
Vec3f position(e["pos"][0].asFloat(), e["pos"][1].asFloat(), e["pos"][2].asFloat());
position.y = getHeight(position.x, position.z) + 2.0f;
maxEnemies++;
- enemies.push_back(new Enemy(e["file"].asString(), e["music"].asString(), position, rotation, scale));
+ enemies.push_back(new Enemy(e["file"].asString(), e["music"].asString(), e["damage"].asFloat(), e["health"].asFloat(), position, rotation, scale));
}
maxCrystals = 0;
if (!v["crystal"].isNull())
diff --git a/models/weapons/ZwaardMetTextures2/HANDVAT.png b/models/weapons/ZwaardMetTextures2/HANDVAT.png
new file mode 100644
index 0000000..d0c80d6
Binary files /dev/null and b/models/weapons/ZwaardMetTextures2/HANDVAT.png differ
diff --git a/models/weapons/ZwaardMetTextures2/TextureZwaard.mtl b/models/weapons/ZwaardMetTextures2/TextureZwaard.mtl
new file mode 100644
index 0000000..6328409
--- /dev/null
+++ b/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
diff --git a/models/weapons/ZwaardMetTextures2/TextureZwaard.obj b/models/weapons/ZwaardMetTextures2/TextureZwaard.obj
new file mode 100644
index 0000000..88776bb
--- /dev/null
+++ b/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
diff --git a/models/weapons/ZwaardMetTextures2/ZWAARD.png b/models/weapons/ZwaardMetTextures2/ZWAARD.png
new file mode 100644
index 0000000..7d6f597
Binary files /dev/null and b/models/weapons/ZwaardMetTextures2/ZWAARD.png differ
diff --git a/weapons.json b/weapons.json
new file mode 100644
index 0000000..77177a9
--- /dev/null
+++ b/weapons.json
@@ -0,0 +1,40 @@
+{
+ "weapons": [
+ {
+ "name": "Fire reaper",
+ "damage": 1,
+ "element": "fire",
+ "file": "models/weapons/ZwaardMetTextures2/TextureZwaard.obj",
+
+ "anchor": [ -2.0, 6.0, -2.1 ],
+ "collision": [ 0, 0, 0 ],
+ "maxRotation": [ 170, 70 ],
+ "minRotation": [ 20, -80 ],
+
+ "left": {
+ "offset": [ 4.5, -8, -1 ]
+ },
+ "right": {
+ "offset": [ 0.5, -8, -1 ]
+ }
+ },
+ {
+ "name": "Ice breaker",
+ "damage": 2,
+ "element": "water",
+ "file": "models/weapons/ZwaardMetTextures/TextureZwaard.obj",
+
+ "anchor": [ -2.0, 6.0, -2.1 ],
+ "collision": [ 0, 0, 0 ],
+ "maxRotation": [ 170, 70 ],
+ "minRotation": [ 20, -80 ],
+
+ "left": {
+ "offset": [ 4.5, -8, -1 ]
+ },
+ "right": {
+ "offset": [ 0.5, -8, -1 ]
+ }
+ }
+ ]
+}
\ No newline at end of file
diff --git a/worlds/rock.json b/worlds/rock.json
index a62b3c0..ca70643 100644
--- a/worlds/rock.json
+++ b/worlds/rock.json
@@ -83,7 +83,7 @@
]
},
"player": {
- "startposition": [ 1, 5, 20 ]
+ "startposition": [ 20, 5, 20 ]
},
"objects": [ ],
"portal": {
diff --git a/worlds/small.json b/worlds/small.json
index fbec10a..e703390 100644
--- a/worlds/small.json
+++ b/worlds/small.json
@@ -12,7 +12,7 @@
"music": "WAVE/test1.wav"
},
"player": {
- "startposition": [ 20, 5, 20 ]
+ "startposition": [ 20, 0, 20 ]
},
"objects": [ ],
"portal": {
@@ -24,13 +24,17 @@
"file": "models/squid/Blooper.obj",
"pos": [ 20, 5, 10 ],
"scale": 0.01,
- "music": "WAVE/enemy.wav"
+ "music": "WAVE/enemy.wav",
+ "health": 10,
+ "damage": 2
},
{
"file": "models/squid/Blooper.obj",
"pos": [ 30, 10, 10 ],
"scale": 0.01,
- "music": "WAVE/enemy.wav"
+ "music": "WAVE/enemy.wav",
+ "health": 15,
+ "damage": 2
}],
"crystal": {
"full texture": "models/crystal/Crystal.obj",