Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines
(+1)

Played the demo and I found it to be very entertaining. That's awesome! May I ask you something that would be cool in a devlog? 

How did you manage to calculate the percentage of completion for each individual object? What is the data structure you're using to do this. I'm doing a similar style painting game but in gamemaker,  but surfaces doesn't give me enough info about that kind of stuff. For instance is a pain to do bucket fill with surface lol. Saw some of your devlogs it seems at first you separated each part of the sprite into mini parts, but now it seems you have something more complicated that each pixel is counted towards completion.

(+1)

Thanks for playing & for the kind words! Glad you liked it.

So each washable object is broken up into sections, let's say 4 separate parts to wash. Each section then has its own pixel data, contained in a matrix data structure (just an array of boolean or integer values for "cleaned" or "not cleaned").

Whenever pixels are washed, the dirty section updates its cached pixel data, and knows its percent completion state (for example, 50 out of 256 pixels cleaned so far = about 20% cleaned). Once it reaches 100% cleaned, it lets the washable object know it's finished. Then the washable object just waits until all of its sections are washed (in this case, 4 out of 4 sections).

You can see the pixel data being created in  Tiled here: 


Hope that helps! LMK if you have more questions.
(+1)

Awesome! amazing response. Yeah I thought about that possibility, but I don't believe it scales in gamemaker, sadly =/. 

But thanks a lot! This explanation may help in other stuff I'm making ^^


Wishlisted the game. It seems awesome and seeing your devlogs is very entertaining.