# Unity Unity or LibGDX for beginning 2D games

This topic is 1586 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hi, i've been learning bits and bobs of programming for a while now and finally want to get my head down and make something. I've looked around at various game libraries for one that would offer the most and be cross-platform and i managed to find LibGDX to fill all these needs. I was learning LibGDX for a while before i realised Unity3D could be used to made 2D games (which is my main focus at the moment, but the added 3D would be an added future bonus) and i was wondering how Unity3D fared against LibGDX on the 2D front?

Mainly my requirements are: ease of use/ease of learning, flexibility, speed of development and general usefulness.

I would also like to know if C# has significant advantages over UnityScript in Unity as other people have said about having problems with UnityScript and how much difference there is between C# and Java?

Edited by Xycaan

##### Share on other sites

I don't know LibGDX, but I do know that using Unity will also reap other benefits over an only 2d API, and even over other 3d engines.

One, you mention the 3d as well.  It is an added bonus, and in fact can be used to make your 2d better.  Also, if in the future you want to make something fully 3d(gameplay too) you already know Unity3d so don't have to learn anything else.

Two, Unity is a commercial closed source project.  This can be good and bad, but on the good side, there is a massive company behind it, which means that things are constantly getting added and approved.  I can't say that the path of improvements they make are always what the community wants, but at the least we know it isn't going anywhere anytime soon.  LibGDX, being open source, doesn't necesarily mean it will go under soon either, rather it is simply more likely than in the case of Unity.  Then Open Source does have other advantages though.

Unity and GameMaker have one thing in common, though in different ways.  They are "quirky" as in there are sometimes things that you just do the way the program says, not the way you may think makes more sense.   The UDK has this problem too.  In Unity, the recommended method for having objects know about other objects is to create public variables in your classes and drag&drop them.  You can also use the find functions, but they are supposed to be pretty slow so are not recommended.  There are other things too, but I don't remember all of them.

As far as C# in Unity, there are indeed a few things that UnityScript is lacking compared.  Delegates are one thing, but frankly, though there are a few things, from what I've seen in forums, there isn't anything that jumps out heavily that would make a big deal.  Remember that they get converted to the same .NET code on the backend so it doesn't matter much.  Many people can use either one, though if you are more comfortable with one or the other, it makes more sense to use it then to worry about the other having a feature that this one may not.

If you have a budget, and believe you are only going to ever be interested in 2d games, you could look up GameMaker Studio.  The price of the Master Collection is about to go from $499 to$799 in a few weeks, but if you were to want to export to all the mobile systems and desktops, GMStudio does it, assuming you purchase either the master collection or the specific module you want.  One good thing about it is that it tends to be much easier than Unity3d to use, mainly for 2d though, but since it has the gml scripting language(similar to java/C/C++/delphi), you can still do pretty much anything you want to.

Unity has some advantages over GMStudio though, especially recently, and not only in the 3d side of things.  They have recently upgraded the free side of Unity.  It now includes some mobile exports for free, and a couple of paid features are now free, at least partially, like hard shadows from one lamp.

##### Share on other sites

I started with LibGDX about three weeks ago. I don't know much but I have already sprites bouncing on screen, different levels and other fancy stuff. As a beginner with the game programming I think I stay with 2D for a while. Less work, more games.

##### Share on other sites

I would recommend staying with LibGDX, you'll be learning much more and you'll be writing everything out yourself. LibGDX is also 3D Capable.

• 32
• 11
• 17
• 11
• 13
• ### Similar Content

• Hello fellow devs!
Once again I started working on an 2D adventure game and right now I'm doing the character-movement/animation. I'm not a big math guy and I was happy about my solution, but soon I realized that it's flawed.
My player has 5 walking-animations, mirrored for the left side: up, upright, right, downright, down. With the atan2 function I get the angle between player and destination. To get an index from 0 to 4, I divide PI by 5 and see how many times it goes into the player-destination angle.

In Pseudo-Code:
angle = atan2(destination.x - player.x, destination.y - player.y) //swapped y and x to get mirrored angle around the y axis
index = (int) (angle / (PI / 5));
PlayAnimation(index); //0 = up, 1 = up_right, 2 = right, 3 = down_right, 4 = down

Besides the fact that when angle is equal to PI it produces an index of 5, this works like a charm. Or at least I thought so at first. When I tested it, I realized that the up and down animation is playing more often than the others, which is pretty logical, since they have double the angle.

What I'm trying to achieve is something like this, but with equal angles, so that up and down has the same range as all other directions.

I can't get my head around it. Any suggestions? Is the whole approach doomed?

Thank you in advance for any input!

• By devbyskc
Hi Everyone,
Like most here, I'm a newbie but have been dabbling with game development for a few years. I am currently working full-time overseas and learning the craft in my spare time. It's been a long but highly rewarding adventure. Much of my time has been spent working through tutorials. In all of them, as well as my own attempts at development, I used the audio files supplied by the tutorial author, or obtained from one of the numerous sites online. I am working solo, and will be for a while, so I don't want to get too wrapped up with any one skill set. Regarding audio, the files I've found and used are good for what I was doing at the time. However I would now like to try my hand at customizing the audio more. My game engine of choice is Unity and it has an audio mixer built in that I have experimented with following their tutorials. I have obtained a great book called Game Audio Development with Unity 5.x that I am working through. Half way through the book it introduces using FMOD to supplement the Unity Audio Mixer. Later in the book, the author introduces Reaper (a very popular DAW) as an external program to compose and mix music to be integrated with Unity. I did some research on DAWs and quickly became overwhelmed. Much of what I found was geared toward professional sound engineers and sound designers. I am in no way trying or even thinking about getting to that level. All I want to be able to do is take a music file, and tweak it some to get the sound I want for my game. I've played with Audacity as well, but it didn't seem to fit the bill. So that is why I am looking at a better quality DAW. Since being solo, I am also under a budget contraint. So of all the DAW software out there, I am considering Reaper or Presonus Studio One due to their pricing. My question is, is investing the time to learn about using a DAW to tweak a sound file worth it? Are there any solo developers currently using a DAW as part of their overall workflow? If so, which one? I've also come across Fabric which is a Unity plug-in that enhances the built-in audio mixer. Would that be a better alternative?
I know this is long, and maybe I haven't communicated well in trying to be brief. But any advice from the gurus/vets would be greatly appreciated. I've leaned so much and had a lot of fun in the process. BTW, I am also a senior citizen (I cut my programming teeth back using punch cards and Structured Basic when it first came out). If anyone needs more clarification of what I am trying to accomplish please let me know.  Thanks in advance for any assistance/advice.

• Hi , I was considering this start up http://adshir.com/, for investment and i would like a little bit of feedback on what the developers community think about the technology.
So far what they have is a demo that runs in real time on a Tablet at over 60FPS, it runs locally on the  integrated GPU of the i7 . They have a 20 000 triangles  dinosaur that looks impressive,  better than anything i saw on a mobile device, with reflections and shadows looking very close to what they would look in the real world. They achieved this thanks to a  new algorithm of a rendering technique called Path tracing/Ray tracing, that  is very demanding and so far it is done mostly for static images.
From what i checked around there is no real option for real time ray tracing (60 FPS on consumer devices). There was imagination technologies that were supposed to release a chip that supports real time ray tracing, but i did not found they had a product in the market or even if the technology is finished as their last demo  i found was with a PC.  The other one is OTOY with their brigade engine that is still not released and if i understand well is more a cloud solution than in hardware solution .
Would there  be a sizable  interest in the developers community in having such a product as a plug-in for existing game engines?  How important  is Ray tracing to the  future of high end real time graphics?

• Good day,

I just wanted to share our casual game that is available for android.

Description: Fight your way from the ravenous plant monster for survival through flips. The rules are simple, drag and release your phone screen. Improve your skills and show it to your friends with the games quirky ranks. Select an array of characters using the orb you acquire throughout the game.