From e0c138832836e84141d6b6bfa391724332e473b8 Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Sat, 13 Mar 2021 02:33:02 +0100 Subject: [PATCH] finished the overworld --- GreatSpringGameJam/Content/Maps/Level1.tmx | 4 +- GreatSpringGameJam/Content/Maps/Overworld.tmx | 67 ++++++++++-------- .../Content/Tilesets/World.aseprite | Bin 2715 -> 2748 bytes GreatSpringGameJam/Content/Tilesets/World.png | Bin 3576 -> 3608 bytes GreatSpringGameJam/Content/Tilesets/World.tsx | 38 ---------- GreatSpringGameJam/GameImpl.cs | 45 +++++++++--- GreatSpringGameJam/Player.cs | 31 +++++--- 7 files changed, 96 insertions(+), 89 deletions(-) diff --git a/GreatSpringGameJam/Content/Maps/Level1.tmx b/GreatSpringGameJam/Content/Maps/Level1.tmx index 7dafb78..b017e9b 100644 --- a/GreatSpringGameJam/Content/Maps/Level1.tmx +++ b/GreatSpringGameJam/Content/Maps/Level1.tmx @@ -27,8 +27,8 @@ 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,38,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,38,1,2,2,3,0,0,0,0,0,0,0,0,1,2,2,2,2,3,38,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,33,34,35,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,116,117,118,119,120,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,2,2,2,2,5,18,18,19,0,0,0,0,0,0,0,0,17,18,18,18,18,4,2,2,2,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,49,50,51,0,0,0,0, -0,0,0,0,0,0,0,84,85,86,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,38,0,0,0,17,18,18,18,18,18,18,18,4,2,2,2,2,3,0,0,0,17,18,18,18,18,18,18,18,18,19,0,0,0,0,0,0,0,0,0,0,0,0,0,0,65,66,67,0,55,54,0, -0,0,0,0,0,0,0,100,101,102,103,104,0,0,0,0,0,0,39,0,0,0,0,0,0,0,0,1,2,2,2,3,0,0,0,17,18,18,18,18,18,18,18,18,18,18,18,18,19,0,0,1,5,4,2,2,2,5,18,18,18,19,39,39,0,0,0,0,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2, +0,0,0,0,0,84,85,86,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,38,0,0,0,17,18,18,18,18,18,18,18,4,2,2,2,2,3,0,0,0,17,18,18,18,18,18,18,18,18,19,0,0,0,0,0,0,0,0,0,0,0,0,0,0,65,66,67,0,55,54,0, +0,0,0,0,0,100,101,102,103,104,0,0,0,0,0,0,0,0,39,0,0,0,0,0,0,0,0,1,2,2,2,3,0,0,0,17,18,18,18,18,18,18,18,18,18,18,18,18,19,0,0,1,5,4,2,2,2,5,18,18,18,19,39,39,0,0,0,0,1,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,1,2,2,2,2,2,2,3,0,0,0,0,0,0,0,17,18,18,18,19,0,0,0,17,4,2,2,2,2,5,18,18,18,18,18,18,19,0,0,9,10,10,21,18,18,18,18,18,18,4,2,2,3,0,0,0,17,18,18,18,18,18,18,18,18,18,18,18,18,18,18, 0,0,0,0,0,0,0,0,0,0,0,0,17,18,18,18,18,18,18,19,0,0,0,0,38,39,0,17,4,2,5,19,0,0,0,17,18,18,18,18,18,18,18,18,4,2,2,5,19,0,0,0,0,0,17,18,18,18,18,18,18,18,18,18,19,0,0,0,17,4,2,2,2,2,2,5,18,18,18,18,18,18,18, 2,2,2,2,2,2,2,2,2,2,2,2,5,18,4,2,2,2,5,19,0,0,0,1,2,2,2,5,18,18,18,19,0,0,0,17,18,18,18,18,18,18,18,18,18,18,18,18,19,0,0,0,82,0,17,18,4,2,2,2,2,2,2,5,19,0,0,0,17,18,18,18,18,18,18,18,18,4,2,2,2,5,18, diff --git a/GreatSpringGameJam/Content/Maps/Overworld.tmx b/GreatSpringGameJam/Content/Maps/Overworld.tmx index 89d6b3e..ab6c8e7 100644 --- a/GreatSpringGameJam/Content/Maps/Overworld.tmx +++ b/GreatSpringGameJam/Content/Maps/Overworld.tmx @@ -1,5 +1,5 @@ - + @@ -7,36 +7,36 @@ -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,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,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,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,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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,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,55,54,0,0,0,55,55,54,0,0,0,0,0,0,1,2,2,2,3,74,75,76,0,0,0,1,2,2,2,5,18,18,18,19,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,2,2,2,2,2,3,0,0,0,17,18,18,18,4,2,2,2,3,0,0,17,18,18,18,18,18,18,18,19,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, -18,18,18,18,18,18,18,18,18,18,18,18,18,18,19,0,0,0,17,18,18,18,18,18,18,18,19,0,0,17,18,18,18,18,18,18,18,19,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, -18,18,18,18,18,18,18,18,18,18,18,18,18,18,19,0,0,0,17,18,18,18,18,18,18,18,19,0,0,17,18,18,18,18,18,18,18,19,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, -18,18,18,18,18,18,18,18,18,18,18,18,18,18,19,0,0,0,17,18,18,18,18,18,18,18,19,0,0,17,18,18,18,18,18,18,18,19,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, -18,18,18,18,18,18,18,18,18,18,18,18,18,18,19,0,0,0,17,18,18,18,18,18,18,18,19,0,0,17,18,18,18,18,18,18,18,19,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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2,5,18,18,18,18,18,18,18,18,18,18,18,18,18,19,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,2,2,2,2,2,3,0,0,0,17,18,18,18,4,2,2,2,3,0,0,17,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,19,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, +18,18,18,18,18,18,18,18,18,18,18,18,18,18,19,0,0,0,17,18,18,18,18,18,18,18,19,0,0,17,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,19,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, +18,18,18,18,18,18,18,18,18,18,18,18,18,18,19,0,0,0,17,18,18,18,18,18,18,18,19,0,0,17,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,19,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, +18,18,18,18,18,18,18,18,18,18,18,18,18,18,19,0,0,0,17,18,18,18,18,18,18,18,19,0,0,17,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,19,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, +18,18,18,18,18,18,18,18,18,18,18,18,18,18,19,0,0,0,17,18,18,18,18,18,18,18,19,0,0,17,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,19,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, +18,18,18,18,18,18,18,18,18,18,18,18,18,18,19,0,0,0,17,18,18,18,18,18,18,18,19,0,0,17,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,19,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 @@ -50,5 +50,10 @@ + + + + + diff --git a/GreatSpringGameJam/Content/Tilesets/World.aseprite b/GreatSpringGameJam/Content/Tilesets/World.aseprite index 65263bc60be69b836ed671d85577f1178c7fcd8c..775db0295e92356e271cf786410bc65f02fea8dc 100644 GIT binary patch delta 2365 zcmXX`X;4##7B0`-H@2k~>K2!Zq_0RR%Ay34*YOF0(zv}K1PCLGLJE0orjUgDYNu$F zrEH?0Nm(LmKp+cHxDgu&dm07uSjuIO5RxkdNCG#xk1jK3=FIuN@67q;{P+s3TC6Nu zvMc}#_pI*>7Uy!3Eiiy&!RGvjGJqX2vt{4TyH7k{wXstp?lwK9Bs+veByUfBu7BV5 z)%orCwq19NhQF(Q@tSiYG0{|3iC#~Xr${a@#=t9*dHLGF+CZJS z1tt=j{rT4;i2fgZ@+%F(YZn-$JQwPQ-vJl~QdUwUCAv;x8lc0Y#@SD3H)15ED*{^B zaF@W?#4qV5KBZAn#u|FTdf2$|i5R>O$00~5&12vk0*lbx-7P86aEas@p z4Ko0|O7scuOpco$5j-)Tg%oJ~&=pnLSR))m0?Fa&qVPK@?>vb5etpJvP&GfZBuPe# zN9!`&2+!QjkIYHcl>T6Jr3UR*L)Z)n4_HPQGSu7w+5(quiYrVUFmA4hR~(cwOuF8o z*?#lzo33e^hWnf=)R0v9G5`y&hnxS@!5T>GX?hqVb6Y?XmJO6vK%ptuDE%BLW1T+p zylB##~I?zuY<@a)RM0d4( zmZl+hk>@wckpNr2I%otqojc8-9|ucDCmr#2;gff^O&?}$g(h$hVl(k~Y40%Mz#sF* zVME3Zf@rRG2_rPK>a~$3a?RewMzimjC4{R6xYgx}@Mox$VQQ3}ffUh8`?z^gOHBnp zCVmcqttq_UUukC3O{XL>Lv?N{l$XX>ag^z`o=h+CFQH7*0>@0@giSCqUg|k6-Sj@y zdr*qmCjmXS6S#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$=K^K;{(mU_HPU=*i@H_pY?E2$fg55roKzy-BRQNXY z?e@9`uY5^fGf1CABLdz3U5n#0D~O$+;pICY_xUdmZlueD8|jTdZlKG5gBwHDAzlOD zX0hFFflu801d_aFpohe!06Pjr>$A~M?EWJybamo6eN;G~>X4N8vQzcA6C?YiP1^Ac zRHqA=UgU?w6hLdC+wSiz34i~Q7WzYdy6>iA^M0PVU2o&Sq<98NMFIlml86FmU44bs zo*SRgz|WUx&y9w1dYVcvAW3h(xP>Fmcn0Dy-LI{2#54fe1^WO5+hjyU5P z__fRHI+BQU0J1@oy$jBNwRfv4%DDjWBUdAUxbSm=iRv*IVK06f)!DdbiG5QU%jd-=zU;k4Y22MM)GwBD%a z0w9Q7b{-ZLSX2OUM$Z8t59C%Dg!cjvQFdH}0RR910000001zI3!~+1JMsX8-cntzj z1MtG{7B2vRS|-=dKyHj|N%uA70GLc}1;K3}z_07SDgW=K1jOBSx_8^@K0nAex!elO zb^;QW_W!fk02c+ZWso+x90AO}7`M)i65;^>000000000075)!8o*JVNJe`?Y00000NkvXXu0mjf DO$b(% diff --git a/GreatSpringGameJam/Content/Tilesets/World.tsx b/GreatSpringGameJam/Content/Tilesets/World.tsx index d8b92fc..a2ec919 100644 --- a/GreatSpringGameJam/Content/Tilesets/World.tsx +++ b/GreatSpringGameJam/Content/Tilesets/World.tsx @@ -117,21 +117,6 @@ - - - - - - - - - - - - - - - @@ -156,21 +141,6 @@ - - - - - - - - - - - - - - - @@ -203,14 +173,6 @@ - - - - - - - - diff --git a/GreatSpringGameJam/GameImpl.cs b/GreatSpringGameJam/GameImpl.cs index 29b4df7..337c305 100644 --- a/GreatSpringGameJam/GameImpl.cs +++ b/GreatSpringGameJam/GameImpl.cs @@ -1,11 +1,15 @@ +using System; using System.Collections.Generic; +using System.IO; using System.Linq; +using System.Reflection; using Coroutine; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Content; using Microsoft.Xna.Framework.Graphics; using MLEM.Cameras; using MLEM.Extended.Extensions; +using MLEM.Extensions; using MLEM.Font; using MLEM.Formatting.Codes; using MLEM.Startup; @@ -13,17 +17,20 @@ using MLEM.Ui; using MLEM.Ui.Elements; using MonoGame.Extended; using MonoGame.Extended.Tiled; +using Newtonsoft.Json; using ColorHelper = MLEM.Extensions.ColorHelper; namespace GreatSpringGameJam { public class GameImpl : MlemGame { public static GameImpl Instance { get; private set; } + private static readonly JsonSerializer Serializer = new(); + public Map Map { get; private set; } public Player Player { get; private set; } public Camera Camera { get; private set; } public bool IsInCutscene { get; private set; } - public readonly Dictionary Scores = new(); + public Dictionary Scores { get; private set; } = new(); private ContentManager mapLoader; public GameImpl() { @@ -47,6 +54,12 @@ namespace GreatSpringGameJam { this.InputHandler.HandleKeyboardRepeats = false; this.mapLoader = new ContentManager(this.Services, this.Content.RootDirectory); + var scores = GetScoreFile(); + if (scores.Exists) { + using (var reader = new JsonTextReader(scores.OpenText())) + this.Scores = Serializer.Deserialize>(reader); + } + this.Camera = new Camera(this.GraphicsDevice) { AutoScaleWithScreen = true, Scale = 4 @@ -77,13 +90,14 @@ namespace GreatSpringGameJam { yield return new Wait(CoroutineEvents.Update); } - // display end of level info + // calculate score var snowRemoved = this.Map.TotalSnow - this.Map.GetTotalTiles("Snow") / 2; var plantsGrown = this.Map.TotalSeeds - this.Map.GetTotalTiles("Seed"); var gnomesCollected = this.Map.TotalGnomes - this.Map.GetEntities().Count(); // snow removal is less important, gnomes are more important var completion = (snowRemoved / 3F + plantsGrown + gnomesCollected * 10F) / (this.Map.TotalSnow / 3F + this.Map.TotalSeeds + this.Map.TotalGnomes * 10F); + // display end of level info var group = new Group(Anchor.Center, new Vector2(0.5F), false); this.UiSystem.Add("EndCard", group); group.AddChild(new Paragraph(Anchor.AutoCenter, 1, "Level Completed!", true) {TextScale = 0.125F}); @@ -107,6 +121,12 @@ namespace GreatSpringGameJam { yield return new Wait(0.03F); } + // update highest score data + if (!this.Scores.TryGetValue(this.Map.Name, out var lastCompletion) || lastCompletion < completionCounter) + this.Scores[this.Map.Name] = completionCounter; + using (var writer = GetScoreFile().CreateText()) + Serializer.Serialize(writer, this.Scores); + yield return new Wait(3); // fade out and move to overworld @@ -118,14 +138,14 @@ namespace GreatSpringGameJam { CoroutineHandler.Start(Impl()); } - public void RestartLevel() { + public void StartLevel(string name, Color fadeColor) { this.IsInCutscene = true; - CoroutineHandler.Start(this.FadeAndStartLevel(this.Map.Name, Color.Black)); + CoroutineHandler.Start(this.FadeAndStartLevel(name, fadeColor)); } - private IEnumerable FadeAndStartLevel(string map, Color color) { + private IEnumerable FadeAndStartLevel(string map, Color fadeColor) { var fadeOverlay = new Group(Anchor.TopLeft, Vector2.One, false) { - OnDrawn = (e, time, batch, a) => batch.FillRectangle(e.DisplayArea.ToExtended(), color * a), + OnDrawn = (e, time, batch, a) => batch.FillRectangle(e.DisplayArea.ToExtended(), fadeColor * a), DrawAlpha = 0 }; this.UiSystem.Add("Fade", fadeOverlay); @@ -156,11 +176,20 @@ namespace GreatSpringGameJam { private void StartMap(string name) { // dispose loaded maps so that edits don't persist this.mapLoader.Unload(); - this.Map = new Map(this.mapLoader.Load($"Maps/{name}"), name); - this.Player = new Player(this.Map, this.Map.SpawnPoint.ToVector2()); + var map = new Map(this.mapLoader.Load($"Maps/{name}"), name); + var spawnPoint = map.SpawnPoint.ToVector2(); + if (name == "Overworld" && this.Map != null && this.Map.Name != name) + spawnPoint = (map.GetLevelEntrances().First(e => e.Name == this.Map.Name).Position / map.TileSize).FloorCopy(); + this.Player = new Player(map, spawnPoint); + this.Map = map; this.Map.AddEntity(this.Player); this.FocusCameraOnPlayer(1); } + private static FileInfo GetScoreFile() { + var appData = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData); + return new FileInfo(Path.Combine(appData, $"{Assembly.GetExecutingAssembly().GetName().Name}.dat")); + } + } } \ No newline at end of file diff --git a/GreatSpringGameJam/Player.cs b/GreatSpringGameJam/Player.cs index ceccaae..56fd4eb 100644 --- a/GreatSpringGameJam/Player.cs +++ b/GreatSpringGameJam/Player.cs @@ -1,4 +1,5 @@ using System; +using System.Linq; using Coroutine; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -30,6 +31,7 @@ namespace GreatSpringGameJam { private HeldItem heldItem; private float currJumpHeight; private bool climbingVine; + private bool invisible; public Player(Map map, Vector2 position) : base(map, position) { this.animations = new SpriteAnimationGroup(); @@ -46,13 +48,6 @@ namespace GreatSpringGameJam { if (tileBelow != null && tileBelow.Properties.GetBool("JumpPad")) jumpHeight = 0.25F; - var (_, foregroundInside) = this.GetTileBelow(Vector2.Zero, "Foreground"); - var (_, tileInside) = this.GetTileBelow(Vector2.Zero); - if (foregroundInside != null && foregroundInside.Properties.GetBool("Goal")) { - GameImpl.Instance.Finish(); - return; - } - // input var move = Vector2.Zero; if (MlemGame.Input.IsAnyDown(Keys.A, Keys.Left)) { @@ -65,6 +60,7 @@ namespace GreatSpringGameJam { } // climbing + var (posInside, tileInside) = this.GetTileBelow(Vector2.Zero); if (tileInside != null && tileInside.Properties.GetBool("Vine")) { if (MlemGame.Input.IsAnyDown(Keys.W, Keys.Up)) { this.climbingVine = true; @@ -78,6 +74,20 @@ namespace GreatSpringGameJam { this.climbingVine = false; } + // entering doors + if (MlemGame.Input.IsAnyPressed(Keys.W, Keys.Up) && this.onGround) { + if (tileInside != null && tileInside.Objects.Any(o => o.Properties.GetBool("LevelExit") && this.Map.GetArea(o, posInside.ToVector2()).Intersects(this.Bounds))) { + this.invisible = true; + GameImpl.Instance.Finish(); + } else { + var door = this.Map.GetLevelEntrances().FirstOrDefault(e => this.Map.GetArea(e).Intersects(this.Bounds)); + if (door != null) { + this.invisible = true; + GameImpl.Instance.StartLevel(door.Name, Color.White); + } + } + } + this.walking = move != Vector2.Zero; this.velocity += move; @@ -96,8 +106,8 @@ namespace GreatSpringGameJam { } // restart if we fell - if (this.Position.Y >= this.Map.Size.Y + 5) - GameImpl.Instance.RestartLevel(); + if (this.Position.Y > this.Map.Size.Y) + GameImpl.Instance.StartLevel(this.Map.Name, Color.Black); } // movement and collisions @@ -128,7 +138,8 @@ namespace GreatSpringGameJam { } public override void Draw(GameTime time, SpriteBatch batch) { - base.Draw(time, batch); + if (this.invisible) + return; // draw self var pos = this.Position * this.Map.TileSize;