Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Day 5:

I implemented the core mechanic of the game. Entering dream world. Currently it's implemented with disabling and enabling different player game objects. There are 3 player gameobjects: normal, sleeping and dream. At the beginning of the level only the normal one is active. When X is pressed, player is falling asleep. Normal character is deactivated and other characters are place where normal character was and activated. When player presses X again, normal character is placed where sleeping character was and is activated while other characters are deactivated.
While it's rather easy to implement it has one disadvantage that is going to bite me later. There are two copies of the player scripts. One on normal player, one on dream player. That means that handling player states is problematic.

Day 6:

I didn't do anything. I'm lazy. :(

Day 7:

I implemented bottom boundary. Now player won't fall down infinitely, but when hitting invisible wall they will either reset level (when not dreaming) or wake up (otherwise).

I started implementing moving platforms and I faced problem. Character is slipping from the platform. I saw a few different solution on the web and decided to fix it the next day.


First half of Day 8:

Since it's Saturday I have a lot more free time to do things. :)
First of all I've checked solution to moving platforms and decided to go with adding platform velocity to velocity of player while they are on platform. Other solution either didn't work (parenting) or were unnecessary complicated. After that I've decided to implement a switch that will activate moving platform. Currently sprite for a switch is a cloud that is going red when activated. I'll make proper sprites later. I had another decision to make about switches: how to detect whether player is in switch collider when player is pressing use button. The simplest approach would be to call function that detects if either of player colliders intersects any switch collider (there's always a possibility that player may interact with two or more objects at once). However after webGL acting funny with that function decided to try another approach.

I've made switch a trigger collider, with function OnTriggerEnter2D and OnTriggerExit2D. Player has list of switches they can use right now. Each item on list has reference to switch game object, action to do when switch is off, and action to do when switch is on. On trigger enter switch adds itself to player list (Frstly checking if it wasn't added already. Player has two colliders.) On trigger exit switch removes itself from the list. This looks not that complicated and rather efficient.
Unfortunately this is the place where multiple copies of player scripts make things not work.

Nevertheless I quickly finished everything, added few texts and after 8.5 days I have a demo where player has to go to dream mode, jump to switch, and cross the gap to go to another platform. With placeholder sprites and no sound effects at all. What more can you want? This is the best game ever!



Yeah, when I stared the game jam I thought that I will be more advanced right now, but it's still some progress.

I still want to:
Clean my code

I was rushing to make it work somehow, and code doesn't have the best quality. I want to refactor and comment it. I also want to find a better way to deal with dream world. Instead of deactivating whole character I'll probably want to just replace child sprite elements, and change tag and layer of parent gameobject that contains all logic.

Make player gain ability

While originally I planned to have many small levels now I think that better idea is to have one level where player explores the level and gain abilities that allows them to backtrack and access previously unavailable area. Main idea for ability right now is wall jump, but if it proves to be too difficult to implement then I'm going to end up with double jump.

Get rid of placeholder sprites

On sunday I plan to have most coding done and focus on making level bigger and prettier. I want to replace sprites and add my own. Even if they'll have paint quality it's better than generic placeholder sprites. I'm going to add some animations, at least for: switch, player movement, falling asleep and waking up. I'm going to add some sound effects and music.
If I'm going to have some free time then I will make option to customize controls, but it's not top priority right now.




I've updated files in my project so you can see my progress.