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
jimsebna
ohj1ht
Commits
4755598c
Commit
4755598c
authored
4 months ago
by
Mäkinen Maria Isabella
Browse files
Options
Downloads
Patches
Plain Diff
Lisäsin olioita
parent
2d14929f
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
SimulaattoriPeli/SimulaattoriPeli/SimulaattoriPeli.cs
+14
-7
14 additions, 7 deletions
SimulaattoriPeli/SimulaattoriPeli/SimulaattoriPeli.cs
with
14 additions
and
7 deletions
SimulaattoriPeli/SimulaattoriPeli/SimulaattoriPeli.cs
+
14
−
7
View file @
4755598c
...
@@ -69,20 +69,27 @@ public class SimulaattoriPeli : PhysicsGame
...
@@ -69,20 +69,27 @@ public class SimulaattoriPeli : PhysicsGame
PhysicsObject
kissa
=
new
PhysicsObject
(
20.0
,
20.0
);
PhysicsObject
kissa
=
new
PhysicsObject
(
20.0
,
20.0
);
kissa
.
Shape
=
Shape
.
Circle
;
kissa
.
Shape
=
Shape
.
Circle
;
kissa
.
Color
=
Color
.
Red
;
kissa
.
Color
=
Color
.
White
;
Add
(
kissa
);
Add
(
kissa
);
//Tehdään uudet satunnaisaivot, jotka liikkuvat nopeudella 200
RandomMoverBrain
satunnaisaivot
=
new
RandomMoverBrain
(
200
);
RandomMoverBrain
satunnaisaivot
=
new
RandomMoverBrain
(
200
);
//Ominaisuuksien muokkaaminen
satunnaisaivot
.
ChangeMovementSeconds
=
3
;
satunnaisaivot
.
ChangeMovementSeconds
=
3
;
//Aivot käyttöön oliolle
kissa
.
Brain
=
satunnaisaivot
;
kissa
.
Brain
=
satunnaisaivot
;
Vector
nopeus
=
new
Vector
(
100
,
100
);
Vector
nopeus
=
new
Vector
(
100
,
100
);
kissa
.
Hit
(
kissa
.
Mass
*
nopeus
);
kissa
.
Hit
(
kissa
.
Mass
*
nopeus
);
PhysicsObject
archer
=
new
PhysicsObject
(
20.0
,
20.0
);
archer
.
Shape
=
Shape
.
Circle
;
archer
.
Color
=
Color
.
Black
;
Add
(
archer
);
FollowerBrain
seuraajaaivot
=
new
FollowerBrain
(
kissa
);
satunnaisaivot
.
ChangeMovementSeconds
=
3
;
archer
.
Brain
=
seuraajaaivot
;
//archer seuraa, kunnes target on niin lähellä, että se voi ampua, sitten se pysähtyy
archer
.
Hit
(
archer
.
Mass
*
nopeus
);
seuraajaaivot
.
StopWhenTargetClose
=
true
;
Label
hahmotOtsikko
=
new
Label
(
"Characters"
);
//teksti hahmojen alueelle
Label
hahmotOtsikko
=
new
Label
(
"Characters"
);
//teksti hahmojen alueelle
hahmotOtsikko
.
TextColor
=
Color
.
Black
;
// tekstin väri
hahmotOtsikko
.
TextColor
=
Color
.
Black
;
// tekstin väri
hahmotOtsikko
.
Position
=
new
Vector
(
Hahmot
.
X
,
Hahmot
.
Top
-
40
);
// tekstin sijainti
hahmotOtsikko
.
Position
=
new
Vector
(
Hahmot
.
X
,
Hahmot
.
Top
-
40
);
// tekstin sijainti
...
...
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