Skip to content
Snippets Groups Projects
Commit d35ba46d authored by rajatota's avatar rajatota
Browse files

Content-kansion muutos

parent defdda24
No related branches found
No related tags found
No related merge requests found
using System;
using System.Collections.Generic;
using Jypeli;
using Jypeli.Assets;
using Jypeli.Controls;
using Jypeli.Widgets;
using SixLabors.ImageSharp.Processing;
namespace Cat_Rescue;
......@@ -16,7 +11,7 @@ namespace Cat_Rescue;
public class Cat_Rescue : Game
{
// Kenttä merkkijonona
private static readonly String[] level1 = {
private static readonly String[] level1map = {
" YYYYYYYYYYYYYYYYYYYYYYYY ",
" Y X Y ",
" Y 0 X 6 Y ",
......@@ -49,10 +44,10 @@ public class Cat_Rescue : Game
private bool playerMoveCooldown;
// Olioiden kuvat
private Image catImage = LoadImage("Images/arrowleft.png");
private Image guardImage = LoadImage("Images/arrowleft.png");
private Image lightImage = LoadImage("Images/flashlight.png");
private Image playerImage = LoadImage("Images/greenArrow.png");
private Image catImage = LoadImage("arrowleft.jpg");
private Image guardImage = LoadImage("arrowleft.jpg");
private Image lightImage = LoadImage("flashlight.png");
private Image playerImage = LoadImage("greenArrow.png");
// Kartan luomiseen ja käyttämiseen liittyviä muuttujia
private int[,] mapEntities = new int[24,24];
......@@ -134,7 +129,7 @@ public class Cat_Rescue : Game
CreateFloor(new Vector(0, 0), 750, 500, Color.LightGray, 0, -1);
// Luo kartan seinät, sekä kaikki peli interaktiiviset oliot
TileMap tiles = TileMap.FromStringArray(level1);
TileMap tiles = TileMap.FromStringArray(level1map);
for (int i = 5; i < 7; i++)
{
tiles.SetTileMethod(Convert.ToChar((char)(i+48)), CreateGuard, Color.Salmon, i);
......@@ -467,7 +462,7 @@ public class Cat_Rescue : Game
/// <param name="posY">Olion y-koordinaatti</param>
/// <param name="speed">Liikkeen nopeus</param>
/// <returns>Jypelin aliohjelman vaatima palautus (palauttaa null)</returns>
private System.Action MovementFunction(GameObject entity, int[] route, int posX, int posY, int speed)
private void MovementFunction(GameObject entity, int[] route, int posX, int posY, int speed)
{
if (route[2*(route[route.Length-1])] == 1) //ylös
{
......@@ -489,7 +484,6 @@ public class Cat_Rescue : Game
entity.MoveTo(new Vector((-route[2 * (route[route.Length - 1]) + 1] + posX - 11.5) * 32, (posY - 8) * 32), speed);
entity.Angle = Angle.FromRadians(0);
}
return null;
}
......@@ -501,7 +495,7 @@ public class Cat_Rescue : Game
/// <param name="yMove">Liike y-akselin suunnassa</param>
/// <param name="speed">Liikkeen nopeus</param>
/// <returns>Jypelin aliohjelman vaatima palautus (palauttaa null)</returns>
private System.Action PlayerPosSet(int xMove, int yMove, int speed)
private Action PlayerPosSet(int xMove, int yMove, int speed)
{
// Päivittää pelaajan koordinaatit
playerPos[0] += xMove;
......
......@@ -13,6 +13,30 @@
<None Update="Images\arrowleft.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="Contents\arrowleft.jpg">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="Contents\flashlight.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="Contents\floortile32.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="Contents\greenArrow.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="Content\arrowleft.jpg">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="Content\flashlight.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="Content\floortile32.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="Content\greenArrow.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>
<ItemGroup>
......
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