# Unity Unity or LibGDX for beginning 2D games

## Recommended Posts

Xycaan    142

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
kburkhart84    3187

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
JVallius    124

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.

## Create an account

Register a new account

• ### Similar Content

• I've been using async-await in Unity 2017 for awhile now and went through some hurdles getting it to work properly with the unity way of doing things. In order to avoid anyone else suffering the same problems I've posted a tutorial with what I've learned here:

http://www.stevevermeulen.com/index.php/2017/09/23/using-async-await-in-unity3d-2017/

•
Hi, I would like to have an opinion on what I can improve and change in my first published game.
The game was made on Unity3D.
Thank you.

• You are a US Army soldier, and one day an unknown enemy attacked your base. Now your task is to survive and protect the base. There are a lot of weapons in your arsenal. Survive this nightmare at any cost.

• Hi,
I am composer and sound designer that is trying to learn some codeing  Could You help me and tell me what should i add to change volume to 1.0F when enter trigger
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class AudioPlay : MonoBehaviour {

public AudioClip strings_1;
AudioSource audioSource;

// Use this for initialization
void Start () {
audioSource = GetComponent<AudioSource> ();
audioSource.PlayOneShot (strings_1, 0.0F );   - when game starts i want it to start but with 0 volume
}
// Update is called once per frame
void Update () {
}
void OnTriggerEnter2D (Collider2D other)
{
if(other.gameObject.tag == "slotviolin")
{
Debug.Log ("coilder works");

// how can i change volume to 1.0F and if it's possible how to make it smooth ?

}
}
}

Thanks

• Hold out as long as possible in the "Arena of Death." Only your skill and the correct tactics of combat will help you survive in the Arena. Nine types of weapons are at your disposal, but remember that cartridges are limited and they need to be spent wisely. You must prioritize the position and the type of weapons in order to achieve victory.   Awaiting you:   - 9 types of weapons - Dynamic gameplay - Different types of opponents, with their own characteristics and weaknesses - Increasing complexity   Download https://falcoware.com/DeadArena.php

• 14
• 20
• 35
• 13
• 39