Skip to content
Snippets Groups Projects
Commit 46141e47 authored by Hanki Sakari's avatar Hanki Sakari
Browse files

testi

parent 06109006
No related branches found
No related tags found
No related merge requests found
# Default ignored files
/shelf/
/workspace.xml
# Rider ignored files
/projectSettingsUpdater.xml
/modules.xml
/contentModel.xml
/.idea.KelaCombat.iml
# Editor-based HTTP Client requests
/httpRequests/
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="UserContentModel">
<attachedFolders />
<explicitIncludes />
<explicitExcludes />
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$/.." vcs="Git" />
</component>
</project>
\ No newline at end of file

Microsoft Visual Studio Solution File, Format Version 12.00
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "KelaCombat", "KelaCombat\KelaCombat.csproj", "{FCA55966-05CA-4283-A710-B896BF8F5632}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "KelacombatUusi", "KelacombatUusi\KelacombatUusi.csproj", "{F19A3636-29EE-45C1-BE40-20C63E42A556}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{FCA55966-05CA-4283-A710-B896BF8F5632}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{FCA55966-05CA-4283-A710-B896BF8F5632}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FCA55966-05CA-4283-A710-B896BF8F5632}.Release|Any CPU.ActiveCfg = Release|Any CPU
{FCA55966-05CA-4283-A710-B896BF8F5632}.Release|Any CPU.Build.0 = Release|Any CPU
{F19A3636-29EE-45C1-BE40-20C63E42A556}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F19A3636-29EE-45C1-BE40-20C63E42A556}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F19A3636-29EE-45C1-BE40-20C63E42A556}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F19A3636-29EE-45C1-BE40-20C63E42A556}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
EndGlobal
KelaCombat/KelaCombatTesti/Content/Kelabotti.png

5.03 KiB

KelaCombat/KelaCombatTesti/Content/Pelaaja.png

2.43 KiB

using System;
using System.Collections.Generic;
using Jypeli;
using Jypeli.Assets;
using Jypeli.Controls;
using Jypeli.Widgets;
using Silk.NET.SDL;
using Color = Jypeli.Color;
namespace KelaCombatTesti;
/// @author Sakari
/// @version 17.02.2025
/// <summary>
///
/// </summary>
public class KelaCombatTesti : PhysicsGame
{
PlatformCharacter pelaaja;
private Image KelabottiKuva = LoadImage("Kelabotti");
private Image PelaajaKuva = LoadImage("Pelaaja.png");
public override void Begin()
{
LuoKentta();
LuoKelabotti();
Keyboard.Listen(Key.A, ButtonState.Down, LiikuVasemmalle, null, new Vector());
Keyboard.Listen(Key.D, ButtonState.Down, LiikuOikealle, null, new Vector());
Keyboard.Listen(Key.W, ButtonState.Down, Hyppaa, null, new Vector());
//Keyboard.Listen(Key.S, ButtonState.Down, LiikutaPelaajaa, null, new Vector(0, -1000));
Keyboard.Listen(Key.Escape, ButtonState.Pressed, ConfirmExit, "Lopeta peli");
void LiikuVasemmalle(Vector vektori)
{
pelaaja.Walk(-100);
}
void LiikuOikealle(Vector vektori)
{
pelaaja.Walk(100);
}
void Hyppaa(Vector vektori)
{
pelaaja.Jump(300.0);
}
}
void LuoKentta()
{
Level.BackgroundColor = Color.Pink;
Gravity = new Vector(0, -981.0);
PhysicsObject vasenReuna = Level.CreateLeftBorder();
vasenReuna.Restitution = 0.0;
vasenReuna.KineticFriction = 0.0;
vasenReuna.IsVisible = false;
PhysicsObject oikeaReuna = Level.CreateRightBorder();
oikeaReuna.Restitution = 0.0;
oikeaReuna.KineticFriction = 0.0;
oikeaReuna.IsVisible = false;
PhysicsObject ylaReuna = Level.CreateTopBorder();
ylaReuna.Restitution = 0.0;
ylaReuna.KineticFriction = 0.0;
ylaReuna.IsVisible = false;
PhysicsObject alaReuna = Level.CreateBottomBorder();
alaReuna.Restitution = 1.0;
alaReuna.IsVisible = false;
alaReuna.KineticFriction = 0.0;
pelaaja = LuoPelaaja(0.0, 0.0);
pelaaja.Acceleration = new Vector(1, 0);
}
PlatformCharacter LuoPelaaja(double x, double y)
{
PlatformCharacter pelaaja = new PlatformCharacter(50.0, 100.0);
pelaaja.Image = PelaajaKuva;
pelaaja.Mass = 1.0;
pelaaja.Image = LoadImage("Pelaaja.png");
pelaaja.Shape = Shape.Rectangle;
pelaaja.Color = Color.Black;
pelaaja.X = x;
pelaaja.Y = y;
Add(pelaaja);
return pelaaja;
}
PlatformCharacter LuoKelabotti()
{
PlatformCharacter Kelabotti = new PlatformCharacter(80.0, 80.0);
Kelabotti.Color = Color.Orange;
Kelabotti.Image = KelabottiKuva;
Kelabotti.MirrorImage();
Add(Kelabotti);
FollowerBrain seuraajanAivot = new FollowerBrain(pelaaja);
seuraajanAivot.Speed = 100;
Kelabotti.Brain = seuraajanAivot;
return Kelabotti;
}
}
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Jypeli.NET" Version="11.*"/>
<PackageReference Include="Jypeli.FarseerPhysics.NET" Version="2.*"/>
</ItemGroup>
<ItemGroup>
<None Update="KelaCombatkuvat\Pelaaja.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="Content\Pelaaja.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="Content\Kelabotti.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
</Project>
#region Using Statements
using System;
using System.Collections.Generic;
using System.Linq;
#endregion
namespace KelaCombatTesti
{
/// <summary>
/// The main class.
/// </summary>
public static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
using var game = new KelaCombatTesti();
game.Run();
}
}
}
\ No newline at end of file
......@@ -7,7 +7,7 @@ Tekijät: Sakari Hanki ja Salla Laine
Työ git-varaston osoite: <https://gitlab.jyu.fi/hankssxs/ohj1ht>
Pelin nimi: Kela Combat: Fight for Opintonopat
Pelin nimi: Kela Combat: Fight for the Opintonopat
Pelialusta: Windows
......@@ -36,12 +36,12 @@ Helmikuu
Maaliskuu
- (Tavoite 1)
- (Tavoite 2)
- (Tavoite 1: Hp mekaniikat ja Opintonoppa-laskuri)
- (Tavoite 2: taistelumekaniikat)
- (Tavoite 3)
Jos aikaa jää
- (Tavoite 1)
- (Tavoite 2)
- (Tavoite 1: animaatiot)
- (Tavoite 2: lisää vihollistyyppejä)
- (Tavoite 3)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment