• Guest, before posting your code please take these rules into consideration:
    • It is required to use our BBCode feature to display your code. While within the editor click < / > or >_ and place your code within the BB Code prompt. This helps others with finding a solution by making it easier to read and easier to copy.
    • Don't share a wall of code. All we want is the problem area, the code related to your issue.


    To learn more about how to use our BBCode feature, please click here.

    Thank you, Code Forum.

2D Game - Language, etc.

stefane9

New Coder
Hey Guys, we're coding beginners (intensive 6 Months into JS, HTML, CSS & Java. Our focus within those 6 months are on Java) - (We also have some basic Python knowledge)

We have a group project (3ppl) and would like to write a simple game;

The game should run on a:

- Rapsberry Pi + monitor

- Game in 2D (language unknown) (sidescroller, arcade, ...) in between code quiz for the player, if answered correctly, (HTML, CSS, JS, JAVA questions) the ingame properties change (for example: "color: red;" - change some ingame color to red...)

- integrate sound
- keyboard/mouse/joystick? (for control)
- multiplayer(?)
- Highscore DB


We are struggling to get our heads around the right language for us.

What we‘ve found so far:

- Pygame (Python Framework)

- Unity (looks like drag and drop, we would like something more Code related)

- Lua



We have 10 weeks for the project and around 10 hrs daily/week on average to work on that project.

What are your opinions on that topic? Any recommendations on languages etc.?

Thanks in advance
 

BorkedSystem32

King Coder
Hello there, @stefane9.

- Rapsberry Pi + monitor
First, I think this is a key thing to focus on. You're going to be running this on a Raspberry Pi, whose power depends on the model you have. Smaller/older models have weaker power whereas more recent models like the Pi4 can contain up to 8GB RAM(which is good, but the CPU/GPU used inside is more important because that plays a huge factor in the game's speed). Pis also vary in storage space depending on the SD card you use in it, so space is another factor to take into consideration in(the length of code files, the sprite details and image sizes, audio file sizes, etc.)

- Pygame (Python Framework)
PyGame I think would be a good choice, however, you and the team will need to learn a bit more about Python to be able to harness its full functionality. PyGame comes with all of the modules you need for graphics, sound, controls, etc. You just need to learn which modules and the functions within that you need to take advantage of.

- Unity (looks like drag and drop, we would like something more Code related)
Since you're making this run on a Pi, I would not recommend using Unity(or any other pre-built game engine like Unreal or Godot). They may already come with an interface to use and all the tools and libraries you need to create a game with good graphics, gameplay, and audio, however, optimisation is important and from experience, game engines like Unity are absolute resource-hogs(especially when the game built with a pre-built engine has too much going on in one scene or the code is poorly optimised).

Lua is a great language for games, both standalone and when embedded into other languages like C(which is Lua's intended purpose). There is a library for Lua called "Love2D" which is exactly like PyGame but for Lua. Comes with everything you need, you just need to read the damn manual and know Lua to work with it.

You could alternatively build your game in either C or C++ and choose to embed Lua for stuff like gameplay and controlling scenes and even optimisation(Lua is quite a fast language when ran).

I hope this helps!(And good luck with your project too!)
 

menator01

Coder
I've not used Lua or Unity but, pygame is pretty good. I've done a learning project with pygame a couple years ago. It's someone elses code that I modified for my own use. Can be found on my github page. It's called shmup.
 
Top