A Simple Puzzle Game for Kids


#1

I thought I would make a thread here to collaborate with other Defold users for feedback/advice - Since, most people look at me funny when I mention anything about sprite constants, or vector4’s.:face_with_raised_eyebrow:

I am working on a very basic puzzle game for children and parents(no pun intended there).

The goal for this game is to be my first release on Google Play, and to monetize with IAP.

The Original Concept Design:

Summary

The Original Proof of Concept has the basic game framework where the player matches pieces to empty slots.

It gets puzzle categories via math.random() which I didn’t really like. It seems that using math.random() with a small set of numbers, frequently yields the same result. Even with more complex seeding such as

math.randomseed(tonumber(tostring(os.time()):reverse():sub(1,6)))

I also didn’t like the method of choosing the puzzles based on which ones were unlocked.

repeat category = math.random(num_categories) until iap_store.locked[category] == false

Which seemed pretty inefficient.
Even more so, using it for the pieces in a loop with for i=1,n do repeat math.random(n) until
(device bursts into flames):fire:

After replacing my phone, the method was converted to use my new favorite function.

local function shuffle(tbl)
	size = #tbl
	for i = size, 1, -1 do
		local rand = math.random(size)
		tbl[i], tbl[rand] = tbl[rand], tbl[i]
	end
	return tbl
end

Which is LUA version of Fisher-Yates shuffle algorithm.

So now to get random categories and pieces, we simply make a table and shuffle(it) on init(), then step through as needed, with key = key + 1

Are you with me? Good! Because everyone else I talk with would be giving me those funny looks. :laughing:

OK - Hopefully I have appealed to the great minds here, now you can let your brain relax by checking out this really simple game for kids. :wink:

Latest Development Screenshots:

There is still a long way to go… but it’s being made with Defold, so it’s going to be awesome.:+1:

Latest HTML5 Version


Schooling Fish - My First Game with Defold
#2

You should only seed once and then preferably throw away the first few (1 or 2) numbers and then the distribution should be better.

Good luck on the project btw!


#3

Can’t wait to see the full version @decoded !!!


#4

Thanks for the tip!

Does the seed apply to the whole project?

EDIT: Never-mind this. I did some testing and see that it does.:smiley:

It will still be a while. I keep getting new ideas :tired_face:

But good news! It’s now my first game on Google Play(closed alpha) and I can start getting IAP’s set up.


#5

I know, this game is childs play to seasoned gamers/developers - but we all gotta start somewhere!:wink:

New Features Added

Summary
  • Added random “twist” to orientation of puzzle pieces so they are never the same.
  • Added random color to the puzzle overlay, so it’s a new color every time there is a new puzzle.
  • Added async load to proxies for smoother sound transition.
  • Added fade in / fade out to most screen transitions.
  • Updated font for less fuzziness and better legibility.
  • Google IAPs fully implemented
  • Added listener event on fresh installs that will auto restore IAPs
  • Implemented saving of progress and purchases
  • Added “piece progression” which starts with 4 pieces. Every 3 plays unlocks a new piece.
  • A bunch of other updates to some other little things…

Also introducing - “Stuart, the Superstar”

He helps clean up the pieces when a puzzle is completed.:rofl:

The first release will include OBJECTS only.
All of the ANIMALS are being moved to proper habitats, in a separate version of game.

Also on a unrelated side-note, I got my first shadertoy conversion to work in Defold!


#6

That’s pretty sweet! Good job!


#7

Too many new features to list… :rofl:
Updated screenshots in first post and added playable demo of progress so far.