Browser game programming in linux - linux

My friend and I are looking to play around with building a browser game (e.g. Farmville) from a linux environment. Flash seems to be the way most browser games are built, but from what I google flash programming can't be easily (at all?) done from linux. Java seems like the leading candidate, but I am rather bamboozled by all the options out there. What platforms should I consider?
As an aside, I have a strong-ish C++ background and some professional experience with Python.

For browser based games, there are 2 main options if I remember correctly:
Flash, as you've already noted is the most common options. Usually this is done using adobe's software (around $200) or just an actionscript compiler (which is more programming like then normal flash). For Linux, your best bet may be: Burrito 4 Linux with the flashpunk libraries for your game engine.
Second most common option is Java, in which case you'd have to use the .applet package for.
Since you have C++ experience, I would recommend trying a flash actionscript compiler. I've personally used FlashBuilder, but I could not run it in Linux, so your next best option is Burrito 4 Linux noted above.
Hope this helps!

Use the FREE adobe flex SDK on linux.
Gives you flash/flex libraries, and command line tools to compile SWFs, flex, and air applications.

Related

Haxe / OpenFL / Flixel

I've been looking through the sites of Haxe / OpenFL / Flixel but am struggling to understand what each one is for.
As I understand it:
Haxe is a language that can be deployed to multiple platforms.
OpenFL is something to do with Flash.
Flixel is a library to help you make games.
Could anyone correct me/make it clearer.
Haxe
To quote from haxe.org:
Haxe is an open source toolkit based on a modern, high level, strictly typed programming language, a cross-compiler, a complete cross-platform standard library and ways to access each platform's native capabilities.
Language:
Haxe is a programming language. It's similar to AS3, C# etc. It is strictly typed, but has great type inference. It has a lot of powerful features such as Pattern Matching, Enums (ADTs), Macros etc. These work no matter which target you compile to.
Standard Library:
Haxe can compile to JavaScript, C++, Flash, Java, C#, PHP, Neko, HashLink, Python and Lua. It has low level standard classes that work consistently across platforms, such as: String, Int, Float, Date, Map etc. It also has some useful cross platform code for things like Serialization, Xml, Json, Date formatting etc.
As a general rule, anything on api.haxe.org that is in the top level, or in the haxe package, is going to work whichever target you compile to.
Each target has its own package. These let you access native capabilities of that target via externs. Eg. js.html has DOM externs, flash has externs for the Flash API, etc.
There is the sys package, which is available on "backend" targets: C++, Java, Neko, HashLink, PHP, Python and Lua. It's also available on JavaScript/Node with the hxnodejs library.
Other stuff:
The Haxe compiler is super fast compared to a bunch of other compilers. That's a selling point in itself. There's also macros, which let you do a bunch of pre-processing in a really powerful way. Then there's tools like Haxelib which let you link in with 3rd party libraries.
OpenFL
When Haxe first started, Flash was still a big target, it was installed everywhere, and it was great for making games. A lot of Flash developers liked Haxe because it was fast, type safe, open source, and gave them more features. But the flash API (sprites, graphics, movie clips, events) only worked on Flash, not on mobile, or on HTML5 etc. Which was a problem once flash started becoming less popular.
What OpenFL does is make that Flash API work on other Haxe targets. So you wrote a Haxe game targeting the flash API using sprites and graphics and flash-style code. Then, you want to compile to C++ (for targeting mobile etc). OpenFL lets your Haxe code use the Flash API, even if targeting C++ or JavaScript. For example, OpenFL creates the flash.graphics.DisplayObject class not only for flash, but for C++ and JavaScript. So if you know how to write Flash games, you are close to writing OpenFL games already.
OpenFL also has some great tools for making it easier to deploy your games to specific platforms. Where Haxe targets are things like "JS", "SWF", "C++", OpenFL platforms are things like "iOS", "Android", "Switch", "HTML5", "Windows EXE" etc. When you hear about Haxe targeting mobile, a lot of the time it is OpenFL, because it works with Haxe to compile your code (into C++, JS, SWF or whatever) and then packages those binaries for mobile.
Flixel
Haxe is a language, compiler and standard library.
OpenFL builds on this and adds the Flash API working across targets.
HaxeFlixel builds on this even further and provides game specific APIs that work on OpenFL.
An example of how it all works together:
You create a game. All of it is written in Haxe. Things like player name, scores, and completion info all use data structures from the standard library. They'll work in your game, but you could also make them work on your PHP website.
Your game uses OpenFL to compile to Flash, HTML5, iOS and Android. As part of OpenFL, you also have access to standard Flash API classes, like the Stage and Buttons and MouseEvents, which you might use for your menu screen. Because OpenFL provides the flash.* classes for other targets, your app compiles to all different things.
For your actual game, performance is important, and the flash DisplayList approach is a bit slow and not optimised for gaming. HaxeFlixel is optimised for gaming, and is very fast. So you design your game with HaxeFlixel using their APIs.
Summary
Haxe is a language, compiler, toolkit and standard library. It provides the most basic tools for cross-platform code.
OpenFL is built on Haxe, and provides the Flash API to multiple targets (Flash, C++, JavaScript) and makes it easy to compile to a bunch of platforms: web, native, iOS, Android, Nintendo Switch etc.
HaxeFlixel is built on OpenFL - it uses the APIs provided by OpenFL to create a game specific framework that is high performance and easy to make 2D games.
I just recently discovered HaxeFlixel, and I LOVE it! I came from making games in AS3 using Flixel, and now I'll probably never go back!
So, to attempt to answer your question (and the way I understand it):
Haxe is sort of the bottom layer. It's the programing language that can be compiled into Flash, Windows, Android, iOS, etc, etc, etc.
OpenFL is a software development kit which uses Haxe to make it easier and smoother to get games to work via Haxe and allow you to easily harness the power of Haxe's compatibility while not having to deal with a lot of the hassle and problems that you can get into. It takes care of a lot of the basic stuff for you and makes it easier to code.
HaxeFlixel is a 2D Game framework based on a combination of Adam Atomic's Flixel for AS3 and Flixel Power Tools by Photon Storm. It makes it easier to make 2D games in almost the same type of code as in AS3/Flixel.
When just starting out, you should only need to worry about the highest level, which in your case is HaxeFlixel.
So, to summarize a bit: Haxe is a powerful programing language. You can try to figure out how to code with it 'as-is', which is complicated, or you can use one of a number of libraries to make it easier - OpenFL is one of these libraries.
You can use OpenFL on its own, and code a game with it, or you can use one of a number of different frameworks to make it easier - HaxeFlixel is one of these frameworks. There's also the Starling and HaxePunk frameworks which have their own pros and cons.
Opinion Time!
I highly recommend sticking with HaxeFlixel - since it was so similar to Flixel, I managed to pick it up and learn how to use it, and made this complete game in exactly 1 month and released a Flash, Windows, and Android version all on the same day - which is outstanding considering I had not touched Haxe before, and had never had time to even start looking at Android Development before. That game's source code, by the way, is completely open source, so feel free to dig in and see how I did stuff.
The community for HaxeFlixel is also pretty amazing and people will help you out and answer questions.
It's really not too hard to jump in and start working with HaxeFlixel:
http://haxeflixel.com/documentation/getting-started/
Follow those steps and you'll at least have a Hello, World! up and running in minutes (excluding the time it takes to download and install all the stuff). Like I mentioned earlier, until you're more comfortable with it, just follow the directions for Haxe and OpenFL but don't even think about it for now!
Good luck! And let me know if you make it anywhere or not!

How to create Flash animations / movies on Linux? [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
This is more of an assignment work. I'm trying to help a friend debugging his Flash animation. Now, when I'm at his place and at his MacBook, he's using Adobe Flash to create his animation, with those timelines, the AS3 editor, etc.
Now, I want to help him while I'm at home, but I don't have a Windows or Mac computer, and I don't have a Flash license (he's got his from the school he's going to).
I know about osflash.org, but can I work the same way as he does in Flash? I need those timelines, and obviously I need to compile and preview the .swf files.
I should explain, I've never worked with Flash before, and the IDE is quite weird to me. The only way I help him, is by providing general programming skills (since AS3 is just another OO language). I was thinking of installing a cracked Flash version in a Windows VM, but that's not how I'd like to work.
Is there a better solution to this?
He's doing his work in AS3, as I mentioned.
Since you are not much familiar with the flash IDE you should be not at problem. Since the only problem with linux & flash developers is lack of decent IDE.
AS3 programs can be compiled with the flex SDK. So you simply need to download the SDK for your linux ditribution. However do note that there are no timelines in case when you develop applications with code. Instead you work with Timer events.
Flash IDE actually hides the Timer implementation in a easy usable (neat) way to provide anyone to create an application quickly.
FLA is a proprietary format for Flash CS and earlier files. No, you cannot use them with Flex compiler, because the later is an OOS software. But you can tell your friend to avoid using them. It is in fact very common to use them only to generate graphic assets, but not the code. The typical workflow is to compile SWC or SWF to use as a library and to write the code in another editor.
Anyways, some practical things:
Developing AS3 proper, you can use Intellij IDEA (some people even like it and use on other OS then Linux, to be honest, I'm not a big fan of it, but it is of the same quality as the most industry-standard level IDEs)
Your another option (which I'm using) Some good soul "ported" Flash Builder for Linux (Flash Builder is originally an Eclipse plugin developed by Adobe). It's story on Linux is fogged by a mire of inconsequential decisions. Once there was a trial version, but Adobe never released it for Linux. The trial expired, then Adobe granted continuation for the trial version. Later, they seemed to abandon the product entirely. I'm not sure of its current status, but you can find it here: https://code.google.com/p/fb4linux/
Your another option, absolutely legal, but problematic: FlashDevelop, it runs considerably well in virtualization and the devs made an effort to ensure the best they can that the virtualized version runs fine. It also runs (to an extend...) under Wine. I tried the later, but I tried it a lot time ago, it was far from being perfect, but it was workable. Here's the thread at FD forum on this: http://flashdevelop.org/community/viewtopic.php?f=9&t=7621
FDT (from Powerflashers, a commercial IDE based on Eclipse) is said to run on Linux - never tried.
What I also used: Emacs with actionscrip-mode - it is barely a syntax highlighter. While using it I added some functions to run the compiler and debugger, but they are too crappy to share them :) seriously. So I won't.
More options:
Haxe, is another language that compiles to SWF. Less well-known, but considerably more advanced and more modern language. Besides compiling to Flash does a whole bunch of other things. I've seen it used inside MonoDevelop http://haxe.org/com/ide/monodevelop (haven't used myself). Similarly, it should be possible to use it inside FDT.
Haxe mode for Emacs (I'm currently trying to improve it, but it's not there yet), hopefully, in a couple of month it will be. Here's what I've gotten for now: https://code.google.com/p/haxe-mode/
Graphics:
It seems unlikely that you can find an editor matched to Flash CS in terms of editing vector graphics for Flash, but MXMLC (Flex compiler) can fairly well compile SVG. You can thus use Inkscape to produce some non-animated graphics... but YMMV

REALStudio / Runtime Revolution Alternative [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I'd just like to ask if there are other alternatives for REALStudio or Runtime Revolution?
I'm not looking for something like a .NET framework or a plugin. I want it to be fully self-contained like the aforementioned IDEs.
It should also be cross-platform.
NOTE:
Please don't mention Java. I already know of it.
Just to be clear, I'm looking for a programming environment that would let me create a desktop application for Windows, Mac OS X and Linux...
I still feel like I'm shooting in the dark by answering this question. It's unclear if you're looking for a programming language and GUI toolkit, or if you just want an IDE that is cross-platform. It's also unclear why you are abandoning REAL Studio, since it seems to meet your requirements.
Anyway, there are really a lot of options here, especially if you don't need one that uses the REALbasic language. I can only talk about the ones I am familiar with and have experience in using. Others can surely tell you more about dynamic languages like Perl, Python, Ruby, etc. etc.
First off, I'm not sure why you think that the .NET Framework is not "fully self-contained". Yes, it requires a runtime, much like Java does. But those two managed languages have gotten quite a bad rap for requiring a runtime. It seems people have forgotten that programs compiled in C and C++ can often require a runtime as well (at least they do on Windows).
I would take a second look at .NET. It is an extremely easy-to-use, rapid development environment, much in the style of REALbasic. VB.NET retains a lot of the syntax, while bringing you (in my opinion) even more powerful features. Since almost all desktop applications should be distributed with an installer (setup program), the requirement of a runtime is really a non-issue. Your installer should install the necessary dependencies at the same time as your application—the user will never be the wiser.
Of course, producing a desktop application with a user interface that is truly native across all three of your target platforms is going to be difficult at best. Windows, Mac OS X, and Linux all have vastly different platform conventions, and even though you can find environments that will let you generate an executable that runs on all those platforms, none of them are going to produce interfaces that actually look like a native application. I'm extremely picky about this, and you'll find that Mac users are, too. Windows and Linux users are much more accepting, but following standard platform conventions is the key to making your app easy to use and easy to understand. Conforming to the behavior the user expects and taking advantage of native widgets has a lot of advantage that developers (often prone to reinvent the wheel) seem to be forgetting recently.
The absolute best thing to do (in my opinion) is to write your code in a portable language like C++, and create the user interface using tools provided for each platform (For Windows, you might use the Windows API, or WinForms or WPF provided by the .NET Framework. For Mac OS X, you'll use Cocoa and Apple's Xcode/Interface Builder. For Linux, you'll do whatever it is Linux people do.) Then, you just have to recompile your application on each platform, and you get the best of both worlds.
A good compromise would be to use a GUI toolkit for C++ like Qt or wxWidgets that promises to generate cross-platform applications. Yes, the apps themselves are truly cross-platform, but they don't always have truly native interfaces. I understand that Qt has gotten better recently, but it's still not up to my standards. You and your users might be less picky. Note the "your users" part there. The Mac Office team discovered that Mac OS X users just wouldn't accept the ribbon as it was implemented in Windows. Mac Office 11 finally brings the ribbon to the Mac, but it looks completely different, having been entirely reimplemented to look like a native Mac OS X widget. By contrast, Apple's iTunes sticks out like a sore thumb on Windows. What's long been the standard for an innovative, easy-to-use interface on the Mac is regarded by many PC users as an abomination. But then again, native GUI is sort of my soapbox, so if you care, I recommend perusing my answers to other, similar questions:
Advice for supporting both Mac and Windows Desktops
What is the best library to use when writing GUI applications in C++?
If you goal is to have a self contained IDE with an easy to use GUI builder, that can produce standalone cross platform executables, then to the best of my knowledge, the options are pretty limited.
If you like BASIC (similar to RealBasic or RunRev), then you may want to look at www.PureBasic.com . Documentation and new material is sparse, IMHO. It has it’s own GUI builder, but for a bit more cash, you may want to pair it with PureVision.
For cross platform development using wxWidgets programming in C++, wxPython, wxLua or wxRuby, you may want to consider DialogBlocks.
The answers given here are terrible of course, but the question you are asking is a difficult one and there may not be an answer. I'm asking myself the same question as REALStudio doesn't work as well as I would like. Java is poor, difficult and ugly. .NET is the favourite but not cross platform.
Consider that appearance is a major problem. If the GUI doesn't look native, there's no reason why you can't design something superior (look at MojoWorld for example). I would tentatively suggest REBOL. Although it appears to be an interpreter a compiler could be purchased. As the software is free, if your program works reasonably well you might then buy the compiler. Not sure if it has an interface builder as the buttons are generated by code. The free version is moderately poor but has been improving in recent years.
Not being able to update the interface from a thread (Cocoa for example, I guess NextStep is really old now) seems to defeat the whole object of the exercise. Having Timers that don't run (REALStudio) also seems hopeless given that those are supposed to update the interface instead. Then you have Object-Orientation, an excuse for poor programmers unable to understand code. Not being able to 'GOTO' a button unless you put the code into a Timer pretending that it's a module (yey for for REALStudio). I can understand your problems. Try to realise that programming is HARD and that it only looks easy when you see the end results produced by experts like Apple.
So Java is proof that cross platform doesn't work. Give REBOL a try.

simple game development on linux

I'd like to develop simple 2d games on linux. Something like one below. The only decent tecnology I've found was PyGame. Is there any other worth taking a look? Is there a possibility to develop flash games on linux?
Thanks in advance.
I will have to agree with previous user , pygame is an amazing powerful and easy to use library.
Now about your flash games, there is a back door.
First forget about flash. Yes I know that this seems a bit out of topic , but no worries you can compensate for this.
Now python has something called Pyjamas, dont laugh its actually a very serious package. What pyjamas does is to convert python code to javascript code, all this happens automatically and you dont need to know a single line of javascript , even though knowing javascript could help as well. Of course the benefits of converting python to javascript means that not only you can run python apps inside any browser and any device supporting a browser including iPad, iphone, and pretty much anything else you can also use javascript libraries. Actually you can use only javascript libraries , so forget about using pygame with pyjamas.
Now HTML5 is the future, its still an ongoing project and far from finished, but YouTube already is using it with alot of success. Html5 together with the new version of javascrip offer features very similar to Flash, with the added advantage unlike Flash which is tied to Adobe , HTML5 is open source and a web standard. That means that borwser support Html5 out of the box with no need to install anything. So you could use HTML5 and Javascript to build your browser games. I think that HTML5 will replace the Flash in the near future. Remember because you will be using pyjama you will writing your code in python only, but of course you could mix it with some javascript code if you wish so.
I will advice for the time being epxlore pygame , because its dead easy to use, and when the right time comes and feel confident with python, take a look at pyjamas and fire away your browser games. The important thing to remember is that unlike other easy to lear language Python is a serious language used for almost anything, so you never run out of option. So do your coding and have fun.
Oh in case you need to check out pyjamas its right here.
Pyjamas Website
Here's a list of some open source game engines in general. You'll want to look at the cross-platform, 2D-oriented engines and see which one best meets your needs as far as programming language and features.
However, PyGame is pretty well-developed, and Python is an exceptionally easy and fun language to do anything in, including game development. I recommend you check out PyGame first, I think it would work well for your task.
As for developing flash games on Linux, there's little chance of that. To develop flash games you need Adobe's suite, and it is only compatible with Windows and Mac. So unless your computer can handle the stress of Adobe software (which is pretty high) in an emulated environment (Wine, which adds considerable hardware overhead), you'd need Windows or Mac OS X to do that. You can still play them, however.
There are flash libraries for games that work in linux. It's a but more of a pain in the ass but maybe all the hassle will teach you a thing or two ?
Here are some usefull links
http://flashgamedojo.com/go/
http://www.flixel.org/download.html (mentions some linux options)

Linux programming - getting started, how?

I've taken the plunge and installed Linux (Linux Mint 9 if that's important) on one of the boxes - and I'd like to start some small-time programming... but where to start.
My background:
Mostly LOB-applications in C#/WPF
Some XAL-basic
A wee bit of VB/VBA and SilverLight
I would like to turn to a new programming language - but still focused on desktop applications.
What I need:
An editor - preferably with good intellisense
A programming languages and the resources to get started
If anyone can point me in the right direction, I'd be happy for a little push...
EDIT:
Thanks for all the advice - I've come up with the following:
I'll start out with Python - and use Vim for the editor
I'll definetly try out Vala and Perl later and have MonoDevelop as backup editor - and if all else fails, I'll turn to C++. I've upvoted all answers as they all helped me.
EDIT2:
Okay - Vim was a bit too hardcore... Installed Cream on top.
Unlike the Windows world, where everything is designed to be Windows-only, I think it is quite typical to find that the rest of the world designs software to specifications, not to implementations. If you are developing in Java, then it doesn't matter what platform you intend to use, and Eclipse and NetBeans provide excellent tooling for Java on all platforms, Linux included. If you are developing in C++, then Boost and Qt provide excellent cross-platform support. If you need to go outside of Boost or Qt, then before delving into Linux-specific features, it is best to target the Single UNIX Specification also known as IEEE Std. 1003.1 POSIX, which will ensure that your application not only runs on Linux, but also on any UNIX-compliant operating system (including Mac OS X, FreeBSD, Solaris, and others).
As for IDEs and other editors... I think most programmers on UNIX platforms build from the commandline (using CMake, Make, scons, or some other standard build tool); however, there are plenty of IDEs with support for those that can run such tools automatically. Anjuta C++ and KDevelop are probably the easiest IDEs to use on Linux. Emacs (emacs, emacs-gtk, xemacs) and Vim (vim, gvim) provide a great deal of power and flexibility, but take a little bit more time to get used to. You might also want to consider a basic text editor such as GEdit (Gnome) or Kate (KDE); GEdit, though billed as a simple text editor, supports some more advanced coding features via a number of plugins. I don't recall whether it supports autocompletion, but it does support line numbers, automatic indenting, using spaces instead of tabs, commenting a block of code en-masse, and executing a Makefile with a shortcut.
Depends on how much you want to learn (from the easiest option to the hardest one):
Just use C# via Mono - that gives you access to most of the POSIX interfaces via Mono.UNIX, access to GTK# so you can do desktop apps, access to many linux libraries, so you can do more advanced stuff / integrate better. (you can program in Monodevelop - it's a Sharpdevelop clone, kind of VS-ish)
Learn Vala - it's a language compiled down to C, very similar to C# but closer to the bare minimum. It's gathers anti-MS people who wanted a response to C# IMHO. (never really used it, but apparently there's a Vala plugin for Monodevelop and the language itself is becoming more popular)
Learn Python - it's a scripting language. It's got bindings to most popular libraries (also GTK and QT) (IDE: anything that can edit text - you won't get good intellisense from a dynamic language anyways)
Learn C++ and QT, or C and GTK - although those are very low level languages where you will spend a lot of time just getting used to the environment. (IDE: Anjuta, Kdevelop, Monodevelop with C++ plugin, Eclipse+CDT, emacs, vim, etc. - anything goes really)
If you want "something new", but don't want to spend loads of time learning a completely new environment, I'd recommend trying out Vala. If you're more curious about different styles, go for Python, which I think has a very good tutorial for new people (but not new to programming): Tutorial or Beginner's Guide. With Python you also have an advantage of having the whole environment available in packages in any distribution, no such luck with Vala (yet).
Try perl and python and see what appeals to you. Learn bash to get around happily at the command-line. If you're feeling adventurous, give C/C++ a shot.
As for editors, this will probably spark up a holy war, but if you're using at the command line, check out vim and emacs, pick one, and lament never making friends of those in the "enemy camp." :-)
I say Python + Emacs or gEdit (what ever suits you)
Linux Mint is a KDE environment, right? That would make it pretty convenient for you to get started writing KDE apps in C++. The Qt toolkit which KDE is based on is widely considered to be relatively developer-friendly, which should make it easy for you to get started.
If you want to go on that route, I'd suggest downloading KDevelop, which is KDE's IDE (optimized for developing KDE programs, but it can handle several different languages). Alternatively, you could use Eclipse, which has C++ capability. You can find tutorials on how to develop KDE apps at http://techbase.kde.org/Development/Tutorials. (Unfortunately I think those are not as good as the documentation they used to have before KDE 4 came out, but it should be enough to get you started.)
EDIT: Come to think of it, you may want to try your hand at writing some C++ console (non-GUI) applications first, since it's probably easier to get comfortable with basic C++ before you jump into GUI programming. Given your experience, it shouldn't be too hard to pick up. Unfortunately I don't know of any particularly good resources to learn C++ with, but I'm sure that information is somewhere on this site, and KDevelop or Eclipse would work fine as an IDE for simple C++ console apps as well.
Weird that nobody suggested ALP, even if it is a bit outdated, it teached me a lot of things regarding the UNIX way of programming.
First, Learning C is a MUST!
Perl is underused for most stuff and you'll want to learn BASH Shell Scripting instead.
Grock the C code of existing (stable, well-written software) example is the Linux kernel itself! Google "Linux LXR"
Once you learn the basics to C (in Linux) the manpages are an invaluable resource. Just do man printf for information on writing characters to the screen, for example.
If you are talking GRAPHICAL GUI Programs, you need to learn GTK+ or one of the many cross-platform GUI toolkits (e.g. wxWidgets). Do not learn to program the X Windows System directly unless you are crazy.
For text editors, I like Komodo Edit and SciTE.

Resources