Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
J
jumpNrun
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
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
Code review analytics
Issue analytics
Insights
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
wise2023_jumpnrun
jumpNrun
Commits
f4fd2472
Commit
f4fd2472
authored
1 year ago
by
Michael
Browse files
Options
Downloads
Patches
Plain Diff
added right hand support
parent
c3a2a8b9
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
charac.c
+6
-5
6 additions, 5 deletions
charac.c
with
6 additions
and
5 deletions
charac.c
+
6
−
5
View file @
f4fd2472
...
...
@@ -13,25 +13,26 @@ Nachbedingung: Position des Characters hat sich je nach Tasteneingabe verändert
void
jump
(
int
input
){
switch
(
input
)
{
case
SDL_SCANCODE_L
:
case
SDL_SCANCODE_D
:
//right
if
(
player
->
x
<
770
){
// Überprüfe Grenzen
player
->
x
+=
ROW_SIZE
;
}
break
;
case
SDL_SCANCODE_J
:
case
SDL_SCANCODE_A
:
//left
if
(
player
->
x
>
30
){
// Überprüfe Grenzen
player
->
x
-=
ROW_SIZE
;
}
break
;
case
SDL_SCANCODE_K
:
case
SDL_SCANCODE_S
:
//down
if
(
player
->
y
<
820
){
// Überprüfe Grenzen
playerscore
--
;
player
->
y
+=
ROW_SIZE
;
}
break
;
case
SDL_SCANCODE_I
:
case
SDL_SCANCODE_W
:
//up
if
(
player
->
y
>
120
){
// Überprüfe Grenzen
playerscore
++
;
...
...
@@ -41,7 +42,7 @@ void jump(int input){
player
->
y
-=
ROW_SIZE
;
}
break
;
case
SDL_SCANCODE_U
:
case
SDL_SCANCODE_Q
:
// Taste q => gehe nach oben links
if
(
player
->
y
>
120
&&
player
->
x
>
30
){
// Überprüfe Grenezen
playerscore
++
;
...
...
@@ -52,7 +53,7 @@ void jump(int input){
player
->
x
-=
ROW_SIZE
;
}
break
;
case
SDL_SCANCODE_O
:
case
SDL_SCANCODE_E
:
// Taste e => gehe nach oben rechts
if
(
player
->
y
>
120
&&
player
->
x
<
770
){
// Überprüfe Grenzen
playerscore
++
;
...
...
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