Posts mit dem Label Flash werden angezeigt. Alle Posts anzeigen
Posts mit dem Label Flash werden angezeigt. Alle Posts anzeigen

Making a platformer with the Citrus Engine Part 1

climbing and jumping enabled, but
the art department is still on holiday...
A little while ago I stumbled upon the Citrus Engine,
a Flash framework for making platform games. Included in the framework are lots of classes for platform objects, collision control via Box2d physics and camera and input controls giving you a headstart  with your next platformer. My game is still in the early development stage but the engines classes are well documented and easily tweakable to all my needs. I soon modded some build-in objects with custom functionality. On top of all the engine comes with a nice editor (an Air app called "Level Architect") that makes the level design a painless and fun time. Above you see a screenshot of a level done in the Level Architect, still with my development textures I will swap out for the final game art later.
Stay tuned for the next entry in that category to learn more about the development of a multilevel platformer done in Flash!

Bonzai

While recovering from my not-so-funny time in hospital I made this little running game. You must guide your tiny samurai throgh the parcour with up and down swipes of the mouse while collecting health and shield potions. Every now and then a  wooden "soldier" blocks your way which must be destroyed with sword attacks- i.e. your left mouse button. That way, while attcking you cant swipe and fall behind and have to run harder.
The engine for this game was written from scratch in Actionscript3 and is still in a somewhat early stage. The game is playable but might be a bit rough around the edges.


Play here:
http://www.daarboven.net/bonzai/

or on kongregate:
http://www.kongregate.com/games/daarboven/bonzai?acomplete=bonzai

The 36th chamber of Pong


Right after the global game Jam I started this fun little experiment with currently 17 of planned 36 variations of the Stick-And-Ball classic.
just head over to http://www.daarboven.net/36th_chamber/ and grab a racket.

Great Expectations

Some days ago Adobe announced to stop developing Flash Player for mobile devices, and at the usual sources it stirred quite a lot of dirt. Accusations flew, comments went up to hundreds and so the sh*t hit the fan again. But what exactly is this about? A software vendor decides on one of his products that in his opinion doesn't have enough market share and focusses in another part of the market- no big deal, imho. The media hype hollering "Flash is dead" again is something completely different and makes me wish Adobe was a little less verbose on it's business strategy sometimes, but for the heck of it, I'll get myself a nice cup of Javascript ;-) on the side and see where we all are this time next year. It's all about experiences, not the platform they are developed with. HTML5 still has some ground to cover...And I still ♥ Flash.

More control over the dataGrid component

When using the dataGrid component being lazy as me, you would just get the column names from your dataProvider

//name and rating are the field names in the dataProvider
myGrid.columns=["name","rating"]

and call it a day...
But that leaves you with evenly spaced columns and without any dynamic height of your grid, so you better resort to something like:

var nameCol:DataGridColumn=new DataGridColumn("name");
nameCol.headerText="Game";
nameCol.width=150;

var ratingCol:DataGridColumn=new DataGridColumn("rating");
ratingCol.headerText="Rating";
ratingCol.width=60;

myGrid.columns = [nameCol, ratingCol];
myGrid.width=210;

myGrid.dataProvider=new DataProvider(dp);
//auto-height
myGrid.rowCount=myGrid.length;

which will let you size the columns at your will and have the component grow as you plug in more entries.

Dude, where's my DragOver?

Having it not used for a long time I found out today that AS3 has no DragOver in its MouseEvents. So after a bit of research dugged out several solutions with a custom Event Class but finally resorted to this little if.. statement in my Event Handler for MOUSE_OVER:

//pcont serves as a container for about 100 clips 
//inside that will react to dragOver 
 
//activate on Mousedown immediately
pcont_mc.addEventListener(MouseEvent.MOUSE_DOWN,onDragOver);
pcont_mc.addEventListener(MouseEvent.MOUSE_OVER,onDragOver);

function onDragOver(e:MouseEvent):void
{
  if(e.buttonDown)
   {
     //the Mouse is pressed, 
     //Do something here
   }
}


the buttonDown Property of the MouseEvent makes sure that the Mouse is pressed while you hover your mc.
A more advanced solution can be found at Andre Michelle, he wrote some class files and stuff to adress this shortcoming of Events.

attachMovie in AS3

Today I wrote a little replacement snippet for the deprecated attachMovie. The snippet has 3 parameters for the linkage name in the library, the name of the displayObject you wish to attach the MC to and an optional name param to identify it by name on the display list later on:


function attachMovieClip(mcName:String,target:MovieClip,newName:String="")
{
var mc=new (getDefinitionByName(mcName) as Class);
mc.name = newName;
target.addChild(mc);
}

along with Lee Brimelows very useful snippet panel for Flash CS4 attaching MovieClips from the Library at runtime is a bit less complicated especially for AS2 veterans ;-).

the xml snippet for the snippet panel is here for convenient copy/paste:

<snippet>
<title>attachMovie AS3</title>
<code><![CDATA[function attachMovieClip(mcName:String,target:MovieClip,newName:String="")
{
    var mc=new (getDefinitionByName(mcName) as Class);
    mc.name=newName;
    target.addChild(mc);
}]]></code>
</snippet>

Have fun!

shortcut != shortcut

As I found out the hard way as usual, the Flash CS4 Authoring Environment has an ugly little glitch:
depending on the focussed window the shortcut STRG+G groups selected items on the canvas (if the canvas has focus) or fires the dialog to go to a certain line in the script window (if that, you guessed it, has focus). So watch out when you're in some shortcut routine while editing as you might mess things up...