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
junijuku
ohj1ht
Commits
a0e3bf54
Commit
a0e3bf54
authored
1 year ago
by
Kuortti Jules Nino Julius
Browse files
Options
Downloads
Patches
Plain Diff
Viimeistelya
parent
605c4e0b
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
Mopojonne/Mopojonne.cs
+15
-9
15 additions, 9 deletions
Mopojonne/Mopojonne.cs
with
15 additions
and
9 deletions
Mopojonne/Mopojonne.cs
+
15
−
9
View file @
a0e3bf54
...
...
@@ -3,17 +3,23 @@ using Jypeli;
using
Jypeli.Assets
;
/// @author junijuku
/// @version
24.11
.2023
/// @version
10.12
.2023
namespace
Mopojonne
{
public
class
Mopojonne
:
PhysicsGame
{
// Nopeudet
/// <summary>
/// Nopeus vakioita
/// </summary>
/// <param name="NOPEUS">Pelaajan nopeus</param>
/// <param name="RUUDUN_KOKO">Kentän skaalaantuminen</param>
/// <param name="autoNopeus">Autojen nopeus</param>
/// <param name="tolkkiNopeus">Tölkkien nopeus</param>
private
const
double
NOPEUS
=
200
;
private
const
int
RUUDUN_KOKO
=
15
;
private
double
autoNopeus
=
-
200
;
private
double
tolkkiNopeus
=
-
2
0
0
;
private
double
tolkkiNopeus
=
-
2
5
0
;
private
PlatformCharacter
pelaaja1
;
private
Timer
nopeudenKasvatusAjastin
;
...
...
@@ -31,7 +37,7 @@ namespace Mopojonne
/// <summary>
/// Ohjelma alkaa
/// Ohjelma alkaa
. Luodaan kenttä, lisätään näppäinkomennot, säädetään kamera ja ääni kohdilleen,
/// </summary>
public
override
void
Begin
()
{
...
...
@@ -74,13 +80,11 @@ namespace Mopojonne
/// <summary>
/// Luo kent
älle
olioita tekstitiedoston avulla
.
/// Luo
daan
kent
tä ja
olioita tekstitiedoston avulla
/// </summary>
private
void
LuoKentta
()
{
// Lisätään olioita tekstitiedoston kautta
TileMap
kentta
=
TileMap
.
FromLevelAsset
(
"kentta1.txt"
);
// ReSharper disable once IdentifierTypo
kentta
.
SetTileMethod
(
'*'
,
(
paikka
,
leveys
,
korkeus
)
=>
LisaaEste
(
paikka
,
25
,
50
,
"estolkki.png"
,
"tolkki"
,
tolkkiNopeus
,
true
));
kentta
.
SetTileMethod
(
'N'
,
LisaaPelaaja
);
kentta
.
SetTileMethod
(
'A'
,
(
paikka
,
leveys
,
korkeus
)
=>
LisaaEste
(
paikka
,
50
,
100
,
"auto.png"
,
"auto"
,
autoNopeus
,
false
,
100
));
...
...
@@ -158,7 +162,7 @@ namespace Mopojonne
/// <summary>
/// Luo "putoavat" oliot ES-tölkki ja Auto, hakee olioille kuvan
/// Luo "putoavat"
oliot ES-tölkki ja Auto, hakee olioille kuvan
/// </summary>
/// <param name="paikka">olion paikka kentällä</param>
/// <param name="leveys">olion leveys pikseleinä</param>
...
...
@@ -239,7 +243,9 @@ namespace Mopojonne
}
// Näppäimistö- ja ohjainkomennot
/// <summary>
/// Näppäimistö- ja ohjainkomennot. Kun näppäintä painetaan jotain tapahtuu.
/// </summary>
private
void
LisaaNappaimet
()
{
Keyboard
.
Listen
(
Key
.
F1
,
ButtonState
.
Pressed
,
ShowControlHelp
,
"Näytä ohjeet"
);
...
...
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