Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
esimerkit
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
tie
ohj1
2024s
esimerkit
Commits
803f00d7
Commit
803f00d7
authored
4 months ago
by
Vesa Lappalainen
Browse files
Options
Downloads
Patches
Plain Diff
luento23 loppu
parent
2ade762a
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
luennot/live23/Pallot/Pallot.cs
+11
-16
11 additions, 16 deletions
luennot/live23/Pallot/Pallot.cs
with
11 additions
and
16 deletions
luennot/live23/Pallot/Pallot.cs
+
11
−
16
View file @
803f00d7
...
...
@@ -3,32 +3,27 @@ namespace Pallot;
public
class
Pallot
:
PhysicsGame
{
private
PhysicsObject
pallo
;
private
double
x
=
-
200
;
public
override
void
Begin
()
{
PhysicsObject
p
=
Luo
(
this
,
100
,
100
);
Lisaa
();
PhysicsObject
pallo
;
double
x
=
-
200
;
Luo
(
this
,
100
,
100
);
(
pallo
,
x
)
=
Lisaa
(
this
,
x
);
pallo
.
Color
=
Color
.
Yellow
;
Lisaa
(
);
Vaihda
(
Color
.
Red
);
(
pallo
,
_
)
=
Lisaa
(
this
,
x
);
Vaihda
(
pallo
,
Color
.
Red
);
Keyboard
.
Listen
(
Key
.
Escape
,
ButtonState
.
Pressed
,
ConfirmExit
,
"Lopeta peli"
);
}
public
void
Vaihda
(
Color
c
)
public
static
void
Vaihda
(
PhysicsObject
pallo
,
Color
c
)
{
pallo
.
Color
=
c
;
}
public
void
Lisaa
()
public
static
(
PhysicsObject
,
double
)
Lisaa
(
Pallot
peli
,
double
x
)
{
pallo
=
Luo
(
this
,
x
+=
100
,
-
200
);
double
uusi_x
=
x
+
100
;
PhysicsObject
p
=
Luo
(
peli
,
uusi_x
,
-
200
);
return
(
p
,
uusi_x
);
}
public
static
PhysicsObject
Luo
(
Game
peli
,
double
x
,
double
y
)
{
PhysicsObject
o
=
new
PhysicsObject
(
70
,
70
,
Shape
.
Circle
);
...
...
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