Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
PhaseShifter
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
3
Issues
3
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
GameDevWeek
S
Sommersemester 2019
Cpp
PhaseShifter
Commits
975662da
Commit
975662da
authored
Sep 21, 2019
by
Kevin Balz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tweaks
parent
8d67ff9d
Pipeline
#3391
failed with stage
in 4 minutes and 12 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
8 deletions
+11
-8
assets/game_assets/blueprints/player.json
assets/game_assets/blueprints/player.json
+1
-1
src/gameplay/stationary_attack_system.cpp
src/gameplay/stationary_attack_system.cpp
+2
-2
src/ui/hud_system.cpp
src/ui/hud_system.cpp
+8
-5
No files found.
assets/game_assets/blueprints/player.json
View file @
975662da
...
...
@@ -23,7 +23,7 @@
"attack_width"
:
0.5
},
"Stationary_attack"
:
{
"radius"
:
7
"radius"
:
5.5
},
"Rigid_body"
:
{
"radius"
:
0.5
...
...
src/gameplay/stationary_attack_system.cpp
View file @
975662da
...
...
@@ -36,8 +36,8 @@ namespace phase_shifter::gameplay {
}
glm
::
vec2
k_position
(
k_transform
.
position
.
x
,
k_transform
.
position
.
z
);
if
(
glm
::
length
(
position
-
k_position
)
<
attack
.
radius
+
1
)
{
auto
attack_direction
=
glm
::
normalize
(
k_position
-
position
);
_bus
.
send
<
Enemy_killed_msg
>
(
k_transform
.
position
,
glm
::
vec3
(
attack_direction
.
x
,
0
,
attack_direction
.
y
));
//
auto attack_direction = glm::normalize(k_position - position);
//
_bus.send<Enemy_killed_msg>(k_transform.position, glm::vec3(attack_direction.x, 0, attack_direction.y));
_ecs
.
erase
(
entity
);
}
}
...
...
src/ui/hud_system.cpp
View file @
975662da
...
...
@@ -73,18 +73,21 @@ namespace phase_shifter::ui {
while
(
beat_index
<
static_cast
<
int
>
(
beats
.
size
()))
{
auto
x_offset
=
(
beats
[
beat_index
]
-
_passed
)
*
bar_speed
;
if
(
x_offset
>
beat_bar_length
)
{
break
;
}
auto
height
=
beat_bar_height
*
(
1.
f
-
glm
::
smoothstep
(
0.
f
,
beat_bar_length
,
x_offset
));
auto
bar_color
=
beat_index
<
static_cast
<
int
>
(
beats
.
size
()
*
0.8
f
)
?
0xFFFFFFFF
:
0xFF0000FF
;
float
alpha
=
1
-
(
x_offset
/
beat_bar_length
);
auto
bar_color_float
=
beat_index
<
static_cast
<
int
>
(
beats
.
size
()
*
0.8
f
)
?
ImVec4
(
1
,
1
,
1
,
alpha
)
:
ImVec4
(
1
,
0
,
0
,
alpha
);
auto
bar_color
=
ImGui
::
ColorConvertFloat4ToU32
(
bar_color_float
);
ImVec2
p
(
cursor
.
x
+
viewport
.
z
/
2
-
x_offset
,
cursor
.
y
-
height
/
2.
f
);
drawList
->
AddLine
(
p
,
{
p
.
x
,
p
.
y
+
height
},
bar_color
,
1
);
p
.
x
=
cursor
.
x
+
viewport
.
z
/
2
+
x_offset
;
drawList
->
AddLine
(
p
,
{
p
.
x
,
p
.
y
+
height
},
bar_color
,
1
);
if
(
x_offset
>
beat_bar_length
+
50
)
{
break
;
}
beat_index
++
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment