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
pmikaiko
ohj1ht
Commits
f0fae49d
Commit
f0fae49d
authored
1 month ago
by
Kaikosuo Paavo
Browse files
Options
Downloads
Patches
Plain Diff
Taukovalikon tausta lisätty, ei vielä lopullinen
parent
5b680d57
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
peli/Peli/Peli/Content/taukovalikonTausta.png
+0
-0
0 additions, 0 deletions
peli/Peli/Peli/Content/taukovalikonTausta.png
peli/Peli/Peli/Peli.cs
+17
-3
17 additions, 3 deletions
peli/Peli/Peli/Peli.cs
peli/Peli/Peli/Peli.csproj
+4
-0
4 additions, 0 deletions
peli/Peli/Peli/Peli.csproj
with
21 additions
and
3 deletions
peli/Peli/Peli/Content/taukovalikonTausta.png
0 → 100644
+
0
−
0
View file @
f0fae49d
4.49 KiB
This diff is collapsed.
Click to expand it.
peli/Peli/Peli/Peli.cs
+
17
−
3
View file @
f0fae49d
...
...
@@ -23,6 +23,7 @@ namespace Peli
Image
autoTie
=
LoadImage
(
"Autotie.png"
);
Image
varjo
=
LoadImage
(
"Varjo.png"
);
Image
tausta
=
LoadImage
(
"tausta.png"
);
Image
taukovalikonTausta
=
LoadImage
(
"taukovalikonTausta.png"
);
Image
menunTausta
=
LoadImage
(
"menuBackground.png"
);
// TULEVILLE KUVILLE MUUTTUJAT
Image
puu
=
LoadImage
(
"Puu.png"
);
...
...
@@ -43,6 +44,7 @@ namespace Peli
private
bool
alkuvalikosta
;
List
<
Label
>
valikonKohdat
;
List
<
GameObject
>
valikonKuvat
;
GameObject
valikonTausta
;
protected
override
void
Update
(
Time
time
)
{
if
(
autoVarjo
!=
null
)
...
...
@@ -72,7 +74,7 @@ namespace Peli
// Luodaan auto-objekti ja asetetaan sille kuvatiedosto sekä ominaisuudet kuten kiihtyvyys ja huippunopeus
auto
=
new
Automobile
(
120
,
60
);
// Leveys 120, korkeus 60
auto
.
Image
=
autoSprite
;
this
.
Add
(
auto
);
this
.
Add
(
auto
,
1
);
auto
.
Mass
=
10
;
auto
.
LinearDamping
=
1
;
auto
.
CanRotate
=
true
;
...
...
@@ -205,6 +207,11 @@ namespace Peli
}
public
void
taukoValikko
()
{
valikonTausta
=
new
GameObject
(
224
,
444
);
valikonTausta
.
Position
=
new
Vector
(
Camera
.
X
,
Camera
.
Y
+
25
);
valikonTausta
.
Image
=
taukovalikonTausta
;
Add
(
valikonTausta
,
2
);
valikonKohdat
=
new
List
<
Label
>();
// Alustetaan lista, johon valikon kohdat tulevat
valikonKuvat
=
new
List
<
GameObject
>();
Label
kohta1
=
new
Label
(
174
,
54
,
"Jatka peliä"
);
// Luodaan uusi Label-olio, joka toimii uuden pelin aloituskohtana
...
...
@@ -217,6 +224,12 @@ namespace Peli
kohta1go
.
Image
=
tausta
;
valikonKuvat
.
Add
(
kohta1go
);
Label
otsikko
=
new
Label
(
"Taukovalikko"
);
// Luodaan otsikko
otsikko
.
Position
=
new
Vector
(
kohta1
.
X
,
kohta1
.
Y
+
60
);
// Otsikko on hieman valikonkohtien yläpuolella
otsikko
.
Font
=
new
Font
(
30
,
true
);
// Otsikon teksti on suurempi ja boldattu
otsikko
.
TextColor
=
Color
.
White
;
Add
(
otsikko
,
2
);
Label
kohta2
=
new
Label
(
174
,
54
,
"Pelaa uudelleen"
);
kohta2
.
Position
=
new
Vector
(
Camera
.
Position
.
X
,
Camera
.
Position
.
Y
+
75
);
valikonKohdat
.
Add
(
kohta2
);
...
...
@@ -256,11 +269,11 @@ namespace Peli
// Lisätään kaikki luodut kohdat peliin foreach-silmukalla
foreach
(
Label
valikonKohta
in
valikonKohdat
)
{
Add
(
valikonKohta
,
2
);
Add
(
valikonKohta
,
3
);
}
foreach
(
GameObject
valikonKuva
in
valikonKuvat
)
{
Add
(
valikonKuva
,
1
);
Add
(
valikonKuva
,
3
);
}
Mouse
.
ListenOn
(
kohta1
,
MouseButton
.
Left
,
ButtonState
.
Pressed
,
Pauseta
,
null
);
...
...
@@ -369,6 +382,7 @@ namespace Peli
{
Remove
(
valikonKuva
);
}
Remove
(
valikonTausta
);
IsPaused
=
false
;
if
(
aikalaskuri
!=
null
)
{
...
...
This diff is collapsed.
Click to expand it.
peli/Peli/Peli/Peli.csproj
+
4
−
0
View file @
f0fae49d
...
...
@@ -39,6 +39,10 @@
<Content Include="Content\menuBackground.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<None Remove="Content\taukovalikonTausta.png" />
<Content Include="Content\taukovalikonTausta.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
<ItemGroup>
...
...
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