1 Commits

Author SHA1 Message Date
Stiffly 965cebf708 WIP 2015-10-23 16:44:37 +02:00
13 changed files with 103 additions and 140 deletions
+17 -17
View File
@@ -5,8 +5,8 @@
<author>Blender User</author>
<authoring_tool>Blender 2.75.0 commit date:2015-07-07, commit time:14:56, hash:c27589e</authoring_tool>
</contributor>
<created>2015-10-23T16:10:27</created>
<modified>2015-10-23T16:10:27</modified>
<created>2015-10-23T14:55:47</created>
<modified>2015-10-23T14:55:47</modified>
<unit name="meter" meter="1"/>
<up_axis>Z_UP</up_axis>
</asset>
@@ -157,7 +157,7 @@
</technique_common>
</source>
<source id="Armature_002_Head_pose_matrix-output">
<float_array id="Armature_002_Head_pose_matrix-output-array" count="32">2.8213e-7 0 -1 0 0 -0.9999999 0 -0.305899 -1 0 -2.8213e-7 0 0 0 0 1 2.8213e-7 0 -1 0 0 -0.6999999 0 -0.305899 -1 0 -2.8213e-7 0 0 0 0 1</float_array>
<float_array id="Armature_002_Head_pose_matrix-output-array" count="32">2.8213e-7 0 -1 0 0 -0.8 0 -0.305899 -1 0 -2.8213e-7 0 0 0 0 1 2.8213e-7 0 -1 0 0 -0.9999999 0 -0.305899 -1 0 -2.8213e-7 0 0 0 0 1</float_array>
<technique_common>
<accessor source="#Armature_002_Head_pose_matrix-output-array" count="2" stride="16">
<param name="TRANSFORM" type="float4x4"/>
@@ -189,7 +189,7 @@
</technique_common>
</source>
<source id="Armature_002_Ear_L_pose_matrix-output">
<float_array id="Armature_002_Ear_L_pose_matrix-output-array" count="32">-4.53842e-7 0.6170548 0.7869204 0.1847505 1.46037e-7 -0.7869204 0.6170546 1.127367 1 8.9407e-8 2.73509e-7 -0.002287612 0 0 0 1 -4.39136e-7 0.5461221 0.8377058 0.1847505 1.58507e-7 -0.8377059 0.5461219 1.127367 1 6.76434e-8 2.61131e-7 -0.002287612 0 0 0 1</float_array>
<float_array id="Armature_002_Ear_L_pose_matrix-output-array" count="32">-4.53842e-7 0.6170548 0.7869204 0.1847505 1.46037e-7 -0.7869205 0.6170546 1.127367 1 8.9407e-8 2.73509e-7 -0.002287612 0 0 0 1 -4.39136e-7 0.5461221 0.8377058 0.1847505 1.58507e-7 -0.8377059 0.5461219 1.127367 1 6.76434e-8 2.61131e-7 -0.002287612 0 0 0 1</float_array>
<technique_common>
<accessor source="#Armature_002_Ear_L_pose_matrix-output-array" count="2" stride="16">
<param name="TRANSFORM" type="float4x4"/>
@@ -221,7 +221,7 @@
</technique_common>
</source>
<source id="Armature_002_Ear_H_pose_matrix-output">
<float_array id="Armature_002_Ear_H_pose_matrix-output-array" count="32">-6.18379e-7 -0.6170548 -0.7869204 -0.1847505 3.71728e-7 -0.7869204 0.6170546 1.127367 -1 -2.08617e-7 7.33482e-7 -0.0022877 0 0 0 1 -6.46627e-7 -0.5461221 -0.8377058 -0.1847505 3.06338e-7 -0.8377059 0.5461219 1.127367 -1 -2.01547e-7 7.00461e-7 -0.0022877 0 0 0 1</float_array>
<float_array id="Armature_002_Ear_H_pose_matrix-output-array" count="32">-6.18379e-7 -0.6170548 -0.7869204 -0.1847505 3.71728e-7 -0.7869205 0.6170546 1.127367 -1 -2.08617e-7 7.33482e-7 -0.0022877 0 0 0 1 -6.46627e-7 -0.5461221 -0.8377058 -0.1847505 3.06338e-7 -0.8377059 0.5461219 1.127367 -1 -2.01547e-7 7.00461e-7 -0.0022877 0 0 0 1</float_array>
<technique_common>
<accessor source="#Armature_002_Ear_H_pose_matrix-output-array" count="2" stride="16">
<param name="TRANSFORM" type="float4x4"/>
@@ -637,7 +637,7 @@
</technique_common>
</source>
<source id="Armature_002_Arm1_L_pose_matrix-output">
<float_array id="Armature_002_Arm1_L_pose_matrix-output-array" count="32">-3.13422e-8 6.23634e-9 -1 3.93099e-4 0.08979136 0.9959605 3.39689e-9 -0.2065513 0.9959606 -0.08979137 -3.17755e-8 -0.170607 0 0 0 1 -4.93163e-8 0.08715574 -0.9961947 3.93099e-4 -6.54522e-8 0.9961947 0.08715573 -0.2065513 1 6.95013e-8 -4.34241e-8 -0.170607 0 0 0 1</float_array>
<float_array id="Armature_002_Arm1_L_pose_matrix-output-array" count="32">-4.37114e-8 0 -1 3.93099e-4 -6.29212e-8 0.9999999 7.10543e-15 -0.2065513 1 6.29212e-8 -4.37114e-8 -0.170607 0 0 0 1 -4.93163e-8 0.08715574 -0.9961947 3.93099e-4 -6.54522e-8 0.9961947 0.08715573 -0.2065513 1 6.95013e-8 -4.34241e-8 -0.170607 0 0 0 1</float_array>
<technique_common>
<accessor source="#Armature_002_Arm1_L_pose_matrix-output-array" count="2" stride="16">
<param name="TRANSFORM" type="float4x4"/>
@@ -669,7 +669,7 @@
</technique_common>
</source>
<source id="Armature_002_Arm2_L_pose_matrix-output">
<float_array id="Armature_002_Arm2_L_pose_matrix-output-array" count="32">0.9647611 -0.2631273 1.49274e-7 0 0.2631273 0.9647611 4.47035e-8 0.2368225 -1.58325e-7 0 1 3.72529e-9 0 0 0 1 1 -5.99114e-8 1.13846e-7 0 4.97611e-8 0.9961947 0.08715574 0.2368225 -1.18635e-7 -0.08715574 0.9961947 3.72529e-9 0 0 0 1</float_array>
<float_array id="Armature_002_Arm2_L_pose_matrix-output-array" count="32">1 -6.29212e-8 1.19209e-7 0 6.29212e-8 1 0 0.2368225 -1.19209e-7 0 1 3.72529e-9 0 0 0 1 1 -5.99114e-8 1.13846e-7 0 4.97611e-8 0.9961947 0.08715574 0.2368225 -1.18635e-7 -0.08715574 0.9961947 3.72529e-9 0 0 0 1</float_array>
<technique_common>
<accessor source="#Armature_002_Arm2_L_pose_matrix-output-array" count="2" stride="16">
<param name="TRANSFORM" type="float4x4"/>
@@ -701,7 +701,7 @@
</technique_common>
</source>
<source id="Armature_002_Arm3_L_pose_matrix-output">
<float_array id="Armature_002_Arm3_L_pose_matrix-output-array" count="32">0.9018104 -0.432132 9.99244e-8 1.49012e-8 0.432132 0.9018103 1.04308e-7 0.2368225 -1.41561e-7 -4.47035e-8 0.9999999 -1.49012e-8 0 0 0 1 1 -4.9761e-8 6.34957e-8 1.49012e-8 4.40376e-8 0.9961946 0.08715574 0.2368225 -6.75911e-8 -0.08715576 0.9961947 -1.49012e-8 0 0 0 1</float_array>
<float_array id="Armature_002_Arm3_L_pose_matrix-output-array" count="32">1 -6.29212e-8 6.29211e-8 1.49012e-8 6.29212e-8 0.9999999 0 0.2368225 -6.29211e-8 -1.49012e-8 0.9999999 -1.49012e-8 0 0 0 1 1 -4.9761e-8 6.34957e-8 1.49012e-8 4.40376e-8 0.9961946 0.08715574 0.2368225 -6.75911e-8 -0.08715576 0.9961947 -1.49012e-8 0 0 0 1</float_array>
<technique_common>
<accessor source="#Armature_002_Arm3_L_pose_matrix-output-array" count="2" stride="16">
<param name="TRANSFORM" type="float4x4"/>
@@ -733,7 +733,7 @@
</technique_common>
</source>
<source id="Armature_002_Arm4_L_pose_matrix-output">
<float_array id="Armature_002_Arm4_L_pose_matrix-output-array" count="32">0.9406103 -0.3394882 -2.46615e-8 0 0.3394883 0.9406103 8.9407e-8 0.2368228 1.49012e-8 -8.9407e-8 1 1.49012e-8 0 0 0 1 1 9.28881e-8 -4.82035e-8 0 -8.91413e-8 0.9848078 0.1736482 0.2368228 6.52151e-8 -0.1736482 0.9848078 1.49012e-8 0 0 0 1</float_array>
<float_array id="Armature_002_Arm4_L_pose_matrix-output-array" count="32">1 5.68864e-8 -6.13071e-8 0 -6.29211e-8 1 2.98023e-8 0.2368228 6.29211e-8 0 1 1.49012e-8 0 0 0 1 1 9.28881e-8 -4.82035e-8 0 -8.91413e-8 0.9848078 0.1736482 0.2368228 6.52151e-8 -0.1736482 0.9848078 1.49012e-8 0 0 0 1</float_array>
<technique_common>
<accessor source="#Armature_002_Arm4_L_pose_matrix-output-array" count="2" stride="16">
<param name="TRANSFORM" type="float4x4"/>
@@ -765,7 +765,7 @@
</technique_common>
</source>
<source id="Armature_002_UpperHand_L_pose_matrix-output">
<float_array id="Armature_002_UpperHand_L_pose_matrix-output-array" count="32">0.9033983 -0.4288025 -1.74397e-7 0 0.4288025 0.9033982 -2.98023e-8 0.2368225 1.78814e-7 2.98023e-8 1 0 0 0 0 1 1 4.21468e-8 -2.34937e-7 0 2.99004e-8 0.9396926 0.3420201 0.2368225 2.33146e-7 -0.3420201 0.9396927 0 0 0 0 1</float_array>
<float_array id="Armature_002_UpperHand_L_pose_matrix-output-array" count="32">1 -1.08477e-8 -2.40456e-7 0 3.55271e-15 0.9999999 0 0.2368225 2.38419e-7 2.98023e-8 1 0 0 0 0 1 1 4.21468e-8 -2.34937e-7 0 2.99004e-8 0.9396926 0.3420201 0.2368225 2.33146e-7 -0.3420201 0.9396927 0 0 0 0 1</float_array>
<technique_common>
<accessor source="#Armature_002_UpperHand_L_pose_matrix-output-array" count="2" stride="16">
<param name="TRANSFORM" type="float4x4"/>
@@ -797,7 +797,7 @@
</technique_common>
</source>
<source id="Armature_002_LowerHand_L_pose_matrix-output">
<float_array id="Armature_002_LowerHand_L_pose_matrix-output-array" count="32">0.8926221 -0.4508057 6.9957e-8 1.49012e-8 0.4508057 0.8926221 2.98023e-8 0.147557 -2.98023e-8 8.9407e-8 1 5.96046e-8 0 0 0 1 1 -1.51808e-8 -1.32815e-9 1.49012e-8 1.51808e-8 0.9848077 0.1736482 0.147557 -1.32815e-9 -0.1736482 0.9848077 5.96046e-8 0 0 0 1</float_array>
<float_array id="Armature_002_LowerHand_L_pose_matrix-output-array" count="32">1 3.55271e-15 0 1.49012e-8 3.55271e-15 0.9999999 2.98023e-8 0.147557 3.55271e-15 0 1 5.96046e-8 0 0 0 1 1 -1.51808e-8 -1.32815e-9 1.49012e-8 1.51808e-8 0.9848077 0.1736482 0.147557 -1.32815e-9 -0.1736482 0.9848077 5.96046e-8 0 0 0 1</float_array>
<technique_common>
<accessor source="#Armature_002_LowerHand_L_pose_matrix-output-array" count="2" stride="16">
<param name="TRANSFORM" type="float4x4"/>
@@ -829,7 +829,7 @@
</technique_common>
</source>
<source id="Armature_002_Arm1_R_pose_matrix-output">
<float_array id="Armature_002_Arm1_R_pose_matrix-output-array" count="32">-2.93183e-7 -2.30214e-8 -1 3.93073e-4 -0.08979136 0.9959605 3.39687e-9 -0.2065513 0.9959606 0.08979136 -2.94066e-7 0.170607 0 0 0 1 -2.86828e-7 -0.08715574 -0.9961947 3.93073e-4 4.46726e-8 0.9961947 -0.08715573 -0.2065513 1 -6.95013e-8 -2.81843e-7 0.170607 0 0 0 1</float_array>
<float_array id="Armature_002_Arm1_R_pose_matrix-output-array" count="32">-2.8213e-7 0 -1 3.93073e-4 6.29212e-8 0.9999999 -2.13163e-14 -0.2065513 1 -6.29212e-8 -2.8213e-7 0.170607 0 0 0 1 -2.86828e-7 -0.08715574 -0.9961947 3.93073e-4 4.46726e-8 0.9961947 -0.08715573 -0.2065513 1 -6.95013e-8 -2.81843e-7 0.170607 0 0 0 1</float_array>
<technique_common>
<accessor source="#Armature_002_Arm1_R_pose_matrix-output-array" count="2" stride="16">
<param name="TRANSFORM" type="float4x4"/>
@@ -861,7 +861,7 @@
</technique_common>
</source>
<source id="Armature_002_Arm2_R_pose_matrix-output">
<float_array id="Armature_002_Arm2_R_pose_matrix-output-array" count="32">0.9647611 0.2631273 3.27563e-7 0 -0.2631273 0.9647611 4.47035e-8 0.2368225 -3.05474e-7 -1.3411e-7 1 0 0 0 0 1 1 8.0691e-8 3.51358e-7 0 -4.9761e-8 0.9961947 -0.08715574 0.2368225 -3.57053e-7 0.08715574 0.9961947 0 0 0 0 1</float_array>
<float_array id="Armature_002_Arm2_R_pose_matrix-output-array" count="32">1 6.29212e-8 3.57628e-7 0 -6.29212e-8 1 0 0.2368225 -3.57628e-7 0 1 0 0 0 0 1 1 8.0691e-8 3.51358e-7 0 -4.9761e-8 0.9961947 -0.08715574 0.2368225 -3.57053e-7 0.08715574 0.9961947 0 0 0 0 1</float_array>
<technique_common>
<accessor source="#Armature_002_Arm2_R_pose_matrix-output-array" count="2" stride="16">
<param name="TRANSFORM" type="float4x4"/>
@@ -893,7 +893,7 @@
</technique_common>
</source>
<source id="Armature_002_Arm3_R_pose_matrix-output">
<float_array id="Armature_002_Arm3_R_pose_matrix-output-array" count="32">0.9018104 0.432132 -9.99244e-8 -1.49012e-8 -0.432132 0.9018103 8.9407e-8 0.2368225 1.11759e-7 -5.96046e-8 0.9999999 1.49012e-8 0 0 0 1 1 4.9761e-8 -6.23466e-8 -1.49012e-8 -5.50055e-8 0.9961946 -0.08715574 0.2368225 5.77724e-8 0.08715576 0.9961947 1.49012e-8 0 0 0 1</float_array>
<float_array id="Armature_002_Arm3_R_pose_matrix-output-array" count="32">1 6.29212e-8 -6.29212e-8 -1.49012e-8 -6.29212e-8 0.9999999 0 0.2368225 6.29212e-8 1.49012e-8 0.9999999 1.49012e-8 0 0 0 1 1 4.9761e-8 -6.23466e-8 -1.49012e-8 -5.50055e-8 0.9961946 -0.08715574 0.2368225 5.77724e-8 0.08715576 0.9961947 1.49012e-8 0 0 0 1</float_array>
<technique_common>
<accessor source="#Armature_002_Arm3_R_pose_matrix-output-array" count="2" stride="16">
<param name="TRANSFORM" type="float4x4"/>
@@ -925,7 +925,7 @@
</technique_common>
</source>
<source id="Armature_002_Arm4_R_pose_matrix-output">
<float_array id="Armature_002_Arm4_R_pose_matrix-output-array" count="32">0.9406103 0.3394883 2.87647e-8 -1.49012e-8 -0.3394884 0.9406103 1.49012e-8 0.2368228 7.45058e-9 -7.45058e-8 1 -5.96046e-8 0 0 0 1 1 -7.64089e-8 7.17683e-8 -1.49012e-8 7.60813e-8 0.9961948 -0.0871558 0.2368228 -6.23466e-8 0.08715571 0.9961948 -5.96046e-8 0 0 0 1</float_array>
<float_array id="Armature_002_Arm4_R_pose_matrix-output-array" count="32">1 -6.9213e-8 6.54104e-8 -1.49012e-8 6.29211e-8 1 -2.98023e-8 0.2368228 -6.29212e-8 -2.98023e-8 1 -5.96046e-8 0 0 0 1 1 -7.64089e-8 7.17683e-8 -1.49012e-8 7.60813e-8 0.9961948 -0.0871558 0.2368228 -6.23466e-8 0.08715571 0.9961948 -5.96046e-8 0 0 0 1</float_array>
<technique_common>
<accessor source="#Armature_002_Arm4_R_pose_matrix-output-array" count="2" stride="16">
<param name="TRANSFORM" type="float4x4"/>
@@ -957,7 +957,7 @@
</technique_common>
</source>
<source id="Armature_002_UpperHand_R_pose_matrix-output">
<float_array id="Armature_002_UpperHand_R_pose_matrix-output-array" count="32">0.9033983 0.4288025 -2.9989e-7 -1.49012e-8 -0.4288025 0.9033982 0 0.2368226 2.5332e-7 1.49012e-7 1 2.98023e-8 0 0 0 1 1 -2.65734e-9 -2.34158e-7 -1.49012e-8 -7.61939e-9 0.9961946 -0.0871557 0.2368226 2.38086e-7 0.08715576 0.9961948 2.98023e-8 0 0 0 1</float_array>
<float_array id="Armature_002_UpperHand_R_pose_matrix-output-array" count="32">1 1.01416e-8 -2.33831e-7 -1.49012e-8 -1.77636e-15 0.9999999 2.98023e-8 0.2368226 2.38419e-7 2.98023e-8 1 2.98023e-8 0 0 0 1 1 -2.65734e-9 -2.34158e-7 -1.49012e-8 -7.61939e-9 0.9961946 -0.0871557 0.2368226 2.38086e-7 0.08715576 0.9961948 2.98023e-8 0 0 0 1</float_array>
<technique_common>
<accessor source="#Armature_002_UpperHand_R_pose_matrix-output-array" count="2" stride="16">
<param name="TRANSFORM" type="float4x4"/>
@@ -989,7 +989,7 @@
</technique_common>
</source>
<source id="Armature_002_LowerHand_R_pose_matrix-output">
<float_array id="Armature_002_LowerHand_R_pose_matrix-output-array" count="32">0.8926221 0.4508058 -7.07346e-8 0 -0.4508058 0.8926222 -5.96046e-8 0.1475569 4.47035e-8 8.9407e-8 1 2.98023e-8 0 0 0 1 1 1.43558e-8 -1.97223e-9 0 -1.51808e-8 0.9848078 -0.1736482 0.1475569 -1.32816e-9 0.1736482 0.9848077 2.98023e-8 0 0 0 1</float_array>
<float_array id="Armature_002_LowerHand_R_pose_matrix-output-array" count="32">1 -7.00673e-10 -7.77575e-10 0 -3.55271e-15 1 -2.98023e-8 0.1475569 -1.77636e-15 2.98023e-8 1 2.98023e-8 0 0 0 1 1 1.43558e-8 -1.97223e-9 0 -1.51808e-8 0.9848078 -0.1736482 0.1475569 -1.32816e-9 0.1736482 0.9848077 2.98023e-8 0 0 0 1</float_array>
<technique_common>
<accessor source="#Armature_002_LowerHand_R_pose_matrix-output-array" count="2" stride="16">
<param name="TRANSFORM" type="float4x4"/>
Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

+1 -1
View File
@@ -105,7 +105,7 @@ private:
std::mt19937 m_RandomGenerator;
float m_XMovementMultiplier = 2.f;
float m_EdgeX = 3.2f;
float m_EdgeX = 3.4f; //Actually 3.2, but anyways.
float m_EdgeY = 5.2f;
int m_MultiBalls = 0;
bool m_ReplaceBall = false;
-2
View File
@@ -6,7 +6,6 @@
#define DAYDREAM_EKRAKENHIT_H
#include "Core/EventBroker.h"
#include "Core/CTransform.h"
namespace dd
{
@@ -18,7 +17,6 @@ struct KrakenHit : Event
{
EntityID Kraken;
EntityID Hitter;
glm::vec3 PlaceHit;
int MaxHealth;
int CurrentHealth;
int NewHealth;
+2 -4
View File
@@ -41,10 +41,8 @@ public:
m_FPSCounter = new GUI::FPSCounter(this, "FPSCounter");
m_KrakenAttackSlider = new Slider(this, "KrakenSlider");
m_KrakenAttackSlider->SetTexture("Textures/GUI/KrakenSlider/KrakenArmSliderBackground.png");
m_KrakenAttackSlider->SetTextureReleased("Textures/GUI/KrakenSlider/SpaceSpam.png");
m_KrakenAttackSlider->SetTexturePressed("Textures/GUI/KrakenSlider/SpaceHit.png");
m_KrakenAttackSlider->SetTexture("Textures/GUI/Menu/SliderBackground.png");
m_KrakenAttackSlider->SetTextureReleased("Textures/GUI/Menu/SliderHandle.png");
m_KrakenAttackSlider->SetLeft(Width / 2 - m_KrakenAttackSlider->Width / 2);
m_KrakenAttackSlider->Y = 800;
m_KrakenAttackSlider->Hide();
+1
View File
@@ -22,6 +22,7 @@
#include "Physics/CPhysics.h"
#include "Physics/CCircleShape.h"
#include "Physics/ESetImpulse.h"
#include "Physics/ECreateParticleSequence.h"
#include "Rendering/CSprite.h"
#include "Rendering/CModel.h"
+7 -8
View File
@@ -216,8 +216,7 @@ void dd::Systems::BallSystem::UpdateEntity(double dt, EntityID entity, EntityID
auto transform = m_World->GetComponent<Components::Transform>(entity);
glm::vec2 dir = glm::normalize(glm::vec2(transform->Velocity.x, transform->Velocity.y));
glm::vec2 up = glm::vec2(0.f, 1.f);
float angle = atan2(dir.x, dir.y);
float angle = glm::acos(glm::dot<float>(dir, up)) * glm::sign(dir.x);
transform->Orientation = glm::rotate(glm::quat(), angle, glm::vec3(0.f, 0.f, -1.f));
}
}
@@ -471,17 +470,17 @@ bool dd::Systems::BallSystem::OnMultiBall(const dd::Events::MultiBall &event)
ball2->Waiting = false;
auto padTransform = event.padTransform;
float x1 = padTransform->Position.x/* - 2*/, x2 = padTransform->Position.x/* + 2*/;
if (x1 < -m_EdgeX + 0.4) {
x1 = m_EdgeX - 0.7;
if (x1 < -m_EdgeX) {
x1 = m_EdgeX - 0.2;
}
if (x2 > m_EdgeX - 0.4) {
x2 = -m_EdgeX + 0.7;
if (x2 > m_EdgeX) {
x2 = -m_EdgeX + 0.2;
}
transform1->Position = glm::vec3(x1, -5.5, -10);
transform2->Position = glm::vec3(x2, -5.5, -10);
transform1->Velocity = glm::normalize(glm::vec3(2.5, 5 ,0.f)) * ball1->Speed;
transform2->Velocity = glm::normalize(glm::vec3(-2.5, 5 ,0.f)) * ball2->Speed;
transform1->Velocity = glm::normalize(glm::vec3(5, 5 ,0.f)) * ball1->Speed;
transform2->Velocity = glm::normalize(glm::vec3(-5, 5 ,0.f)) * ball2->Speed;
SetMultiBalls(MultiBalls() + 2);
//std::cout << MultiBalls() << std::endl;
+12 -17
View File
@@ -247,20 +247,16 @@ bool dd::Systems::KrakenSystem::OnContact(const dd::Events::Contact &event)
auto projectile = m_World->GetComponent<Components::Projectile>(otherEntitiy);
if (projectile != nullptr) {
if (m_RandomKraken) {
Events::ScoreEvent es;
es.Score = 23;
EventBroker->Publish(es);
Events::KrakenHit e;
e.Kraken = krakenEntity;
e.Hitter = otherEntitiy;
auto transform = m_World->GetComponent<Components::Transform>(otherEntitiy);
e.PlaceHit = transform->Position;
e.MaxHealth = kraken->MaxHealth;
e.CurrentHealth = kraken->Health;
e.NewHealth = kraken->Health - 1;
EventBroker->Publish(e);
}
Events::ScoreEvent es;
es.Score = 23;
EventBroker->Publish(es);
Events::KrakenHit e;
e.Kraken = krakenEntity;
e.Hitter = otherEntitiy;
e.MaxHealth = kraken->MaxHealth;
e.CurrentHealth = kraken->Health;
e.NewHealth = kraken->Health - 1;
EventBroker->Publish(e);
m_World->RemoveEntity(otherEntitiy);
return true;
}
@@ -277,8 +273,6 @@ bool dd::Systems::KrakenSystem::OnContact(const dd::Events::Contact &event)
Events::KrakenHit e;
e.Kraken = krakenEntity;
e.Hitter = otherEntitiy;
auto transform = m_World->GetComponent<Components::Transform>(otherEntitiy);
e.PlaceHit = transform->Position;
e.MaxHealth = kraken->MaxHealth;
e.CurrentHealth = kraken->Health;
e.NewHealth = kraken->Health - 1;
@@ -323,6 +317,7 @@ bool dd::Systems::KrakenSystem::OnKrakenAttack(const dd::Events::KrakenAttack &e
bool dd::Systems::KrakenSystem::OnKrakenHit(const dd::Events::KrakenHit &event)
{
auto kraken = m_World->GetComponent<Components::Kraken>(event.Kraken);
auto transform = m_World->GetComponent<Components::Transform>(event.Hitter);
kraken->Health--;
kraken->CurrentAction = 3;
//kraken->Health -= 15;
@@ -337,7 +332,7 @@ bool dd::Systems::KrakenSystem::OnKrakenHit(const dd::Events::KrakenHit &event)
m_KrakenCurrentSecondsToAction = m_KrakenMaxSecondsToAction - (modifier * timeDifferenceBetweenMaxAndMin);
// If modifier is 1, MaxSeconds is 15, MinSeconds is 5, then... 15 - (1 * 10), meaning 5.
CreateBloodEffect(event.PlaceHit);
CreateBloodEffect(transform->Position);
//std::cout << kraken->Health << std::endl;
//kraken->Health = -1;
+5 -10
View File
@@ -733,7 +733,7 @@ void dd::Systems::LevelSystem::GetBrickSet(int set, int setCluster) // These are
0, 0, 0, 0, 0, 0, 0,
6, 0, 1, 0, 1, 0, 6,
0, 1, 1, 1, 1, 1, 0,
0, 0, 5, 1, 1, 0, 0,
0, 0, 4, 1, 1, 0, 0,
0, 0, 0, 1, 0, 0, 0 };
color =
{b, b, b, b, b, b, b,
@@ -856,7 +856,7 @@ void dd::Systems::LevelSystem::GetBrickSet(int set, int setCluster) // These are
0, 0, 1, 1, 1, 0, 0,
1, 1, 1, 0, 1, 1, 1,
3, 6, 1, 0, 1, 6, 1,
1, 1, 1, 0, 1, 1, 5 };
1, 1, 1, 0, 1, 1, 1 };
color =
{g, g, g, g, g, g, g,
g, g, g, g, g, g, g,
@@ -1023,13 +1023,8 @@ void dd::Systems::LevelSystem::BrickHit(EntityID entityHitter, EntityID entityBr
if (kraken != nullptr) {
Events::KrakenAttack e;
e.ChargeUpdate = 0;
if (m_KrakenBattle) {
e.KrakenStrength = 0.1;
e.PlayerStrength = 0.12;
} else {
e.KrakenStrength = 0.1;
e.PlayerStrength = 0.05;
}
e.KrakenStrength = 0.1;
e.PlayerStrength = 0.05;
EventBroker->Publish(e);
}
else {
@@ -1273,7 +1268,7 @@ void dd::Systems::LevelSystem::GetNextLevel()
level =
{0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0,
2, 2, 2, 2, 2, 2, 2,
0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 1};
+23 -62
View File
@@ -44,16 +44,11 @@ void dd::Systems::LifebuoySystem::Initialize()
void dd::Systems::LifebuoySystem::Update(double dt)
{
/*for (auto it = m_Lifebuoys.begin(); it != m_Lifebuoys.end();) { //Niklas note: Jag fortstatte få fel efter ni gick hem, och jag förstod inte det här så jag gjorde om som jag visste hur i UpdateEntity.
for (auto it = m_Lifebuoys.begin(); it != m_Lifebuoys.end();) {
auto transformComponent = m_World->GetComponent<Components::Transform>(it->Entity);
auto lifebuoyComponent = m_World->GetComponent<Components::Lifebuoy>(it->Entity);
if (!m_World->ValidEntity(it->Entity)){
m_Lifebuoys.erase(it++);
}
if (transformComponent->Position.y < m_DownEdge) {
m_World->RemoveEntity(it->Entity);
m_Lifebuoys.erase(it++);
@@ -80,7 +75,7 @@ void dd::Systems::LifebuoySystem::Update(double dt)
++it;
}
}*/
}
if (IsPaused()) {
return;
@@ -103,38 +98,6 @@ void dd::Systems::LifebuoySystem::UpdateEntity(double dt, EntityID entity, Entit
}
auto templateCheck = m_World->GetComponent<Components::Template>(entity);
if (templateCheck != nullptr){ return; }
auto lifebuoyComponent = m_World->GetComponent<Components::Lifebuoy>(entity);
if (lifebuoyComponent != nullptr) {
auto transformComponent = m_World->GetComponent<Components::Transform>(entity);
if (transformComponent->Position.y < m_DownEdge) {
m_World->RemoveEntity(entity);
//m_Lifebuoys.erase(it++);
}
else {
if (transformComponent->Position.x > m_RightEdge) {
transformComponent->Position = glm::vec3(m_LeftEdge + 0.1f, transformComponent->Position.y, transformComponent->Position.z);
}
else if (transformComponent->Position.x < m_LeftEdge) {
transformComponent->Position = glm::vec3(m_RightEdge - 0.1f, transformComponent->Position.y, transformComponent->Position.z);
}
if (lifebuoyComponent->Hits <= 0) {
auto physicsComponent = m_World->GetComponent<Components::Physics>(entity);
physicsComponent->Mask = CollisionLayer::Type::LifeBuoy;
physicsComponent->GravityScale = 10.f;
auto modelComponent = m_World->GetComponent<Components::Model>(entity);
modelComponent->Color = glm::vec4(0.5f, 0.5f, 0.5f, 0.f);
}
if (transformComponent->Position.y < m_DownLimit && lifebuoyComponent->Hits > 0) {
transformComponent->Position.y = m_DownLimit;
}
}
}
}
bool dd::Systems::LifebuoySystem::OnPause(const dd::Events::Pause &event)
@@ -192,30 +155,28 @@ bool dd::Systems::LifebuoySystem::OnLifebuoyHit(const dd::Events::LifebuoyHit &e
{
auto transformComponent = m_World->GetComponent<Components::Transform>(event.Lifebuoy);
auto lifebuoyComponent = m_World->GetComponent<Components::Lifebuoy>(event.Lifebuoy);
if (lifebuoyComponent != nullptr) {
lifebuoyComponent->Hits -= 1;
auto modelComponent = m_World->GetComponent<Components::Model>(event.Lifebuoy);
modelComponent->ModelFile = "Models/Lifebuoy/Lifebuoy" + std::to_string(5 - lifebuoyComponent->Hits) + ".obj";
lifebuoyComponent->Hits -= 1;
auto modelComponent = m_World->GetComponent<Components::Model>(event.Lifebuoy);
modelComponent->ModelFile = "Models/Lifebuoy/Lifebuoy" + std::to_string(5 - lifebuoyComponent->Hits) + ".obj";
Events::CreateParticleSequence e;
e.EmitterLifeTime = 4;
e.EmittingAngle = glm::half_pi<float>();
e.Spread = 0.5f;
e.NumberOfTicks = 1;
e.ParticleLifeTime = 2.f;
e.ParticlesPerTick = 1;
e.Position = transformComponent->Position;
e.ScaleValues.clear();
e.ScaleValues.push_back(glm::vec3(0.5f));
e.ScaleValues.push_back(glm::vec3(2.f, 2.f, 0.2f));
e.SpriteFile = "Textures/Particles/Cloud_Particle.png";
e.Color = glm::vec4(1, 0, 0, 1);
e.AlphaValues.clear();
e.AlphaValues.push_back(1.f);
e.AlphaValues.push_back(0.f);
e.Speed = 10.f;
EventBroker->Publish(e);
}
Events::CreateParticleSequence e;
e.EmitterLifeTime = 4;
e.EmittingAngle = glm::half_pi<float>();
e.Spread = 0.5f;
e.NumberOfTicks = 1;
e.ParticleLifeTime = 2.f;
e.ParticlesPerTick = 1;
e.Position = transformComponent->Position;
e.ScaleValues.clear();
e.ScaleValues.push_back(glm::vec3(0.5f));
e.ScaleValues.push_back(glm::vec3(2.f, 2.f, 0.2f));
e.SpriteFile = "Textures/Particles/Cloud_Particle.png";
e.Color = glm::vec4(1, 0, 0, 1);
e.AlphaValues.clear();
e.AlphaValues.push_back(1.f);
e.AlphaValues.push_back(0.f);
e.Speed = 10.f;
EventBroker->Publish(e);
return true;
}
+35 -19
View File
@@ -38,33 +38,49 @@ void dd::Systems::PadSystem::Initialize()
EVENT_SUBSCRIBE_MEMBER(m_EStickyPad, &PadSystem::OnStickyPad);
EVENT_SUBSCRIBE_MEMBER(m_EStickyAttachedToPad, &PadSystem::OnStickyAttachedToPad);
EVENT_SUBSCRIBE_MEMBER(m_EActionButton, &PadSystem::OnActionButton);
//EVENT_SUBSCRIBE_MEMBER(m_EBindKey, &PadSystem::OnBindKey);
//EVENT_SUBSCRIBE_MEMBER(m_EBindKey, &PadSystem::OnBindKey);
{
auto ent = m_World->CreateEntity();
m_World->SetProperty(ent, "Name", "Pad");
auto ctransform = m_World->AddComponent<Components::Transform>(ent);
ctransform->Position = glm::vec3(0.f, m_PadHeight, -10.f);
auto rectangleShape = m_World->AddComponent<Components::RectangleShape>(ent);
rectangleShape->Dimensions = glm::vec2(1.f, 0.1f);
auto physics = m_World->AddComponent<Components::Physics>(ent);
physics->CollisionType = CollisionType::Type::Kinematic;
physics->Category = CollisionLayer::Type::Pad;
{
auto ent = m_World->CreateEntity();
m_World->SetProperty(ent, "Name", "Pad");
auto ctransform = m_World->AddComponent<Components::Transform>(ent);
ctransform->Position = glm::vec3(0.f, m_PadHeight, -10.f);
auto rectangleShape = m_World->AddComponent<Components::RectangleShape>(ent);
rectangleShape->Dimensions = glm::vec2(1.f, 0.1f);
auto physics = m_World->AddComponent<Components::Physics>(ent);
physics->CollisionType = CollisionType::Type::Kinematic;
physics->Category = CollisionLayer::Type::Pad;
physics->Mask = static_cast<CollisionLayer::Type>(CollisionLayer::Ball | CollisionLayer::PowerUp | CollisionLayer::LifeBuoy);
physics->Calculate = true;
auto cModel = m_World->AddComponent<Components::Model>(ent);
cModel->ModelFile = "Models/Ship/Ship.obj";
physics->Calculate = true;
auto cModel = m_World->AddComponent<Components::Model>(ent);
cModel->ModelFile = "Models/Ship/Ship.obj";
auto pad = m_World->AddComponent<Components::Pad>(ent);
auto pad = m_World->AddComponent<Components::Pad>(ent);
pad->SlowdownModifier = 10.f;
m_World->CommitEntity(ent);
m_World->CommitEntity(ent);
m_Edge = 3.2 - (ctransform->Scale.x / 2);
m_Edge = 3.2 - (ctransform->Scale.x / 2);
m_PadEntity = ent;
m_PadTransform = ctransform.get();
m_PadComponent = pad.get();
}
Events::CreateParticleSequence e;
e.SpriteFile = "Textures/Particles/FadeBall.png";
e.Color = glm::vec4(0, 0, 1, 1);
e.EmitterLifeTime = 9999999999;
e.EmittingAngle = glm::two_pi<float>();
e.ParticleLifeTime = 0.5f;
e.ParticlesPerTick = 2;
e.ScaleValues.push_back(glm::vec3(2));
e.AlphaValues.push_back(1.f);
e.SpawnRate = 0.1;
e.Spread = glm::half_pi<float>();
e.Speed = 10;
e.parent = m_PadEntity;
EventBroker->Publish(e);
}
//Stick
{