Make a game with Cocos2dx on Linux
Asked Answered
A

2

7

I'm some familiar with Cocos2d and Cocos2dx. But only I worked in Mac, I know which is possible work with this engine (Cocos2dx) in Windows, but I don't know if is possible develop a game on Linux.

By the way: I'm not talking about a port, I want develop a Videogame multiplataform on Linux. Would be great know the way of how start my game on Linux.

Thanks!

Allen answered 19/12, 2012 at 2:59 Comment(0)
H
4

While I haven't tried it, cocos-2dx is, according to their documentation, is usable on Linux although my understanding is that this means one can build android projects using cocos2d on Linux.

In terms of where to start, I've used both SFML and SDL as both are well supported on Linux. Both are cross platform although SDL supports a wider range of platforms - I have an SDL2 game in progress that runs on Linux and android for instance whereas SFML does not yet have android or iOS support. Coming from cocos2d though I think you'll find the SFML API easiest to pick up.

As a fair warning, the landscape is a bit confusing at present because both SFML and SDL have a popular stable release (1.6 for SFML and 1.2 for SDL) with one API along side a popular development release (2.0 for SFML and 1.3/2.0 for SDL) that has a similar but not identical API. This is particularly noticeable with SDL where the documentation for 1.2 is much better than the documentation for the development API. In terms of choosing one over the other, the stable releases are precisely that - stable. In both cases the development releases have been under way for some time so if you are willing to dig for documentation a bit and ask questions it's worth getting the new features.

There is book that provides a nice introduction to Linux game development that, while dated, might be a good first step if this is your first outing with games on Linux, especially if you decide to use SDL Programming Linux Games.

Update:

I saw the directions here and after (roughly) following them cocos2dx does build on my Ubuntu 12.04 x64 machine. The "Set up Environment" directions seem sound but the makefile information appears to be out of date as there is no build_linux.sh instead there is a make-all-linux-project.sh. After this finished pulling in missing deps and building I changed into the samples/HelloCpp/proj.linux directory and ran make. This created a HelloCpp binary in samples/HelloCpp/proj.linux/bin/debug. Running that popped a HelloWorld cocos2d screen. According to the output the verison is:

cocos2d-x debug info [cocos2d: cocos2d-2.1beta3-x-2.1.0]

That said, I don't see a lot of documentation for the linux port and most of the related community entries seem to be out of date so you may find more support from using one of the libraries I already mentioned.

Haight answered 19/12, 2012 at 3:49 Comment(2)
Yes, I know that Cocos-2dx is usable in Linux. You know if is possible develop a game on Linux with Cocos2dx for Windows, Mac & Linux? I think that my question is some ambigious, I wanna make a desktop game. I'm between use Cocos2dx or SDL with Box2d for make that. And thanks! I don't know SFML, and sounds cool!Allen
I've updated my answer with some more information as I was able to build cocos2dx for my linux box. As I mention I'm not sure how robust the port is and the community doesn't seem to be very large so you may still be better off with SDL or SFML.Haight
E
3

Download cocos2d-x project there is a test sample games which compiles on all platform android, windows, iOS , Windows Phone ...See you are going to code in c++ that's it then whether you build it in linux or any other platform doesnt matter for cocos2d-x kind of engine

so i suggest start with the sample projects of cocos2d-x .... and as you want to do it in linux ...make something then compile it in linux like I do ...

Eudoca answered 19/12, 2012 at 8:0 Comment(2)
You compile Cocos2dx in linux? How do you make that? I'm new in that, I don't know. And, if I make that, I will can make a multiplataform desktop game with Cocos2dx?Allen
@Allen : Yes cocos2d-x can me compiled in linux ,android,iOS, windows , windows Phone... Once you download it ..there are option on which platform you will prefer to make games... First make game in to the specific platform then with same classes compile it for other platforms ... Download cocos2d-x and see Samples folder you will understand ....how it works ..its too easy ..or else we are there to help you dont worryEudoca

© 2022 - 2024 — McMap. All rights reserved.