Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Space-Shooter
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Lenny Siol
Space-Shooter
Commits
7356e686
Commit
7356e686
authored
4 years ago
by
Lenny Siol
Browse files
Options
Downloads
Patches
Plain Diff
Update: Ship class, make ship unable to leave the screen
parent
54803b88
No related branches found
Branches containing commit
No related tags found
2 merge requests
!19
Finish polishing
,
!18
Feature: Polish
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Code/Space-Shooter_Game/Space-Shooter_Game.depend
+2
-3
2 additions, 3 deletions
Code/Space-Shooter_Game/Space-Shooter_Game.depend
Code/Space-Shooter_Game/src/Entities/Ship/Ship.cpp
+4
-4
4 additions, 4 deletions
Code/Space-Shooter_Game/src/Entities/Ship/Ship.cpp
with
6 additions
and
7 deletions
Code/Space-Shooter_Game/Space-Shooter_Game.depend
+
2
−
3
View file @
7356e686
...
...
@@ -6,9 +6,8 @@
1614862706 source:/home/lenny/Desktop/Boxelware/Code/Space-Shooter_Game/src/main.cpp
"Menu/Menu.h"
161486
3858
source:/home/lenny/Desktop/Boxelware/Code/Space-Shooter_Game/src/Entities/Ship/Ship.cpp
161486
5659
source:/home/lenny/Desktop/Boxelware/Code/Space-Shooter_Game/src/Entities/Ship/Ship.cpp
"Ship.h"
"../../Rendering/TextureManager.h"
<iostream>
1614865224 /home/lenny/Desktop/Boxelware/Code/Space-Shooter_Game/src/Entities/Ship/Ship.h
...
...
@@ -61,7 +60,7 @@
1614864800 /home/lenny/Desktop/Boxelware/Code/Space-Shooter_Game/src/Entities/Missile/Missile.h
"../Entity.h"
161486
3377
source:/home/lenny/Desktop/Boxelware/Code/Space-Shooter_Game/src/Entities/Enemy/Enemy.cpp
161486
5224
source:/home/lenny/Desktop/Boxelware/Code/Space-Shooter_Game/src/Entities/Enemy/Enemy.cpp
"Enemy.h"
1614865224 /home/lenny/Desktop/Boxelware/Code/Space-Shooter_Game/src/Entities/Enemy/Enemy.h
...
...
This diff is collapsed.
Click to expand it.
Code/Space-Shooter_Game/src/Entities/Ship/Ship.cpp
+
4
−
4
View file @
7356e686
...
...
@@ -27,20 +27,20 @@ void Ship::update()
void
Ship
::
handleControls
(
const
Uint8
*
keyboard_state
)
{
if
(
keyboard_state
[
SDL_SCANCODE_W
]
&&
!
keyboard_state
[
SDL_SCANCODE_S
])
if
(
keyboard_state
[
SDL_SCANCODE_W
]
&&
!
keyboard_state
[
SDL_SCANCODE_S
]
&&
destionation
.
y
>
0
)
{
destionation
.
y
-=
speed
;
}
else
if
(
keyboard_state
[
SDL_SCANCODE_S
]
&&
!
keyboard_state
[
SDL_SCANCODE_W
])
else
if
(
keyboard_state
[
SDL_SCANCODE_S
]
&&
!
keyboard_state
[
SDL_SCANCODE_W
]
&&
destionation
.
y
<
game
->
getHeight
()
-
32
)
{
destionation
.
y
+=
speed
;
}
if
(
keyboard_state
[
SDL_SCANCODE_A
]
&&
!
keyboard_state
[
SDL_SCANCODE_D
])
if
(
keyboard_state
[
SDL_SCANCODE_A
]
&&
!
keyboard_state
[
SDL_SCANCODE_D
]
&&
destionation
.
x
>
0
)
{
destionation
.
x
-=
speed
;
}
else
if
(
keyboard_state
[
SDL_SCANCODE_D
]
&&
!
keyboard_state
[
SDL_SCANCODE_A
])
else
if
(
keyboard_state
[
SDL_SCANCODE_D
]
&&
!
keyboard_state
[
SDL_SCANCODE_A
]
&&
destionation
.
x
<
game
->
getWidth
()
-
32
)
{
destionation
.
x
+=
speed
;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment