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

luento23

parent 4cf2dac4
No related branches found
No related tags found
No related merge requests found
Showing
with 225 additions and 7 deletions
# Default ignored files
/shelf/
/workspace.xml
# Rider ignored files
/projectSettingsUpdater.xml
/modules.xml
/contentModel.xml
/.idea.live23.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="Encoding" addBOMForNewFiles="with BOM under Windows, with no BOM otherwise" />
</project>
\ No newline at end of file
<?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
#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();
}
}
}
\ No newline at end of file
using Jypeli;
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>net7.0</TargetFramework>
</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
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Pallot", "Pallot\Pallot.csproj", "{D4E95686-BC90-49E4-820D-900726AA2276}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{D4E95686-BC90-49E4-820D-900726AA2276}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D4E95686-BC90-49E4-820D-900726AA2276}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D4E95686-BC90-49E4-820D-900726AA2276}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D4E95686-BC90-49E4-820D-900726AA2276}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
EndGlobal
# Default ignored files
/shelf/
/workspace.xml
# Rider ignored files
/contentModel.xml
/.idea.luento23.iml
/modules.xml
/projectSettingsUpdater.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="Encoding" addBOMForNewFiles="with BOM under Windows, with no BOM otherwise" />
</project>
\ No newline at end of file
<?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
......@@ -3,15 +3,14 @@
namespace Pallot;
public class Pallot : PhysicsGame
{
private double x = -200;
public override void Begin()
{
double x = -200;
PhysicsObject pallo;
PhysicsObject p = Luo(this, 100, 100);
pallo = Lisaa();
Luo(this, 100, 100);
(pallo, x) = Lisaa(this, x);
pallo.Color = Color.Yellow;
pallo = Lisaa();
(pallo, _) = Lisaa(this, x);
Vaihda(pallo, Color.Red);
Keyboard.Listen(Key.Escape, ButtonState.Pressed, ConfirmExit, "Lopeta peli");
}
......@@ -23,9 +22,9 @@ public class Pallot : PhysicsGame
}
public PhysicsObject Lisaa()
public static (PhysicsObject, double) Lisaa(Game peli, double x)
{
return Luo(this, x += 100, -200);
return (Luo(peli, x += 100, -200), x);
}
......
# Default ignored files
/shelf/
/workspace.xml
# Rider ignored files
/projectSettingsUpdater.xml
/modules.xml
/.idea.luento24.iml
/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="Encoding" addBOMForNewFiles="with BOM under Windows, with no BOM otherwise" />
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="UserContentModel">
<attachedFolders />
<explicitIncludes />
<explicitExcludes />
</component>
</project>
\ No newline at end of file
<component name="libraryTable">
<library name="androidx.activity.activity">
<CLASSES>
<root url="file://$USER_HOME$/AppData/Local/Temp/JetBrains/xamarinAarPackages/androidx.activity.activity/classes.jar" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>
\ No newline at end of file
<component name="libraryTable">
<library name="androidx.annotation.annotation">
<CLASSES>
<root url="jar://$USER_HOME$/.nuget/packages/xamarin.androidx.annotation/1.1.0.7/jar/androidx.annotation.annotation.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>
\ No newline at end of file
<component name="libraryTable">
<library name="androidx.appcompat.appcompat">
<CLASSES>
<root url="file://$USER_HOME$/AppData/Local/Temp/JetBrains/xamarinAarPackages/androidx.appcompat.appcompat/classes.jar" />
<root url="file://$USER_HOME$/AppData/Local/Temp/JetBrains/xamarinAarPackages/androidx.appcompat.appcompat/res" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>
\ No newline at end of file
<component name="libraryTable">
<library name="androidx.appcompat.appcompat-resources">
<CLASSES>
<root url="file://$USER_HOME$/AppData/Local/Temp/JetBrains/xamarinAarPackages/androidx.appcompat.appcompat-resources/classes.jar" />
<root url="file://$USER_HOME$/AppData/Local/Temp/JetBrains/xamarinAarPackages/androidx.appcompat.appcompat-resources/res" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>
\ No newline at end of file
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