Sunday;Lunch - A Devlog for Devs

Hi,

during the Catalog Anniversary Sales I don't have much to do because I can't put my first game Pocket;City on sale.

So it's time to develop the follow-up to Pocket;City called Sunday;Lunch.

It should have the same mood and some mechanics as Pocket; City.

And – most importantly – it has to steal some of the code from Pocket; City.

So let's get started and try to adapt most of the code from my first game.

This will be the Technical Devlog of the game.

Maybe I'll run a new devlog related to the "Art Look" of the game in another place, like my Discord server or website.

2 Likes

Step 1: Crosshair Movement

Sunday;Lunch should have more or less the same controls of games like Pick Pack Pup.

Actually Pocket;City interaction is done via CrosshairMvmt class.

It moves the crosshair along the level and change its behaviour:

crosshair-movement

The orizontal movement is controlled by the d-pad, the vertical one is controlled both by the d-pad and the crank.
I want to maintain this kind of controls and screen scrolling.

The grid of the game has to be a 6X6 and has to be entirely visible.
So every tile should be 40 (or more) x 40 pixel.
Every tile in Pocket;City is 64 x 64 pixels.

When I started developing Pocket;City , I was thinking about a Sapio trylogy . Sapio is the kid with glasses you can see in the game.

These three games should fall in the same Puzzle/Strategy category with similar visuals.

For these reasons I’ve created the CrosshairMvmt class to be quite flexible: I want to use it also in Sunday;Lunch with minimal changes.

Actually this is its signature (its init() function ):

function CrosshairMvmt:init(tileGridSize,crossHairMaxHorizontalTiles,startTileX, positionLimitY,checkEnabledTilesInterval, marginX, AvailStartingTileX, AvailStartingTileY)

In Pocket;city the tileGridSize is set to 64; in Sunday;Lunch this value will be 40.

But before doing these I’ve to update my LTDK map.

I developed all 15 Pocket;City levels using this tool.

For Sunday;Lunch I need only one Level.

Since I need only one level, I can avoid to use LTDK and draw it directly on my Ipad. But I want to reuse most of the code of Pocket;City instead of rewriting it. So I prefer to do some (very little) work on LTDK instead of some refactoring.

Without any modification on code now the Only One Level is this one:

onelove

A 6x6 (white) grid of 40x40px tiles

changing only few thing like this one from :

`self.crosshairMvmt = CrosshairMvmt(64, 6, LEVELS[level]["startingTileX"], positionLimitY, checkPalsInterval, 40, 1, 2)`

to:

`self.crosshairMvmt = CrosshairMvmt(40, 6, LEVELS[level]["startingTileX"], positionLimitY, checkPalsInterval, 100, 2, 2)`

creates a grid made by tiles of 40px with the action enabled (the arrow icon) only in the 6x6 white square.

bare-minimum

After deleting (commenting) some code in the GameScene class and reducing from 15 to 1 the number of levels in my LevelsData.json the result is this one :

startingPoint

No extra levels, no Pocket;City scores (Bananas,Hope,FoodValley,Business). Only one “blank page“ level ready to be filled with the new game logic of Sunday;Lunch.

For comparison this is the same sequence of scenes in Pocket;City:

pocketCity

Step 2 : Defacing and Restyling Pocket;City

I started to deleting (commenting) some part of the code and changin some backgrounds in order to delete the Pocket;City visual style.

After doing some changes to the parameters of actual classes the game looks like this:

anylineofcode

Since now I’ve not really written any line of code

The game actually has the same scene structure of Pocket;City:

  • A MainScene (the one with PLAY and Highscores buttons)
  • A LevelsScene (with The Level and The End)
  • An EndScene , the “final“ level filled only with a sequence of comic-style pitcures
  • An HighScoresScene with … highscores
  • A GameScene that manages one level. In Pocket;City this class was used for all the 15 levels.

All of these scenes are managed by a SceneManager that is totally inspired to the one made by SquidGod

Since I have only one level in Sunday;Lunch , the LevelsScene can be deleted.

And finally the scene structure should be :

  • A MainScene with three buttons: Play,Story and Highscores
  • A StoryScene . It is the equivalent of Pocket;City EndScene but enhanced with the Panels library
  • An HighScoresScene
  • A GameScene

The Play button will activate directly the GameScene.

I’ve also to remove any reference to LevelsScene in back actions and in-game menus.

Actually the game looks like this:

newSceneOrganization

Finally it comes the intesting part: write some code for the main game loop.

2 Likes

So , Pocket;City has a different type of interaction compared to the one I have to achieve for Sunday;Lunch.

In Pocket;City you have to drop some Stuff (bikes,buildings, tents) in a free area.

In Sunday;Lunch you have to switch stuff located in the white tiles .

this is what I’ve done adding/editing more or less 50 lines of code:

newinteraction

Now the cursor changes when it can do something (in white tiles) and if you press the A button it shows the allowed direction for swapping stuff. The arrows disappear when the player choose one of directions or when he/she release the A button.

More or less the type of interacion of a classic match 3 game like Pick Pack Pup.

1 Like