New Game - OhMummy


(Matthew Vicaradge) #1

Clears throat Hi everybody, I have been putting a game together for the last few weeks, I would not have been able to get this far without the excellent tutorials and advice available on this forum, so thanks to everyone here!

I feel ready to share my game and would appreciate any advice you may have, I’m sure the code could be a lot neater, better laid out, optimised etc. but as I got deeper into the development I started to rush it out, I need better self control!
Its heavily influenced by an Amsoft classic that I had free with my Amstrad CPC464.

Anyway, let me know what you think, I’d love to hear from you!

I just realised I don’t know how to add a file! lets see…

OhMummy.hex.pdf (42.8 KB)

ok, so you can delete the .pdf bit?
The code is also on my wordpress page:
https://mattvic79.wordpress.com/oh-mummy/

Thanks for taking the time to read my post! I hope you enjoy my game!


(Kevin) #2

Maybe its time to start thinking about unblocking those hex files :sheep:


(Pharap) #3

Not got a GitHub/GitLab yet?

At least the code’s available though, I’m grateful for that.
(Although it doesn’t have a licence yet.)


By the way, you’re using return in a bit of an odd way.
Usually people write return 2;, not return(2);.

The biggest improvement would be to fix the spacing.
Consistent spacing goes a long way.

I can think of some other suggestions, but they’re probably things you haven’t read about yet so I think jumping on them immediately might be a bit unfair.


Just compiled it with full warnings on.

There’s a buffer overrun bug in alignH:

for (int i=0;i<=3;i++)
{
	res=objy-Hpath[i];
	if (abs(res)<delta)
	{
		delta = abs(res);
		closestHpath = Hpath[i];
	}
}

Should be i < 3, not i <= 3.

You also have 4 unused variables (distancex at line 507, distancey at line 508, ActivBlock at line 514 and count at line 516), but that’s just a minor problem.

That’s all though, no other warnings.


(Sean) #4

Nice game. It makes me panic when I’m trapped. :ghost:


(Matthew Vicaradge) #5

Thanks for the feedback! I was excited to to get it out, so the line spacing I’ll sort out and the overrun issue. I’m pretty sure there is scope for optimising a lot and that I’ve done similar things in different ways, so I could turn some more things into functions and reuse some code.

As you said, I’ve not done a great deal so far but I’d be interested in the more advanced suggestions you have. Even if it’s just pointers for me to go and read about. (No pun intended).

Thanks for taking the time to have a look, it really is appreciated!

One more question… did you enjoy the game?

Thanks again, Matt.


(Matthew Vicaradge) #6

It makes me panic when I’m trapped. :ghost:

Me too, I find it quite stressful! Glad you enjoyed it.


(Matthew Vicaradge) #7

I got a github.
https://github.com/Mattvic79/OhMummy


(Scott) #8

I suggest you add a licence, so people will know what they can do with your code.

Also, it will make it easier for people to add the sketch to the Arduino IDE if you put (only) OhMummy.ino into a subdirectory named OhMummy. This way the user only has to copy or move the OhMummy folder, along with its contents, into the IDE sketchbook folder, without having to worry about all the other files, which are unnecessary to compile the sketch. It also means the user doesn’t have to deal with the -master added to the name of the .zip file when it’s downloaded from GitHub.


(Pharap) #9

@MattVic
If you don’t know why a licence is important, read here:

If you don’t know what licences are available, read here:


(There’s a more complete list here.)

Most Arduboy games are released under the MIT, BSD 3-clause or Apache 2.0 licences.
(The only licence I’d personally advise against is the GPL and its variants.)

And if you don’t know how to add a licence file to your repository, read here:
https://help.github.com/articles/adding-a-license-to-a-repository/


(Scott) #10

I suggest that you additionally add the licence text, or state which licence applies, in a comment section at the top of your source (.ino) file(s). This is particularly true if you take my advice above, to put the source in a separate subfolder, since this will likely cause the source file(s) to be separated from the licence file. The licence will always “follow” the source if it’s included within the source itself.


(Matthew Vicaradge) #11

@MLXXXp @Pharap
Thanks for the tips, I’ve added a licence to my code and included the .ino in it’s own folder. You’ll have to excuse my general lack of experience. I’ll get better.

Thanks, Matt.


(Scott) #12

You should probably wrap the lines of the licence text in the OhMummy.ino file. Having each paragraph being one long line is hard to read if your editor doesn’t do a soft wrap.

With OhMummy.ino in its own folder, you no longer need a second copy of it in the repository root folder. You don’t want to have to maintain two copies of the same file.


(Pharap) #13

No worries.
We’re not judging you, we’re trying to help you learn.

Really we ought to have all this stuff written down in a beginner’s guide,
but finding the time and energy to write it isn’t easy.


I think the next thing on your list of things to learn about is include files so you can move your images and structs to a separate file.

Also maybe uint8_t vs int/int16_t, because I suspect a lot of your variables use more memory than they need to.
That’s not an issue now, but it will be when you want to make larger games.

There’s some other stuff too, but I don’t want to bombard you with suggestions.
All this stuff takes time to learn and I appreciate that.