Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
FinancialFreedom
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
mietmiaa
FinancialFreedom
Commits
6efd8932
Commit
6efd8932
authored
2 weeks ago
by
josisaku
Browse files
Options
Downloads
Patches
Plain Diff
fuck ovet
parent
23f498af
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
Financial_Freedom/Financial_Freedom/Financial_Freedom.cs
+38
-26
38 additions, 26 deletions
Financial_Freedom/Financial_Freedom/Financial_Freedom.cs
with
38 additions
and
26 deletions
Financial_Freedom/Financial_Freedom/Financial_Freedom.cs
+
38
−
26
View file @
6efd8932
...
...
@@ -15,6 +15,7 @@ using Jypeli.Widgets;
using
Microsoft.VisualBasic
;
using
Silk.NET.Input
;
using
Silk.NET.OpenAL
;
using
Silk.NET.OpenGL
;
using
Silk.NET.SDL
;
using
SixLabors.ImageSharp.Processing
;
using
Button
=
Jypeli
.
Button
;
...
...
@@ -184,7 +185,7 @@ public class Financial_Freedom : PhysicsGame
private
Label
bjVaihtoehdot
;
private
Label
pelaajanSummalab
;
private
Physics
Object
tero
;
private
Game
Object
tero
;
private
PhysicsObject
door
;
private
List
<
GameObject
>
ovet
;
private
int
selectedDoor
=
-
1
;
...
...
@@ -449,24 +450,24 @@ public class Financial_Freedom : PhysicsGame
ovet
=
new
List
<
GameObject
>();
tero
=
null
;
// Pelaaja
tero
=
new
PlatformCharacter
(
Screen
.
Width
/
9
,
Screen
.
Height
/
4.5
){
Shape
=
Shape
.
Rectangle
,
Position
=
new
Vector
(
Screen
.
Left
+
150
,
Screen
.
Bottom
+
0.6
*(
Screen
.
Height
/
3
)),
IgnoresCollisionResponse
=
true
,
Image
=
LoadImage
(
"tero.png"
)
,
};
Add
(
tero
);
Physics
Object
door
=
new
Physics
Object
(
Screen
.
Width
/
11
,
Screen
.
Height
/
6
);
Game
Object
door
=
new
Game
Object
(
Screen
.
Width
/
11
,
Screen
.
Height
/
6
);
door
.
Shape
=
Shape
.
Rectangle
;
door
.
Color
=
Color
.
Transparent
;
door
.
Position
=
new
Vector
(
Screen
.
Width
/
3.6
,
Screen
.
Bottom
+
0.55
*(
Screen
.
Height
/
3
));
door
.
Tag
=
"Door "
+
(
7
)
+
": "
+
GetDoorDescription
(
7
);
door
.
MakeStatic
();
ovet
.
Add
(
door
);
Add
(
door
);
// Pelaaja
tero
=
new
GameObject
(
Screen
.
Width
/
9
,
Screen
.
Height
/
4.5
){
Shape
=
Shape
.
Rectangle
,
Position
=
new
Vector
(
Screen
.
Left
+
150
,
Screen
.
Bottom
+
0.6
*(
Screen
.
Height
/
3
)),
//IgnoresCollisionResponse = true,
Image
=
LoadImage
(
"tero.png"
)
,
};
Add
(
tero
);
doorPopupLabel
=
new
Label
(
""
){
Position
=
new
Vector
(
0
,
200
),
TextColor
=
Color
.
White
,
...
...
@@ -531,28 +532,41 @@ public class Financial_Freedom : PhysicsGame
LuoPistelaskuri
();
var
pakka
=
LuoPakka
();
SekoitaPakka
(
pakka
);
int
ovicount
=
6
;
// Tekee viis ovea
int
frame
=
5
;
ovet
=
new
List
<
GameObject
>();
double
doorSpacing
=
Screen
.
Width
/
7
;
double
startX
=
-
Screen
.
Width
/
3
;
for
(
int
i
=
0
;
i
<
ovicount
;
i
++)
{
PhysicsObject
door
=
new
PhysicsObject
(
Screen
.
Width
/
10
,
Screen
.
Height
/
3
);
GameObject
doorframe
=
new
GameObject
(
Screen
.
Width
/
10
+
frame
,
Screen
.
Height
/
3
+
frame
);
//door.Shape = Shape.Rectangle;
doorframe
.
Color
=
Color
.
Black
;
//door.Image = LoadImage("door.png");
doorframe
.
Position
=
new
Vector
(
startX
+
i
*
doorSpacing
,
Screen
.
Bottom
+
0.6
*
(
Screen
.
Height
/
3
));
GameObject
door
=
new
GameObject
(
Screen
.
Width
/
10
,
Screen
.
Height
/
3
);
//door.Shape = Shape.Rectangle;
door
.
Color
=
Color
.
Brown
;
door
.
Image
=
LoadImage
(
"door.png"
);
door
.
Position
=
new
Vector
(
startX
+
i
*
doorSpacing
,
Screen
.
Bottom
+
0.75
*
(
Screen
.
Height
/
3
));
door
.
MakeStatic
();
//door.Image = LoadImage("door.png");
door
.
Position
=
new
Vector
(
startX
+
i
*
doorSpacing
,
Screen
.
Bottom
+
0.6
*
(
Screen
.
Height
/
3
));
door
.
Tag
=
"Door "
+
(
i
+
1
)
+
": "
+
GetDoorDescription
(
i
+
1
);
Add
(
door
);
GameObject
knob
=
new
GameObject
(
15
,
15
,
Shape
.
Circle
)
{
Position
=
new
Vector
(
startX
+
i
*
doorSpacing
-
door
.
Width
/
2.5
,
Screen
.
Bottom
+
0.6
*
(
Screen
.
Height
/
3
)),
Color
=
Color
.
Gold
,
};
MiniPeliLogo
(
this
,
door
.
Width
,
door
.
Height
/
2
,
door
.
X
,
door
.
Y
+
(
0.8
*
door
.
Height
),
alkulogot
[
i
],
i
);
Add
(
doorframe
);
Add
(
door
);
Add
(
knob
);
Console
.
WriteLine
(
$"door
{
door
.
Tag
}
added"
);
ovet
.
Add
(
door
);
if
(
i
==
ovicount
-
1
){
CreatePelaaja
();}
}
// popup tekstit
...
...
@@ -565,6 +579,8 @@ public class Financial_Freedom : PhysicsGame
Size
=
new
Vector
(
300
,
50
)
};
CreatePelaaja
();
Keyboard
.
Listen
(
Key
.
Space
,
ButtonState
.
Pressed
,
SelectDoor
,
"Select a door"
);
Keyboard
.
Listen
(
Key
.
Enter
,
ButtonState
.
Pressed
,
SelectDoor
,
"Select a door"
);
...
...
@@ -575,19 +591,15 @@ public class Financial_Freedom : PhysicsGame
void
CreatePelaaja
()
{
tero
=
new
PhysicsObject
(
Screen
.
Width
/
6
,
Screen
.
Height
/
3
)
tero
=
new
GameObject
(
Screen
.
Width
/
6
,
Screen
.
Height
/
4
)
{
Shape
=
Shape
.
Rectangle
,
Position
=
new
Vector
(
Screen
.
Left
+
150
,
Screen
.
Bottom
+
0.
6
*
(
Screen
.
Height
/
3
)),
IgnoresCollisionResponse
=
true
,
Position
=
new
Vector
(
Screen
.
Left
+
150
,
Screen
.
Bottom
+
0.
5
*
(
Screen
.
Height
/
3
)),
//
IgnoresCollisionResponse = true,
Image
=
LoadImage
(
"tero.png"
),
};
Add
(
tero
);
Console
.
WriteLine
(
"tero added"
);
Remove
(
tero
);
Add
(
tero
);
}
// Returns a sample description based on door number.
...
...
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