Simple 2d game

This is my first 2d game in Java. Its a simple 2d sprite based game where you have to catch falling objects. Theme is inspired from current fall season. Total time invested in this -10-12 hrs

Find download link and screenshots here

Thanks

Whoa did you draw those images yourself? They are amazing!!
The game stuttered a lot and there were long periods of time where no pumpkins fell.

Nice artistic style, and only a day’s work you say? Looking forward to more!

It looks nice from the screenshots, but after clicking on Start nothing happens, it just shows a gray background?

Hi,

Thanks for taking time to view/download the game and provide your feedback on same.

Roi --> Yes I did the background, the actor, Cloud and pumpkins were open source Images I modified to fit the game need/size/color etc. I didn’t knew before I started how much time art work consumes( More than coding for sure ). I wanted to make the actor sprite do full walk cycle but it was taking too much time so I just put it off in my “To Do” list.

As for falling pumpkin;s I found out a bug in my code thanks for pointing it out. I wanted to control the fall so I used a divider by 40 which was a bad idea I need a better mechanism to control the falling rate of pumpkins. I will work on the same. Thanks.

sproingie --> I have done other games/projects in Java. so I had good coding experience in Java. I have done sudoku, image based puzzle game. But this was first 2d style moving animation game. I took me 3 -4 days for the whole game to complete but total hours would be ~15 hrs.

fruitmaze --> Thanks for downloading. Please make sure you have the images folder alongside the JAR file. Please guide in case you are aware of a better mechanism to distribute game. The problem with desktop java games is I believe distribution and instructions.

Thanks
Spikes

spikesn, have you tried putting your images inside your jar file and using Class.getResource to load your images? This will save you from sending zip files with lots of folders if you just put all resources in the jar file too.

I looked through all your games and I gotta say I’m quite impressed. I’m most impressed with the Sudoku. Even though it didn’t work when I launched it, I’m wondering how you made it generate a Sudoku reliably? Randomly generating the entire board and choosing a couple to display is not very reliable since there might be multiple solutions sometimes.

Anyway, great job and keep up the good work :slight_smile:

Roi,

Thanks for the advice, I never tried that will do it. Its simple useful things like those you don’t find easily.
Sucks it didn’t work. It was fun working on it and thats the one that took a hell lot of time as well. Funny part was generating the UI took more time than the actual algorithm ( showing 3*3 grid and than gap etc)

Heres a jist of alogirthm I used to generate random board

  1. Start filling with board from top left corner row wise with random number.
  2. Validate the board and keep generating random number until board is validate. Sometime it would end up stuck in a loop as something has gone wrong in the whole row, in such scenario do the whole row again.
  3. Validate function will check for row,column and small 3*3 grid to ensure no duplicates are present.
  4. this will generate a filled grid.
  5. Hide the grid and do a check to ensure a valid puzzle with individual solution is generated. Fill the grid at X diff random places. Pass this grid to fill function and check how many solutions are present by calling it atleast 5 times ( this was the optimum number after various test). I check for individuality by doing sum of values of 7 rows ( Magic number) if the number is constant 5 times the solution will only be one.
  6. Print the grid.
  7. The UI is an array of JLabel.

I am amazed at how fast all this generates a valid grid. I will work on the launch thingy, seems like they cause probelm.

Thanks
Spikes

Aha, #5 was what I was wondering. What do you mean you call it 5 times? Does it try to solve the entire board differently every time? And which rows do you find the sum of?

Yes it does try to solve the entire board 5 times, for each time I take sum of 5 different rows ( hard coded rows ) and then compare them if they are different then the solution is not unique and keep making more boxes visible. At the time of coding this is what I could think of … would love to see how other people are doing it :).

I took your advise and merge the images in the .jar file itself . Thanks for the tip. Working on enabling sounds.