Tag: Haxe NME
Greetings once again, time to talk about something I almost forgot in the whirlwind of life, and it’s a game!
Prior to Jadecliff, I worked at a small marketing company called Stefan and Stephan of whom Jadecliff was a large client. When I started with S&S around April-May 2013 one of my first projects was to play with an idea for a mobile game relating to their nearest retail site, Marldon Christmas Tree Farm.
I wanted to try and make a runner-type game in the tree farm, and over a couple months and iterations I think we came out with something kinda cool – although requiring more work to get to release than we had time to do.
Work was ended on this project in the final days of July, about 2 months of work in total with some other tasks in between.
Continue reading ““Where’s Woodchuck?” Game”Hello everybody.
Long time no blog, so here’s a quick catch up: I got a job at a small start up doing many varied and interesting things. The first project I was given built on my experiences with game development, and somewhat outstandingly I got to start writing a new game in Haxe NME! I can’t go in to details about the title right now, but it’s 99% complete and looking good.
One desired aspect of the game was an online leaderboard of some sort, so we can assign rewards to weekly/monthly winners. I’d never even looked at NMEs web function before, vaguely deciding I’d worry about highscores in Tower Defence “at some point”.
To my relief it’s super simple to use, and with a few php files on a server I’ve got a nice simple highscore system running… Someone’s bound to find this useful since I couldn’t find any complete samples online, so here we go…
Continue reading “Online highscore system for Haxe NME”Well I’ve spent a lot of my downtime the last few days crawling through C++ in the Visual Studio debugger, and gathering crash data via adb from my tablet, all in the name of fixing threading bugs! A few core classes lightly stripped down and occasionally rewritten, a few things jiggled about and we have something that’s stable [on Windows].
I left several copies of this code running the other day as a test — none explicitly crashed, although there are persistent memory leak issues (aka, “gunking up”) over time which eventually lead to what is basically a freeze on the second thread, which does all the work. But in my testing all the sessions ran for at least half an hour at double speed (only a debug option right now, sorry), notching up an impressive health of over -5000. For reference, besides the threading related crashes everything else is basically the same as in the previous demo, so still lots of unfinished/unfixed/placeholder content and code.
So NOW go download this demo of Tower Defence, representing build 44.
Progress with Tower Defence has been slow recently, what with moving and the general disruption that brings, but the other day I did manage to settle in and resolve a few long standing and occasionally nasty bugs which brings the game to a highly playable level. As such, I felt it might be prudent to make a demo available so people can actually try this thing out themselves rather than watching my boring videos.
I’m a long way from guaranteeing it’s crash free, but it’s not far off. There are also bugs galore (see full release notes after the break), and a few things are disabled for being either half implemented or inconsistent in performance or reliability, but it gives a reasonable overview of the project. This release is in the form of a Windows binary, although if there’s any interest in OSX/Linux/mobile builds I’ll happily crank one out and you’re welcome to see if it works.
Occasionally I start Googling random collections of words related to video games — more usually, video game jobs, hoping some golden ticket is going to fall right out of Mountain View or something. I often end up reading lots of forum threads and blog posts about the topic and how to make yourself seem attractive to studios etc etc, and it was within one of these little quests that I read an idea that nagged me, “Just make something … Tetris or something, just show you know what you’re doing.”
So a few days later I got up and made Tetris.
All told it was maybe 6-8 hours work split across two days: Mostly production, with the final couple of hours on day two dedicated to bug squashing. Anyway, it’s super simple but I think it’s kinda neat for what it is. As ever, this game is built with Haxe NME (3.5) – to compile the source you will also need the Actuate tween library installed. Download the source here.
Continue reading “Quick project: Tetris”
Hello once again!
Today I’m happy to offer some code from my early prototypes of Tower Defence, build 13 from September/October ’12 if anyone is pedantic enough to want to know. It’s super basic: No maze generating algorithms yet, not much in the way of gameplay. A random maze is created (i.e, each map tile is 50/50 whether its walkable or not), start and end points generated and a route found between them using A*, and an “enemy” (green square) moves along the path. You can create a single weapon type – the gun – which fires very slow moving bullets at the enemy.
This code also contains remnants of my quick and dirty collision system, although Box2D is actually running the show.
Continue reading “Tower Defence prototype code”
Within the nme.geom package of HaXe NME you’ll find Matrices, Points, Vectors, Rectangles and… ColorTransform? Yes, it seems a slightly odd place to put it, but that’s where it is, and it can be useful in your project. No doubt, there are endless things you could do, but I wanted to talk briefly on how I’ve used it across my previous Pinball project and now, in Tower Defence.
Simply, sometimes you want the same object to appear multiple times in your project, but with subtle variations. Behavioral changes can be accomplished in code by subclassing, size variations by scaling, but what if you wanted it red in one instance and green in another? Including the same image twice with different colours seems redundant, even if the images in question are quite small, so what are your options? Well, a ColorTransform is an option if the image is a simple, single colour. In Pinball, I used this method to colorize the lights and lighting effects – the image files themselves were greyscaled, and were coloured in code before being displayed – and now in Tower Defence, I’m using it on some UI elements (the slider knob’s that change colour dependent on value).
Let’s step through how this works. First, of course, you have to create a graphic you want to use. Here’s the image of the slider knob in Tower Defence, as it came out of Photoshop…
Hello! Sorry that last post was so brief, but I hope you liked the video! Here’s another one for you, with some loose ends tidied…
Continue reading “Longer Tower Defence update”
Hey all, just a quick one this time. My tower defence game has some graphics (disclaimer: none final) and a few new little features and so I figured it’s probably time to show more of what works.
Continue reading “Tower Defence update”
Hello again, today I bring you another lesson learnt.
When you choose Haxe for a project there are a wealth of 2D physics engines available, mostly ports of other popular engines, like Box2D. There are actually a few distinct ports to Haxe of various versions of B2D, but the most up-to-date and the one I’ve been using is Joshua Granick’s port of 2.1a. You can get it from Haxelib by opening a command prompt / terminal and running “haxelib install box2d”
In brief, it’s fantastic. Once you get a handle on how it works and where all the bits you want to use are it’s pretty simple, a far cry from the engine I initially experimented with – Physaxe – which was basically 20 pages of pure maths disguised as classes and functions! But there are some small issues I’ve run across while using it, and here comes the latest (and its solution, I wouldn’t leave you hanging!)
Continue reading “The intricacies of removing bodies in Box2D”