Skip to content
Snippets Groups Projects
Commit 9f4cee50 authored by Vesa Lappalainen's avatar Vesa Lappalainen :bicyclist:
Browse files

live 23 alku

parent e0246a2e
No related branches found
No related tags found
No related merge requests found
#region Using Statements
using System;
using System.Collections.Generic;
using System.Linq;
#endregion
namespace Pallot;
/// <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 Pallot();
game.Run();
}
}
using System;
using System.Collections.Generic;
using Jypeli;
using Jypeli.Assets;
using Jypeli.Controls;
using Jypeli.Effects;
using Jypeli.Widgets;
namespace Pallot;
public class Pallot : PhysicsGame
{
private PhysicsObject pallo;
private double x = -200;
public override void Begin()
{
PhysicsObject p = Luo(this, 100, 100);
Lisaa();
pallo.Color = Color.Yellow;
Lisaa();
Vaihda(Color.Red);
Keyboard.Listen(Key.Escape, ButtonState.Pressed, ConfirmExit, "Lopeta peli");
}
public void Vaihda(Color c)
{
pallo.Color = c;
}
public void Lisaa()
{
pallo = Luo(this, x += 100, -200);
}
public static PhysicsObject Luo(Game peli, double x, double y)
{
PhysicsObject o = new PhysicsObject(70, 70, Shape.Circle);
peli.Add(o);
o.Position = new Vector(x, y);
return o;
}
}
\ No newline at end of file
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<PublishReadyToRun>false</PublishReadyToRun>
<TieredCompilation>false</TieredCompilation>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Jypeli.NET" Version="11.*" />
<PackageReference Include="Jypeli.FarseerPhysics.NET" Version="2.*" />
</ItemGroup>
</Project>

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.3.32901.215
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Pallot", "Pallot\Pallot.csproj", "{341B73A9-0AB2-4BF4-9F22-960F2E90521B}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{341B73A9-0AB2-4BF4-9F22-960F2E90521B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{341B73A9-0AB2-4BF4-9F22-960F2E90521B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{341B73A9-0AB2-4BF4-9F22-960F2E90521B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{341B73A9-0AB2-4BF4-9F22-960F2E90521B}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {009C15EB-C67D-4D1F-ACDA-EBB4C1CB93F9}
EndGlobalSection
EndGlobal
......@@ -5,21 +5,20 @@ using System.Linq;
#endregion
namespace Program
namespace Pallot;
/// <summary>
/// The main class.
/// </summary>
public static class Program
{
/// <summary>
/// The main class.
/// The main entry point for the application.
/// </summary>
public static class Program
[STAThread]
static void Main()
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
using (var game = new Pallot())
game.Run();
}
using (var game = new Pallot())
game.Run();
}
}
using Jypeli;
namespace Pallot;
public class Pallot : PhysicsGame
{
private double x = -200;
......
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