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
2023s
esimerkit
Commits
a2275418
Commit
a2275418
authored
1 year ago
by
Vesa Lappalainen
Browse files
Options
Downloads
Patches
Plain Diff
HangryDog varoituksia pois
parent
cd0d55bf
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
luennot/luento16/HangryDog/HangryDog.cs
+1
-1
1 addition, 1 deletion
luennot/luento16/HangryDog/HangryDog.cs
luennot/luento16/HangryDog/Luokat.cs
+7
-6
7 additions, 6 deletions
luennot/luento16/HangryDog/Luokat.cs
with
8 additions
and
7 deletions
luennot/luento16/HangryDog/HangryDog.cs
+
1
−
1
View file @
a2275418
...
...
@@ -54,6 +54,6 @@ public class HangryDog : PhysicsGame
{
// var luu = new Luu(this, 50, 20, RandomGen.NextVector(Level.BoundingRect));
var
juusto
=
new
Juusto
(
this
,
50
,
RandomGen
.
NextVector
(
Level
.
BoundingRect
));
var
hiiri
=
new
Hiiri
(
this
,
70
,
RandomGen
.
NextVector
(
Level
.
BoundingRect
),
juusto
);
var
_
=
new
Hiiri
(
this
,
70
,
RandomGen
.
NextVector
(
Level
.
BoundingRect
),
juusto
);
}
}
This diff is collapsed.
Click to expand it.
luennot/luento16/HangryDog/Luokat.cs
+
7
−
6
View file @
a2275418
using
System
;
using
Jypeli
;
using
Jypeli.Effects
;
// ReSharper disable MemberCanBeProtected.Global
namespace
HangryDog
;
...
...
@@ -16,7 +17,7 @@ public class Efektit
Timer
timer
=
new
Timer
();
timer
.
Interval
=
3
;
timer
.
Start
();
timer
.
Timeout
+=
delegate
()
timer
.
Timeout
+=
delegate
{
savu
.
Destroy
();
timer
.
Stop
();
...
...
@@ -46,7 +47,7 @@ public class Luu : Syotava
public
Luu
(
PhysicsGame
peli
,
double
w
,
Vector
p
)
:
base
(
peli
,
w
,
p
,
"luu"
,
2000
)
{
this
.
Destroyed
+=
delegate
()
{
Efektit
.
Savuta
(
peli
,
this
);
};
this
.
Destroyed
+=
delegate
{
Efektit
.
Savuta
(
peli
,
this
);
};
}
}
...
...
@@ -56,17 +57,17 @@ public class Juusto : Syotava
public
Juusto
(
PhysicsGame
peli
,
double
w
,
Vector
p
)
:
base
(
peli
,
w
,
p
,
"juusto"
,
50000
)
{
this
.
Destroyed
+=
delegate
()
{
Efektit
.
Savuta
(
peli
,
this
);
};
this
.
Destroyed
+=
delegate
{
Efektit
.
Savuta
(
peli
,
this
);
};
}
}
public
class
Elain
:
PhysicsObject
// PlatformCharacter
{
private
string
nimi
;
private
readonly
string
nimi
;
public
string
Nimi
{
get
{
return
nimi
;
}
}
private
bool
vasen
=
false
;
private
bool
vasen
;
public
Elain
(
PhysicsGame
peli
,
double
w
,
Vector
p
,
string
nimi
,
string
tunniste
)
:
base
(
w
,
w
)
...
...
@@ -149,7 +150,7 @@ public class Hiiri : Elain
{
this
.
LifetimeLeft
=
new
TimeSpan
(
0
,
0
,
0
,
10
);
peli
.
AddCollisionHandler
(
this
,
"juusto"
,
Syo
);
this
.
Destroyed
+=
delegate
()
{
new
Luu
(
peli
,
Width
*
0.8
,
Position
);
};
this
.
Destroyed
+=
delegate
{
var
_
=
new
Luu
(
peli
,
Width
*
0.8
,
Position
);
};
FollowerBrain
brain
=
new
FollowerBrain
(
juusto
);
this
.
Brain
=
brain
;
}
...
...
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