How difficult is creating a game, for an absolute beginner?

Hi there,

I always was interested in creating things.
However, I never got any further than programming in HTML0. Basic HTML without CSS.
I have some background theory in CSS, but never really made anything worth while.

I did not find any flair in the advanced coding with libraries and stuff.
Wanted something simpler.
Something totally basic, to the core.
Minimalist in approach.
The Arduino Boy might actually achieve this, due to it’s screen limitation (monochrome, minimal pixels), this limits what you can program into it, and it somehow has a flair. The small, low profile processor, with low power consumption, the screen (Would love to see this with a reflective screen instead, for even lower consumption)…

There’s an art in making programs as small as possible.
It’ll require ingenuity, and ways to circumvent limitations.
Kind of like the 4k demos we had back in the day on our PCs.

I find attraction to this device, and wondered, would it be rewarding, if I could spend my time learning to code for ArduinoBoy?
Meaning, I don’t really have any special coding skills, but if I had to learn a language, would learning this be easy (quick rewarding), or would you say to rather start with something else?

Also, is there an emulator for Windows I can practice with?

1 Like

Making games? Easy …

Just follow the lessons here >

As for emulators, there is ProjectABE … It can be used online or you can download it and run it locally.

4 Likes

Firstly to kill a few misconceptions:

Programming Arduboy games is nothing like making basic HTML webpages.

Technically HTML isn’t actually a programming language, it’s a markup language. The difference is that it doesn’t describe ‘how’ to do something, it describes ‘what’ the thing is.

I’m not sure what you mean by this.

Almost nobody writes an Arduboy game without using a library of some kind. Using a library is easier than not using a library because it saves you the trouble of rewriting all the code for ‘talking’ to the screen and the other hardware.


Now to the main point:

It depends on what you hope to achieve.

Learning to make a simple game is reasonably easy.
We’ve got tutorials for the basics, pong and an endless runner.

“Making programs as small as possible” on the other hand requires a lot more knowledge than simply making a game. At the least it requires a very good understanding of the language (C++).

So basically if you just want to learn how to make a game then yes, the Arduboy is fairly easy to make games with.
Anything more than that is going to take lots of hard work, no matter what language you use and no matter what platform you’re writing for.

Admittedly there are easier languages that you could learn if you just want to learn a programming language, but C++ is used for Arduino devices because it gives the programmer more control over fine details, is generally easier for interfacing with hardware and results in smaller, faster programs than many other languages.

3 Likes

I’m currently learning the ropes on this platform. It’s generally pretty easy to understand this library. Some of the C/C++ language can get confusing. There are multiple approaches to achieving what you would like to accomplish and some are better than others. The knowledge of which approach is best will come with many hours of study and practice. With Arduboy, the benefit is having an active community of people who love helping. There are more resources than just the tutorials. @JO3RI has articles on the Arduboy magazine that will give you tips and tricks and even help you reduce the size of your code. For now, try the emulator and burn through @crait’s tutorials. Those are fundamental and are easy for beginners to understand.

3 Likes

If you want to find out how a game works, click on the USB port in the emulator. It should show the source code and you can experiment making changes. Tweaking an existing game is probably an easier way to start than from scratch.

3 Likes

You can access the articles @Alectric mentioned here:

They’re free to view.
Lots of different people have made contributions including myself and @filmote.


One small nitpick: C and C++ are actually two very different languages and they’re only partially compatible.

I know people get annoyed when I bring it up because they do have a lot in common and were originally supposed to be compatible, but there’s a long list of things that prevent C from being a subset of C++, a small sample of which are described here.

2 Likes

Thank you for clearing that up for me as well. I guess I have fallen under the trap of misconception.

1 Like

Yeah, it’s probably one of the most common misconceptions about C and C++ so you’re certainly not alone.

1 Like

Then there’s C#, lol!

Thanks for the replies.
I guess I’ll have to start somewhere.

1 Like

Totally this. Take a simple hello world tutorial, learn how to compile it, run in the emulator and upload to Arduboy (this is all very easy, there are tutorials around here), and then start making changes to it, line by line, see what it does. Then proceed to shape it into whatever you want :slight_smile:


Arduboy is definitely a good place to start because as you say it’s a simple platform and gives nice results quickly. Normally when learning C++ for the PC you start with console text-only programs and don’t get to things like graphics until much later. Arduboy allows you to display graphics right from the start, in a very straightforward way – no variable size windows, events, mouses – which usually bloat the programs, make them buggy etc. I love Arduboy exactly for this reason.

1 Like

I DEFINITELY AGREE WITH THIS!

1 Like

There’s a good reason for that - there is no standard way of doing graphics

To draw graphics, you have to use a library, and there are so many libraries available that a generic C++ tutorial usually isn’t going to pick one for you.

In comparison, if you look at the Lazyfoo SDL2 tutorial getting an image onto the screen is lesson 2, but it assumes basic knowledge of C++.

“how to write C++” and “how to use a library” aren’t commonly done alongside each other.

There’s nothing stopping someone from writing a “how to write C++ and SDL2” tutorial, but usually it makes sense to learn the language first and then move on to libraries afterwards.
However, learning them alongside each other would probably leave the reader with large gaps in their knowledge.

Though there’s also nothing stopping someone from learning a bit about C++ and then moving on to a graphics library tutorial before finishing the C++ tutorial.

Those features alone don’t make the program buggy,
what makes the program buggy is the mishandling of those features.

Usually people neglect to read the documentation properly,
or forget to account for things like the window moving/resizing.

Windowing and system events are a lot harder than people give them credit for.


Either way, programming requires patience, regardless of whether it’s Arduboy or Desktop.
Rushing to get quicker results usually leads to mistakes.

^^ This and lack of time/dedication are my biggest downfalls not to mention distracting myself with other projects or forgetting what I learned after instantly shelving new knowledge.

1 Like

This only happens with memorized stuff. You can’t forget general principles (they can fade a little after years, but usually a few minute refresh is all that’s needed to bring them back). So ideally memorize as little as possible, always try to understand and learn the logic, not facts – logic will stay in the memory. (But you can still abstract – that is avoid irrelevant details – abstraction is good and necessary in programming).

Guys,
I’m getting confused here…
Someone mentioned that arduboy uses C++, but without the libraries, thus in essence was C.
I’ve started learning C.
Is it C, or C++?
So far, I like C.

Think of it this way: The C++ libraries are compatible with the Arduboy. You could program for it in C, but if you are following the tutorials here or libraries on this site, then you are using and learning C++.

The language is C++.

The Arduino environment is based on avr-libc which is an implementation of the C standard library (as well as some non-standard functions).

The Arduino library itself is written in C++, although it’s a mishmash of proper C++ style C++ and C-style C++.

C++ has a limited ability to interop with C code, and there exists a common subset of both C and C++ that has the same meaning, but not all valid C is valid C++ and certainly not all C++ is valid C.


I actually made a diagram a while back:

If you want a detailed breakdown of the key differences,
I’ve got a couple of links here.


If you’re using the Arduboy or Arduboy2 library, you’re writing in C++.

2 Likes

Interesting to see how small you made the overlap :smiley: I’d say most C will compile as C++, so I’d make the overlap much bigger. I guess since you have more knowledge on where the languages differ you made it smaller – from that picture I’d think there is a greater chance that C wouldn’t compile as C++ than that it would.

Of course a precise amount of overlap can’t be decided because it depends on the frequency of use of certain constructs by the programmers etc. Or without a proper definition of “overlap” in the first place. So the picture will practically always reflect a personal perception, experience etc.

I guess you could try to make a statistical estimate – pull randomly 100 C repos from GitHub and measure how many will compile (and pass tests => work properly) with -x c++.

some of the examples (tutorials) don’t work well with the emulator I have.
I have found that:

  • #include <arduboy.h> needs to be:
    #include <arduboy2.h>

  • Arduboy arduboy; needs to be :
    Arduboy2 arduboy;

  • arduboy.print(“xxx”); is written as:
    arduboy.print(F(“xxx”));

In an environment where every comma, every dot, every letter makes a difference, it’s easy to understand how programming can become difficult for beginners, and they just give up…

The problem is that you’re thinking of making C code compile as C++ and not the other way around,
so you aren’t thinking of the things in C++ that wouldn’t compile as C.
Those additional features are why the C++ bubble is so much bigger than the C bubble and why the overlap is relatively small in comparison.

Perhaps I should have made the “C that isn’t C++” smaller, but the “both C and C++” is the right size in proportion to the “C++ that isn’t C” section.

You’re forgetting the sheer number of features that C++ adds over C.

function overloading, classes, enum classes (scoped enumerations), template functions, template classes, static_assert, static_cast, reinterpret_cast, const_cast, dynamic_cast, inheritance, references, auto (type inferred variables), decltype, extern specifier for function linkage, exceptions, typeid, constexpr, constructors, destructors, operator overloading, move semantics, template specialisation, virtual functions, template type aliases, user-defined literals, thread local storage duration, raw string literals, trailing return types, lambdas,

And soon in C++20 there will be concepts too, which is a big feature.

I’m probably forgetting at least 4 or 5 things, I almost forgot trailing return types and lambdas because I don’t use them as often as some people.


That would be wonderfully empirical, but tests wouldn’t be enough.
You’d need a static analyser created purposely to pick up on constructs that have different meanings in both languages.

For example, here’s some code that would end up doing the same thing, but only by coincidence:

extern int T;

int size(void)
{
    struct T { int i; };    
    return sizeof(T);
}

It would return a value equivalent to sizeof(int) in either language, but in C it’s giving you the size of extern int T;, whilst in C++ it would be giving you the size of struct T.
Only a static analyser could catch the fact it’s erroneous, it wouldn’t be enough to test the result of the function.


I don’t know if you followed the links that I linked to, but if not, be sure to have a look, there are cases where C++ even changed the rules from C.

For example, this isn’t valid C++:

char * buffer = malloc(sizeof *buffer * 100);

Because C++ would require the resulting void * to be cast to char *.

Meanwhile C programmers are encouraged not to use the cast.
So anyone who wrote their code following the ‘no cast’ convention would end up with C that wouldn’t compile as C++.