Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
ohj1ht
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
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
jasajuyl
ohj1ht
Commits
f3571e22
Commit
f3571e22
authored
1 year ago
by
Yli-Tainio Janne Sakri Juhani
Browse files
Options
Downloads
Patches
Plain Diff
olio liikkuu
parent
112186f9
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
kolikkogoblin/.idea/.idea.kolikkogoblin/.idea/workspace.xml
+1
-9
1 addition, 9 deletions
kolikkogoblin/.idea/.idea.kolikkogoblin/.idea/workspace.xml
kolikkogoblin/kolikkogoblin/kolikkogoblin.cs
+20
-27
20 additions, 27 deletions
kolikkogoblin/kolikkogoblin/kolikkogoblin.cs
with
21 additions
and
36 deletions
kolikkogoblin/.idea/.idea.kolikkogoblin/.idea/workspace.xml
+
1
−
9
View file @
f3571e22
...
...
@@ -8,16 +8,8 @@
</component>
<component
name=
"ChangeListManager"
>
<list
default=
"true"
id=
"0cb08879-2df4-4f3a-a1a9-8178f387d135"
name=
"Changes"
comment=
""
>
<change
afterPath=
"$PROJECT_DIR$/kolikkogoblin/content/palikka.png"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/.idea/.idea.kolikkogoblin/.idea/workspace.xml"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/.idea/.idea.kolikkogoblin/.idea/workspace.xml"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/kolikkogoblin/Ohjelma.cs"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/kolikkogoblin/Ohjelma.cs"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/kolikkogoblin/content/goblin1.png"
beforeDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/kolikkogoblin/content/goblin2.png"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/kolikkogoblin/content/goblin2.png"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/kolikkogoblin/content/goblin3.png"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/kolikkogoblin/content/goblin3.png"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/kolikkogoblin/content/kolikko.png"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/kolikkogoblin/content/kolikko.png"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/kolikkogoblin/content/piikkeja.png"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/kolikkogoblin/content/piikkeja.png"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/kolikkogoblin/kolikkogoblin.cs"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/kolikkogoblin/kolikkogoblin.cs"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/kolikkogoblin/kolikkogoblin.csproj"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/kolikkogoblin/kolikkogoblin.csproj"
afterDir=
"false"
/>
</list>
<option
name=
"SHOW_DIALOG"
value=
"false"
/>
<option
name=
"HIGHLIGHT_CONFLICTS"
value=
"true"
/>
...
...
@@ -91,7 +83,7 @@
<workItem
from=
"1697968144137"
duration=
"544000"
/>
<workItem
from=
"1697968850249"
duration=
"1577000"
/>
<workItem
from=
"1697970578826"
duration=
"3648000"
/>
<workItem
from=
"1697975844304"
duration=
"
1009
000"
/>
<workItem
from=
"1697975844304"
duration=
"
5156
000"
/>
</task>
<servers
/>
</component>
...
...
This diff is collapsed.
Click to expand it.
kolikkogoblin/kolikkogoblin/kolikkogoblin.cs
+
20
−
27
View file @
f3571e22
...
...
@@ -14,18 +14,6 @@ namespace Kolikkogoblin;
public
class
Kolikkogoblin
:
PhysicsGame
{
private
static
readonly
String
[]
lines
=
{
" "
,
" "
,
" "
,
" "
,
" "
,
" "
,
" "
,
" "
,
" "
,
" "
,
" "
,
" "
,
" "
,
" "
,
" "
,
...
...
@@ -34,16 +22,11 @@ public class Kolikkogoblin : PhysicsGame
" X "
,
" X "
,
" X "
,
" *
XXX
"
,
" XXX
"
,
"
ww g "
,
" *
"
,
"
XXX "
,
" w
w g "
,
};
private
readonly
Image
palikka
=
LoadImage
(
"palikka"
);
private
readonly
Image
goblin
=
LoadImage
(
"goblin1"
);
private
readonly
Image
kolikko
=
LoadImage
(
"kolikko"
);
private
readonly
Image
piikkeja
=
LoadImage
(
"piikkeja"
);
private
static
readonly
int
tileWidth
=
800
/
lines
[
0
].
Length
;
private
static
readonly
int
tileHeight
=
480
/
lines
.
Length
;
...
...
@@ -63,7 +46,8 @@ public class Kolikkogoblin : PhysicsGame
Level
.
CreateBorders
();
Camera
.
ZoomToLevel
();
PhoneBackButton
.
Listen
(
ConfirmExit
,
"Lopeta peli"
);
Keyboard
.
Listen
(
Key
.
Escape
,
ButtonState
.
Pressed
,
ConfirmExit
,
"Lopeta peli"
);
}
...
...
@@ -71,7 +55,7 @@ public class Kolikkogoblin : PhysicsGame
private
void
LuoPalikka
(
Vector
paikka
,
double
leveys
,
double
korkeus
,
Color
vari
)
{
PhysicsObject
palikka
=
new
PhysicsObject
(
leveys
*
1.6
,
korkeus
);
PhysicsObject
palikka
=
new
PhysicsObject
(
leveys
,
korkeus
);
palikka
.
Position
=
paikka
;
palikka
.
Color
=
vari
;
palikka
.
Tag
=
"rakenne"
;
...
...
@@ -88,14 +72,24 @@ public class Kolikkogoblin : PhysicsGame
kolikko
.
Image
=
LoadImage
(
"kolikko"
);
Add
(
kolikko
);
}
private
void
LuoGoblin
(
Vector
paikka
,
double
leveys
,
double
korkeus
,
Color
vari
)
{
P
hysicsObject
goblin
=
PhysicsObject
.
CreateStaticObject
(
leveys
*
3
,
korkeus
*
6
);
{
P
latformCharacter
goblin
=
new
PlatformCharacter
(
leveys
*
2
,
korkeus
*
2
);
goblin
.
Position
=
paikka
;
goblin
.
Color
=
vari
;
goblin
.
Image
=
LoadImage
(
"goblin1"
);
Add
(
goblin
);
Keyboard
.
Listen
(
Key
.
Left
,
ButtonState
.
Down
,
LiikutaPelaajaa
,
null
,
new
Vector
(-
20000
,
0
));
Keyboard
.
Listen
(
Key
.
Right
,
ButtonState
.
Down
,
LiikutaPelaajaa
,
null
,
new
Vector
(
20000
,
0
));
Keyboard
.
Listen
(
Key
.
Up
,
ButtonState
.
Down
,
LiikutaPelaajaa
,
null
,
new
Vector
(
0
,
7000
));
Keyboard
.
Listen
(
Key
.
Down
,
ButtonState
.
Down
,
LiikutaPelaajaa
,
null
,
new
Vector
(
0
,
-
7000
));
void
LiikutaPelaajaa
(
Vector
vektori
)
{
goblin
.
Push
(
vektori
);
}
}
private
void
LuoPiikkeja
(
Vector
paikka
,
double
leveys
,
double
korkeus
,
Color
vari
)
...
...
@@ -108,6 +102,5 @@ public class Kolikkogoblin : PhysicsGame
piikkeja
.
Tag
=
"piikkeja"
;
Add
(
piikkeja
);
}
}
}
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