17

Does anyone know of a simple "Hello World" for making games for ubuntu? I've seen the Getting Started with Quickly video.

Any examples for platformers or something like that?

EDIT: Just a recap of the answers.

Blender Game engine -- Uses python

Pygame -- Python

MonoGame http://monogame.codeplex.com/ -- some sort of XNA ?

QuakeC -- This a Quake flavored C like lang. See: Steel Storm http://one.steel-storm.com/

2
  • 7
    See: developer.ubuntu.com/community "Participate on AskUbuntu › A collaboratively-edited question and answer site for Ubuntu users and developers. 100% free, no registration required Ask a question now ›" I think askubuntu is supposed to be for developers as well.
    – a.m.
    May 12, 2012 at 20:42
  • 2
    I personally feel this is fine, since on developer.u.c it's mentioned on AU. If the OP can get a little more specific on what they are looking for, then that'd be best.
    – jrg
    May 13, 2012 at 1:26

12 Answers 12

10

One fast and easy option is Quickly.

Creating a project is as easy as typing this at terminal:

quickly create ubuntu-application my-new-project

See this intro video.

Also this is a great site: http://developer.ubuntu.com/get-started/

And, of course, the manual: man quickly

You will be using python which is also great for 3d games, see Panda3D.

5
  • 1
    Yeah I would start with that one. May 12, 2012 at 21:16
  • @desgua I've seen that video. Do you have any experience using Quickly as a starting point for game dev?
    – a.m.
    May 13, 2012 at 11:59
  • Im thinking Quickly + pygame(?) works well for like, point and click type games, maybe not so much to make platformers...
    – a.m.
    May 14, 2012 at 17:31
  • I can not agree with you. There are people even trying to use python code for Android games (just to make an example of the power of python) See this: kivy.org/#home
    – desgua
    May 14, 2012 at 19:04
  • Pygame is pretty good pygame.org/news.html and if its just making great quick games Flash still can't be beat. May 14, 2012 at 19:33
8

Blender can make a 3D Game with Python: http://www.blender.org/features-gallery/features/

Is posible to make a simple hello world game there, its fully integrated with Sound, Physics simulation, GLSL, plugins for a lot of things (Networking and Web plugin included), good and professional workflow.

3D Platformer: http://www.youtube.com/watch?v=BGqyvX4P6Pg

Features Demo: http://www.youtube.com/watch?v=SjFGDcGcEjE

Panda3D its cool, but its not a Game Engine, its a bunch of Python Library where you can assemble a Game Engine, but its not fully and seamless integrated.

Ogre3D its like the same, its not a Game Engine, its just a 3D Graphics engine, where you can assemble a Game Engine, you have to code your own Sound for example.

1
  • I think Ogre3D and Panda3D are supposed to be a 3d graphics engines only and should be used with SFML or SDL to expand from 2d to 3d and with Bullet or PhysX to integrate physics. It's simple to do when you're already familiar with any of the above.
    – cprn
    May 31, 2014 at 15:46
6

Just like on any operating system you will need to choose a programming language that can use OpenGL for graphics. Then just develop the game.

Since a lot of applications on Ubuntu are open source you can find one in the software center that is free and use the following command: sudo apt-get source gameName That will give you an idea of how games that already exist are made for Ubuntu. You can also research how to package debian packages for when you think you are ready for distribution.

2
  • Why the OpenGL requirement? There are many alternative libraries/languages that can make games.
    – Pubby
    May 12, 2012 at 22:17
  • 1
    @Pubby can you name some?
    – a.m.
    May 13, 2012 at 11:59
4

Have you checked out PyGame? it is a great library for making games. There is lots of games already made that you can read the code and learn a thing or two. I am currenlty devoting my free time in learning to make a platform game just for the sake of learning. I will post my learnings and reply later with some actual work

Please do check out http://www.pygame.org/wiki/tutorials

Hope this helps

1
  • I have seen + used pygame some. Do you know of any real games that have been written in it? Real = A whole game (not just demos) with some decent graphics and game play
    – a.m.
    May 14, 2012 at 17:23
3

Panda3D is a nice cross platform game library for Python and C++. It's developed and maintained by a group at Carnegie Mellon, and it has been used in a few commercial titles. It adds simpler abstractions over OpenGL, OpenAL, and Bullet, and there are a number of getting started examples available, including a 2D asteroids game.

http://www.panda3d.org/

http://www.panda3d.org/manual/index.php/Sample_Programs_in_the_Distribution

2

I strongly advice to get interested in this: http://monogame.codeplex.com/

1
  • That looks pretty nice too.
    – a.m.
    May 15, 2012 at 13:08
1

Some game engines that work with ubuntu are Panda3D and love2d. Both are very easy to learn and have good documentation and community.

1

Unfortunately, there is no simple Hello World for games. The smallest Hello World ive ever been able to come up with for a game using just code, not quickly or pygame, is about 50 lines of C code that inits opengl and various C headers, sets up some opengl stuff and opens a window with hello world printed.

Game programming, even on Linux, is not as simple as most people think.

If you want something easier though, Blender 2.6 has a built in game engine, it uses Python and is very intuitive, but less flexible than straight C + OpenGL in my opinion.

Some resources: nehe.gamedev.net Google ;) there are other floating around, i just cant remember the names of them, sorry :|.

0

I would also like to recommend qt and qml

0

Here is a 50 line Tic-Tac-Toe:

import java.awt.*;  
import java.awt.event.*;
import javax.swing.*;

public class TicTacToe extends JFrame implements ActionListener {
    private JButton [] button  = new JButton [9];
    private int count = 0;

    public TicTacToe () {           
        super ("Tic-Tac-Toe");
        setSize (300, 300);
        setDefaultCloseOperation (JFrame.EXIT_ON_CLOSE);
        setLayout (new GridLayout (3, 3));
        init ();
    }

    private void init () {           
        count = 0;
        for (int i = 0; i < 9; ++i) {
            button [i] = new JButton ("");
            button [i].addActionListener (this);
            add (button [i]);
        }
        setVisible (true);
    }

    public void actionPerformed (ActionEvent a) {    
        String letter = (++count % 2 == 1) ? "X" : "O";
        for (JButton jb : button) 
        if (a.getSource () == jb) {
            jb.setText (letter);
            jb.setEnabled (false);
        }
        if (count == 9) {
            for (JButton jb : button) 
                remove (jb) ;
            init ();
        }
    }

    public static void main (String [] args) {           
        new TicTacToe ();
    }
}

Since it is Java, it isn't bound to Ubuntu, not even Linux, but will run on Solaris, Apple and Windows as well - where a JVM is.

But that is similar for solutions in Smalltalk, Python, Ruby, ... - even in C or C++ when a portable framework is used like Qt or Gnome, and not some proprietary MFC-classes. In C and C++, of course you have to recompile the stuff.

0

The simplicity of making games is based on the programming language/environment you choose. For advanced programmers, coding your game directly in a programming language of choice (C/C++/Python/Java/etc) may be the best way.

For hobbyists/non-coders who like a simple drag and drop interface to create games, I recommend 'Stencyl' (http://www.stencyl.com/).

The 'Stencyl' help website has all the resources for getting you started with creating games. You can also directly go to the 'Crash Course 2' help page to create your first game entirely from scratch in 'Stencyl' (http://www.stencyl.com/help/view/crash-course-invaders-1/). The 'Crash Course' is given in 'parts' and is very easy to follow.

-1
//A Hello World for game
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main()
{
    int a=5, answer;
    printf("I am guess number game\n\n"); getchar(); 
    printf("I have a number\n\n"); getchar();
    printf("...between 1 until 10...\n\n"); getchar();
    printf("Try to guess: \n\n"); scanf("%d", &answer);
    while(1){
    if(answer<a){printf("\nYours %d, too small...\n\nInput again: ", answer); scanf("%d", &answer);}
    if(answer>a){printf("\nYours %d, too big...\n\nInput again: ", answer); scanf("%d", &answer);}
    if(answer==a){printf("\nYou're Right! My number is %d!\n\nDa daaag...", a); break;}
             }
return 0;   
}
1

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .