Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • tie/ohj1/2023s/ohj1ht
  • ojkoykka/ohj1ht
  • lemaline/ohj-1-ht-leo
  • altuoles/ohj1ht
  • ajviitan/ohj1ht
  • esahakki/ohj1ht
  • olieemka/ohj1ht
  • keinkont/ohj1ht
  • jejojuha/ohj1ht
  • parmisee/sidotut-sielut
  • wkoskine/kolikkopeli
  • aimaasko/ohj1ht
  • rapalare/ohj1ht
  • arsepiip/ohj1ht
  • tuliat/ohj1ht
  • khlaine/ohj1ht
  • thesanos/map-harkka
  • taanlaak/ohj1ht
  • avkesti/ohj1ht
  • siniseyt/ohj1ht
  • vesal/ohj1hta
  • anhahyvo/ohj1ht
  • jcvehman/leppakerttu
  • kmjaaske/ohj1ht
  • aapiippu/ohj1ht
  • reelmann/ohj1ht
  • ijkurki/ohj1ht
  • ttkelaw/ohj1ht
  • koallaht/ohj1ht
  • vesal/ohj1ht3
  • pasaikon/ohj-1-ht
  • piipaisa/ohj1ht
  • hkoktany/ohj1ht
  • pamahete/ohj1ht
  • hvriikon/ohj1ht
  • uekolehm/ohj1ht
  • njsaari/ohj1ht
  • lampiemw/rallipeli
  • tkmeskan/ohj1ht
  • aurmirle/ohj1ht
  • grohju/ohj1ht
  • awsorri/ohj1ht
  • jamamokk/ohj1ht
  • sakksama/ohj1ht
  • levalaaa/ohj1ht
  • jpjturtu/ohj1ht
  • vvvkorhv/ohj1ht
  • torkalju/s2023ohj1ht
  • koskelju/ohj1ht
  • eimaki/ohj1ht
  • matuhakk/kauppakassi
  • ollvilhi/ohj1ht
  • nktuorin/ohj1ht
  • elpeviva/ohj1ht
  • kumpuvex/ohj-1-ht
  • mvpalola/ohj1ht
  • pasonnpe/ohj1ht
  • tornhale/ohj1ht
  • iljitesa/ohj1ht
  • ruusii/ohj1ht
  • javirjo/ohj1ht
  • katahe/ohj1ht
  • niktapli/ohj1ht
  • vaalanti/ohj1ht
  • eijuhokk/ohj1ht
  • ricroos/ohj1ht
  • jjmalizy/ohj1ht
  • kirskaxt/ohj1ht
  • haemhaat/ohj1ht
  • korhanjo/ohj1ht
  • runnjuta/ohj1ht
  • jueeasik/ddr-tetris
  • kojalewa/ohj1ht
  • vejokeso/ohj1ht
  • koskeltu/ohj1ht
  • eorhala/ohj1ht
  • kiukklju/ohj1ht
  • oneemasa/ohj1ht
  • kylmsama/ohj1ht
  • mikrkonk/ohj1ht
  • viikarma/ohj1ht
  • jesvilju/ohj1ht
  • viekataj/ohj1ht
  • eerikano/ohj1ht
  • vevejuha/ohj1ht
  • ekpakkal/ohj1ht
  • otjuahos/ohj1ht
  • rajanije/ohj1ht
  • rintahe/ohj1ht
  • mpaavola/ohj1ht
  • lalaajal/ohj1ht
  • tevesiku/ohj1ht
  • malmente/ohj1ht
  • lahdelai/ohj1ht
  • lehtlrvt/syksy-2023-project
  • tuilkark/ohj1ht
  • shurmeri/ohj1ht
  • npura/ohj1ht
  • ljkarna/ohj1ht
  • pejokarj/ohj1ht
  • hytosama/ohj1ht
  • arpevile/ohj1ht
  • tspuhari/ohj1ht
  • meematma/ohj1ht
  • msvekkel/ohj1ht
  • lskumpus/temppelirosvo
  • lskumpus/ohj1ht
  • parikkp/ohj1ht
  • oopummww/sahkonhintalaskuri
  • emjowebe/ohj1ht
  • esolin/ohj1ht
  • anjakinn/ohj1ht
  • eronenve/ohj1ht
  • kautuoee/sijottajat
  • ammarttu/seikkailupeli
  • jhkortww/ohj1ht
  • tiainela/ohj1ht
  • lajoraiv/avaruushyokkaajat
  • vjkoski/ohj1ht
  • limmakyn/ohj1ht
  • kreenk/ohj1ht
  • tynnijtt/ohj1ht
  • jovesaar/ohj1ht
  • jmsutizy/ohj-1-harjoitustyo
  • veijantt/asteroidpossu
  • krseppen/ohj1ht
  • sjlihava/ohj1ht
  • kmpaanan/ohj1ht
  • emelmann/ohj1ht
  • sasavoli/jaatelokesa
  • alarojal/take-them-all
  • huhtjyil/pysakointisimulaattori
  • ttaho/ohj1ht
  • koivulmi/omenat
  • tosajaas/ohj1ht
  • sievanee/ohj1ht
  • vavavima/ohj1ht
  • adjotuhk/ohj1ht
  • heijoshe/ohj1ht
  • sammakko/kohti-aaretonta
  • anneveka/kohti-aaretonta
  • piippoje/lentokonepeli
  • emalmale/frog-jump
  • niemlexy/ohj1ht
  • jasajuyl/ohj1ht
  • peoswasa/pirtin-puolustus
  • mzitting/ohj1ht
  • heikkiaa/ohj1ht
  • mattarma/ohj-1-ht
  • kiiskiev/ohj1ht
  • noelleht/ohj1ht
  • vtsarkka/ohj1ht
  • majuvaaj/ohj-1-ht
  • eiekuiri/ohj1ht2
  • moilanii/ohj1ht
  • jpmoilan/ohj1ht
  • lipavaxy/lipavaxy
  • varauhal/ohj1ht
  • seastrom/ohj1ht3
  • jlinnik/metsakissa
  • mipeolli/ohj1ht
  • majugroh/ohj1ht
  • aijaeeus/ohj1ht
  • anjopitk/ohj1ht
  • ulentika/ohj1ht
  • paajooni/ohj1ht
  • avfresta/ohj-1-harjoitustyo-peli
  • jueesark/ohj1ht
  • sulasaal/ohj1ht
  • tervomhj/ohj1ht
  • pelkkezz/ohj1ht
  • otjalouk/hoylaajanpaluu
  • jupeupol/ohj1ht
  • jojuhemu/ilmailusaatiedotus
  • karnlazy/ohj1ht
  • tornbeev/eetu-t-ht
  • makelkjt/ohj1ht
  • masakoiv/ohj1ht
  • jerantat/ohj1ht
  • reevirta/ohj1ht
  • junijuku/ohj1ht
  • oaaltola/ohj1ht
  • renmikta/ohj1ht
  • kuntekys/ohj1ht
  • emhaauha/ohj1ht
  • lijovest/ohj1ht
  • sjuskivs/ohj1ht
  • joohirvo/ohj1ht
  • rekallio/ohj1ht
  • tuzuneru/ohj1ht
  • jacheryy/vapaa-maailma-ht
  • salompxs/ohj1ht
  • vamavatu/peliprojekti
  • mikalese/project-color
  • vimimalu/ohj1ht
  • vehartzz/ohj1ht
  • anlutuho/vilsun-seikkailu
  • saadmikk/ohj-1-ht-2
  • topevoud/ohj1ht
  • mvhonkzz/kana-kana
  • kopperp/ohj1ht
  • jutalapp/ohj1ht
  • jejajoko/ohj1ht
  • suholaju/Webbi
  • askuisyy/ohj1ht
  • samjaajo/ohj1ht
  • penttu/ohj1ht
  • ekkoykka/ohj1ht
  • tamakark/ohj1ht
  • ckbboman/ohj1ht
  • jomuhaat/ohj-1-ht
  • tslahtin/ohj1ht
  • salmatel/ohj1ht
  • linnahee/pelastapeikoilta
  • pirhonmx/ohj1ht
  • perkem/ohj1ht
  • ssniinim/ohj-1-ht
  • nikaleko/ajope
  • heijohra/ohj1ht
  • kaikkoju/ohj1ht
  • rekanyys/ohj1ht
  • nijomagg/ohj1ht
  • solismpa/ohj1ht
  • enhekorp/ohj1ht
  • myahsumy/h-tohj-1
  • nynalynn/ohj1ht
  • iitojopi/ohj1ht
  • harmjosa/ohj1ht
  • joalsaun/ohj-1-ht
  • jimsebna/ohj1ht
  • jcmbergg/ohj1ht
  • vemaveij/ohj-1-ht
232 results
Show changes
Commits on Source (4)
Showing with 301 additions and 0 deletions
# Default ignored files
/shelf/
/workspace.xml
# Rider ignored files
/projectSettingsUpdater.xml
/.idea.Matopeli.iml
/modules.xml
/contentModel.xml
# 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}") = "Matopeli", "Matopeli\Matopeli.csproj", "{C4026729-15AF-4700-A8DE-52D74250EC17}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{C4026729-15AF-4700-A8DE-52D74250EC17}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C4026729-15AF-4700-A8DE-52D74250EC17}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C4026729-15AF-4700-A8DE-52D74250EC17}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C4026729-15AF-4700-A8DE-52D74250EC17}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
EndGlobal
Matopeli/Matopeli/Content/kenttatausta.png

66.5 KiB

Matopeli/Matopeli/Content/matokeho.png

7.56 KiB

Matopeli/Matopeli/Content/matopaa.png

26.6 KiB

Matopeli/Matopeli/Content/omena.png

58.2 KiB

Matopeli/Matopeli/Content/seina.png

8.82 KiB

using System;
using System.Collections.Generic;
using System.Runtime.ExceptionServices;
using System.Xml.Serialization;
using Jypeli;
using Jypeli.Assets;
using Jypeli.Controls;
using Jypeli.Effects;
using Jypeli.Widgets;
namespace Matopeli;
/// @author Omanimi
/// @version 26.10.2023
/// <summary>
///
/// </summary>
public class Matopeli : PhysicsGame
{
private static readonly string[] kentta ={
"---------------",
"- -",
"- -",
"- -",
"- -",
"- -",
"- m -",
"- -",
"- -",
"- -",
"- -",
"- -",
"- -",
"---------------",
};
private int seinaleveys= 600 / kentta.Length;
private int seinakorkeus = 600 / kentta.Length;
private static readonly Image seinakuva = LoadImage("seina.png");
private static readonly Image matopaakuva = LoadImage("matopaa.png");
private readonly Image matokehokuva = LoadImage("matokeho.png");
private readonly Image omenakuva = LoadImage("omena.png");
private readonly Image kenttatausta = LoadImage("kenttatausta.png");
private LiikkuvaMato mato;
private LiikkuvaMato omena;
public readonly IntMeter pisteet = new IntMeter(0);
public override void Begin()
{
ClearAll();
// Background.Image = LoadImage("kenttatausta");
//LuoTausta();
AloitaUusiPeli();
}
public void AloitaUusiPeli()
{
// pisteet.Value = 0;
TileMap seinat = TileMap.FromStringArray(kentta);
seinat.SetTileMethod('-', LuoSeina);
seinat['m'] = LuoMato;
//seinat.SetTileMethod('k',LuoMatokeho);
seinat.Insert(seinaleveys, seinakorkeus);
Asetaohjaimet();
seinat.Execute(seinaleveys, seinakorkeus);
LuoOmena();
}
private void Asetaohjaimet()
{
Keyboard.Listen(Key.Up, ButtonState.Down, KaannyYlos, "Turn upwards");
Keyboard.Listen(Key.Down, ButtonState.Down, KaannyAlas, "Turn downwards");
Keyboard.Listen(Key.Left, ButtonState.Down, KaannyVasen, "Turn left");
Keyboard.Listen(Key.Right, ButtonState.Down, KaannyOikea, "Turn right");
}
private void KaannyYlos()
{
mato.Velocity = new Vector(0, 150);
mato.Angle = Angle.FromDegrees(90);
}
private void KaannyAlas()
{
mato.Velocity = new Vector(0, -150);
mato.Angle = Angle.FromDegrees(270);
}
private void KaannyVasen()
{
mato.Velocity = new Vector(-150, 0);
mato.Angle = Angle.FromDegrees(180);
}
private void KaannyOikea()
{
mato.Velocity = new Vector(150, 0);
mato.Angle = Angle.FromDegrees(0);
}
private void LuoSeina(Vector paikka, double leveys, double korkeus)
{
PhysicsObject seina = new PhysicsObject(leveys, korkeus);
seina.Position = paikka;
seina.Image = seinakuva;
seina.Tag = "seina";
seina.MakeStatic();
Add(seina);
}
private PhysicsObject LuoMato()
{
mato = new LiikkuvaMato(seinaleveys, seinakorkeus);
mato.Image = Matopeli.matopaakuva;
mato.Tag = "mato";
mato.Velocity = new Vector(150, 0);
AddCollisionHandler(mato, "seina", TormaaSeinaan);
AddCollisionHandler(mato, "omena", SyoOmenan);
return mato;
}
private PhysicsObject LuoOmena()
{
omena = new LiikkuvaMato(seinaleveys, seinakorkeus);
omena.Image = omenakuva;
omena.Tag = "omena";
return omena;
}
private void TormaaSeinaan(IPhysicsObject mato,IPhysicsObject seina)
{
mato.Velocity = new Vector(0,0);
seina.Velocity = new Vector(0, 0);
}
private void SyoOmenan(IPhysicsObject mato, IPhysicsObject omena)
{
omena.Destroy();
}
}
public class LiikkuvaMato : PhysicsObject
{
public LiikkuvaMato(double leveys, double korkeus)
: base(leveys, korkeus)
{
Mass = 10000;
IgnoresGravity = true;
IsUpdated = true;
}
}
\ No newline at end of file
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net7.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Jypeli.NET" Version="11.*"/>
<PackageReference Include="Jypeli.FarseerPhysics.NET" Version="2.*"/>
</ItemGroup>
<ItemGroup>
<Folder Include="Content\" />
</ItemGroup>
<ItemGroup>
<None Update="kuvat\kenttatausta.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="kuvat\matopaa.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="kuvat\matokeho.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="kuvat\omena.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="kuvat\seina.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="Content\seina.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="Content\omena.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="Content\matopaa.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="Content\matokeho.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="Content\kenttatausta.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>
</Project>
#region Using Statements
using System;
using System.Collections.Generic;
using System.Linq;
#endregion
namespace Matopeli
{
/// <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 Matopeli();
game.Run();
}
}
}
\ No newline at end of file
suunnitelma/esimerkkikuva.png

9.92 KiB

suunnitelma/kuvat.png

2.9 KiB