Commit a53cbf99 authored by Maxime's avatar Maxime
Browse files

add new level, debug on F3, joystick locked with gravity

parent 18577f03
......@@ -3,7 +3,7 @@
<tileset firstgid="1" source="../tiles.tsx"/>
<layer id="1" name="Calque de Tuiles 1" width="24" height="15">
<data encoding="csv">
2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
2,2,2,2,2,2,2,2,2,0,0,0,0,0,0,2,2,2,2,2,2,2,2,2,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,3,3,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,3,0,0,3,0,0,0,0,0,0,0,0,0,0,
......@@ -20,6 +20,5 @@
2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2
</data>
</layer>
<objectgroup id="2" name="Calque d'Objets 1">
</objectgroup>
<objectgroup id="2" name="Calque d'Objets 1"/>
</map>
<?xml version="1.0" encoding="UTF-8"?>
<map version="1.0" tiledversion="1.7.2" orientation="orthogonal" renderorder="right-down" width="24" height="15" tilewidth="32" tileheight="32" infinite="0" nextlayerid="4" nextobjectid="3">
<tileset firstgid="1" source="../tiles.tsx"/>
<layer id="1" name="Calque de Tuiles 1" width="24" height="15">
<data encoding="csv">
2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,3,0,0,3,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,3,0,0,3,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,3,0,0,3,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,3,0,0,3,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,3,0,0,0,0,0,0,3,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,3,0,0,0,0,3,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,3,3,3,3,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
2,2,2,2,2,2,2,2,2,0,0,0,0,0,0,2,2,2,2,2,2,2,2,2
</data>
</layer>
<objectgroup id="2" name="Calque d'Objets 1"/>
</map>
......@@ -133,6 +133,9 @@
<None Include="Data\Levels\world0.tmx">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="Data\Levels\World0\world0_1-1.tmx">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="Data\Levels\World0\world0_0-0.tmx">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
......
......@@ -19,13 +19,7 @@ namespace ZZZZZZ.GUI
{
case Key.F3:
AppConfig.Current.DrawDebug = !AppConfig.Current.DrawDebug;
break;
case Key.F5:
GameManager.Current.RemotePlayerManager = new RemotePlayerManager(new RemoteCharacter(), GameManager.Current.LevelManager);
Task.Run(() => GameManager.Current.Server.Connect("127.0.0.1", 3000));
break;
case Key.F6:
Task.Run(() => GameManager.Current.Server.Disconnect());
GameManager.Current.Camera.Zoom = AppConfig.Current.DrawDebug ? 1 : 4.2f;
break;
case Key.F10:
Task.Run(() => GameManager.Current.Exit());
......
......@@ -24,7 +24,6 @@ namespace ZZZZZZ
public ExtraFunction ExtraFunction { get; private set; }
public LocalPlayerManager LocalPlayerManager { get; set; }
public RemotePlayerManager RemotePlayerManager { get; set; }
public IServer Server { get; private set; }
public IWebAPI API { get; private set; }
public LevelManager LevelManager { get; private set; }
public Navigation Navigation { get; private set; }
......
......@@ -27,25 +27,7 @@ namespace ZZZZZZ
LocalPlayerManager = null;
}
public bool ConnectToServer(string ip, int port)
{
Server = new ServerUDP();
var connected = Server.Connect(ip, port);
if (connected)
{
RemotePlayerManager = new RemotePlayerManager(new RemoteCharacter(), Current.LevelManager);
LocalPlayerManager = new LocalPlayerManager(new LocalCharacter(), new KeyboardInput(), LevelManager);
Server.PlayerManager = LocalPlayerManager;
Navigation.Toast.Show("Connected");
}
else
{
Navigation.Toast.Show($"Can't connect to {ip}:{port}");
}
return connected;
}
public void ConnectToAPI(string gamecode = "")
{
Task.Run(() =>
......
......@@ -12,7 +12,7 @@ namespace ZZZZZZ.Graphics
GameManager.Current.Scene.CreateChild().AddComponent(this);
Orthographic = true;
//Zoom = 4.2f;
Zoom = 4.2f;
Node.Position = new Vector3(3.85f, 2.4f, -1f);
}
}
......
......@@ -30,9 +30,9 @@ namespace ZZZZZZ.Inputs
{
get
{
if (leftJoystick.X < -0.5f)
if (leftJoystick.LockedY && leftJoystick.X < -0.5f || leftJoystick.LockedX && leftJoystick.Y < -0.5f)
return Movement.Left;
else if (leftJoystick.X > 0.5f)
if (leftJoystick.LockedY && leftJoystick.X > 0.5f || leftJoystick.LockedX && leftJoystick.Y > 0.5f)
return Movement.Right;
return Movement.None;
}
......@@ -51,6 +51,9 @@ namespace ZZZZZZ.Inputs
oldGravity = GravityDirection.Haut;
else if (rightJoystick.Y > 0.5f)
oldGravity = GravityDirection.Bas;
leftJoystick.LockedY = oldGravity == GravityDirection.Haut || oldGravity == GravityDirection.Bas;
leftJoystick.LockedX = oldGravity == GravityDirection.Droite || oldGravity == GravityDirection.Gauche;
return oldGravity;
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment