Skip to content
Snippets Groups Projects
Commit 2680b1d0 authored by Yli-Tainio Janne Sakri Juhani's avatar Yli-Tainio Janne Sakri Juhani
Browse files

olio ja kartta, sekä kolikot

parent c2095169
No related branches found
No related tags found
No related merge requests found
Showing
with 178 additions and 1 deletion
<?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="RiderProjectSettingsUpdater">
<option name="vcsConfiguration" value="2" />
</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
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="AutoGeneratedRunConfigurationManager">
<projectFile>kolikkogoblin/kolikkogoblin.csproj</projectFile>
</component>
<component name="AutoImportSettings">
<option name="autoReloadType" value="SELECTIVE" />
</component>
<component name="ChangeListManager">
<list default="true" id="0cb08879-2df4-4f3a-a1a9-8178f387d135" name="Changes" comment="">
<change afterPath="$PROJECT_DIR$/kolikkogoblin/content/goblin1.png" afterDir="false" />
<change afterPath="$PROJECT_DIR$/kolikkogoblin/content/goblin2.png" afterDir="false" />
<change afterPath="$PROJECT_DIR$/kolikkogoblin/content/goblin3.png" afterDir="false" />
<change beforePath="$PROJECT_DIR$/kolikkogoblin/kolikkogoblin.cs" beforeDir="false" afterPath="$PROJECT_DIR$/kolikkogoblin/kolikkogoblin.cs" afterDir="false" />
<change beforePath="$PROJECT_DIR$/kolikkogoblin/kolikkogoblin.csproj" beforeDir="false" afterPath="$PROJECT_DIR$/kolikkogoblin/kolikkogoblin.csproj" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
<option name="LAST_RESOLUTION" value="IGNORE" />
</component>
<component name="Git.Settings">
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$/.." />
</component>
<component name="ProjectColorInfo">{
&quot;associatedIndex&quot;: 4
}</component>
<component name="ProjectId" id="2WqblizK0xS1l6qxX20E3VMkyn9" />
<component name="ProjectViewState">
<option name="hideEmptyMiddlePackages" value="true" />
<option name="showLibraryContents" value="true" />
</component>
<component name="PropertiesComponent">{
&quot;keyToString&quot;: {
&quot;RunOnceActivity.OpenProjectViewOnStart&quot;: &quot;true&quot;,
&quot;RunOnceActivity.ShowReadmeOnStart&quot;: &quot;true&quot;,
&quot;WebServerToolWindowFactoryState&quot;: &quot;false&quot;,
&quot;git-widget-placeholder&quot;: &quot;main&quot;,
&quot;node.js.detected.package.eslint&quot;: &quot;true&quot;,
&quot;node.js.detected.package.tslint&quot;: &quot;true&quot;,
&quot;node.js.selected.package.eslint&quot;: &quot;(autodetect)&quot;,
&quot;node.js.selected.package.tslint&quot;: &quot;(autodetect)&quot;,
&quot;vue.rearranger.settings.migration&quot;: &quot;true&quot;
},
&quot;keyToStringList&quot;: {
&quot;rider.external.source.directories&quot;: [
&quot;C:\\Users\\Janne\\AppData\\Roaming\\JetBrains\\Rider2023.2\\resharper-host\\DecompilerCache&quot;,
&quot;C:\\Users\\Janne\\AppData\\Roaming\\JetBrains\\Rider2023.2\\resharper-host\\SourcesCache&quot;,
&quot;C:\\Users\\Janne\\AppData\\Local\\Symbols\\src&quot;
]
}
}</component>
<component name="RunManager">
<configuration name="kolikkogoblin" type="DotNetProject" factoryName=".NET Project">
<option name="EXE_PATH" value="" />
<option name="PROGRAM_PARAMETERS" value="" />
<option name="WORKING_DIRECTORY" value="" />
<option name="PASS_PARENT_ENVS" value="1" />
<option name="USE_EXTERNAL_CONSOLE" value="0" />
<option name="USE_MONO" value="0" />
<option name="RUNTIME_ARGUMENTS" value="" />
<option name="PROJECT_PATH" value="$PROJECT_DIR$/kolikkogoblin/kolikkogoblin.csproj" />
<option name="PROJECT_EXE_PATH_TRACKING" value="1" />
<option name="PROJECT_ARGUMENTS_TRACKING" value="1" />
<option name="PROJECT_WORKING_DIRECTORY_TRACKING" value="1" />
<option name="PROJECT_KIND" value="DotNetCore" />
<option name="PROJECT_TFM" value="" />
<method v="2">
<option name="Build" />
</method>
</configuration>
</component>
<component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="application-level" UseSingleDictionary="true" transferred="true" />
<component name="TaskManager">
<task active="true" id="Default" summary="Default task">
<changelist id="0cb08879-2df4-4f3a-a1a9-8178f387d135" name="Changes" comment="" />
<created>1697463209444</created>
<option name="number" value="Default" />
<option name="presentableId" value="Default" />
<updated>1697463209444</updated>
<workItem from="1697463210526" duration="3835000" />
<workItem from="1697815198616" duration="14000" />
<workItem from="1697815218976" duration="1443000" />
</task>
<servers />
</component>
<component name="TypeScriptGeneratedFilesManager">
<option name="version" value="3" />
</component>
<component name="VcsManagerConfiguration">
<option name="CLEAR_INITIAL_COMMIT_MESSAGE" value="true" />
</component>
</project>
\ No newline at end of file
kolikkogoblin/kolikkogoblin/content/goblin1.png

4.01 KiB

kolikkogoblin/kolikkogoblin/content/goblin2.png

4.2 KiB

kolikkogoblin/kolikkogoblin/content/goblin3.png

4.72 KiB

kolikkogoblin/kolikkogoblin/content/kolikko.png

903 B

kolikkogoblin/kolikkogoblin/content/tasonkuva.png

8.06 KiB

......@@ -16,8 +16,52 @@ public class kolikkogoblin : PhysicsGame
{
public override void Begin()
{
// Kirjoita ohjelmakoodisi tähän
Level.Background.Color = Color.Black;
PhysicsObject goblintorso = new PhysicsObject(20, 40);
Add(goblintorso);
goblintorso.Color = Color.Green;
goblintorso.AddCollisionIgnoreGroup(1);
Image goblinkuva = LoadImage("goblin1");
void LuoKentta()
{
TileMap ruudut = TileMap.FromLevelAsset("kentta1");
ruudut.SetTileMethod('P', LuoPelaaja);
ruudut.SetTileMethod('#', LuoPalikka);
ruudut.SetTileMethod('*', Luokolikko);
ruudut.Execute(20, 20);
}
void LuoPelaaja(Vector paikka, double leveys, double korkeus)
{
goblintorso = new PlatformCharacter(10, 10);
goblintorso.Position = paikka;
AddCollisionHandler(goblintorso, "kolikko", tormaakolikkoon);
Add(goblintorso);
}
void LuoPalikka(Vector paikka, double leveys, double korkeus)
{
PhysicsObject taso = PhysicsObject.CreateStaticObject(leveys, korkeus);
taso.Position = paikka;
Image tasonkuva = LoadImage("tasonkuva");
taso.Image = tasonkuva;
Add(taso);
}
void Luokolikko(Vector paikka, double leveys, double korkeus)
{
PhysicsObject kolikko = new PhysicsObject(5, 5);
kolikko.IgnoresCollisionResponse = true;
kolikko.Position = paikka;
Image kolikonkuva = LoadImage("kolikko");
kolikko.Image = kolikonkuva;
kolikko.Tag = "tahti";
Add(kolikko, 1);
}
PhoneBackButton.Listen(ConfirmExit, "Lopeta peli");
Keyboard.Listen(Key.Escape, ButtonState.Pressed, ConfirmExit, "Lopeta peli");
}
......
......@@ -10,4 +10,24 @@
<PackageReference Include="Jypeli.FarseerPhysics.NET" Version="2.*"/>
</ItemGroup>
<ItemGroup>
<None Update="content\goblin1.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="content\goblin2.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="content\goblin3.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="content\kolikko.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="content\tasonkuva.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
</Project>
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