Accurately Simulating Car Movement in Flex

Posted on December 30, 2009 by Tony Fendall.
Categories: Adobe, Flex.

When I find time (which is increasingly less often), I always like to set myself technical challenges to solve.  I enjoy the challenge of it, and every so often I actually produce something which someone else could find useful.

Car Movement In the last couple of days I have been trying to accurately simulate the movement of car (two steering wheels, and two fixed wheels).  This is more complicated than it first appears because, when the car is turning, it is actually rotating around a point which is outside itself.  The diagram to the right should help to show what I mean.

Getting this form of motion to work properly involves some complicated co-ordinate geometry to make points rotate around other points across multiple frames of reference.  It took me a while, but I finally managed to get it working today.  You can check out the result below :)

CLICK HERE TO VIEW SOURCE

Flash Games in Flex Part 2 – World Builder

Posted on September 21, 2009 by Tony Fendall.
Categories: AIR, Adobe, Flex, Gaming.

Since my last post I have continued working on little ‘cat herding’ game as a way of learning about how a simple 2D game engine works.  It quickly became apparent to me however that I was going to need a tool to help me define levels for the game as manually typing out the level definition (several large int arrays) was becoming very tedious.

A ‘World Builder’ application is quite a different puzzle to building a game, because the world builder not only needs to be able to render the level to the screen, but it also needs to be able to update the level in a fast and elegant way.  These constraints are directly contradictory when you are trying to decide on the data structure to represent your world, and it took me several different attempts to get it right.  What I eventually settled on can be seen above, and you can download the source here.  Read on for an explanation of how it works.

Note: All of the tile assets used in this demo (and my previous one) have been borrowed from the application RPG Maker XP. It’s an awesome piece of software!

(more…)

Let’s Go Walk About- Flash Games in Flex

Posted on September 18, 2009 by Tony Fendall.
Categories: AIR, Adobe, Flex, Gaming.

 

 

Recently at work I haven’t been doing much actual Flex development.  Instead I have been spending my time working on a data mining/business intelligence system which is an intricate combination of some complex SQL, Ruby scripts and some software called Pentaho.  Long story short I was starting to miss the feeling of getting my hands dirty in Flex code, so a few days I go I started messing around with building my own rudimentary game engine from the group up.

Above you can see what I have built so far in about 3 hours total coding time spread over the last four days.  The age old adage “never re-invent the wheel, unless you want to learn something” has proven true here once again also.  There is quite a lot of trickery to get even this small number of objects to draw themselves onto the screen in a fast, efficient way.

I’ll probably release the source code pretty soon. It’s still a bit in a state of flux so I’m not ready to let other people read it just yet :)

If I continue to have a bit of free time up my sleeve in the next few weeks I hope to port this project to AIR and have a go at trying to construct the map and characters from a definition in a text file.  At present the layout is defined in a 2D int array, so the conversion will hopefully be fairly simple.  If that works out then I’ll probably try and remember some of the AI techniques I learnt back in university… Should be fun :)

Custom DataGrid Cell Roll Over Example

Posted on March 9, 2009 by Tony Fendall.
Categories: Adobe, Components, Flex.

A few days ago I was asked this question via a previous blog post:

Hello,

Came to this blog searching for a specific issue, which might be nothing for you guys, but have been hitting head for almost two days now.

I have a DataGrid of numbers. All I want to do is that when a mouse rolls over a specific cell, that cell gets highlighted with say, green color, not the whole row.

I have not gotten past this, but as a next step would like to increase the font of the text in that cell as well.. so to emphasize it.

I will appreciate any help or pointers in the right direction.

~Lead

I responded with a brief explanation at the time, but this afternoon I decided to see if I could whip up an example application showing how this could be done.  I managed to come up with some code that is both quite simple and reusable. You can check out my demo application here.

 Cell RollOver Example
Right click on the application to View Source

(more…)

SmallWorlds in the Press (Greatest Flex App Ever!)

Posted on May 20, 2008 by Tony Fendall.
Categories: Adobe, Flex, Web 2.0.

Computer World magazine ran this article today on SmallWorlds.  SmallWorlds is gearing up for a public release in the next little while, and the latest version looks fantastic!  Built entirely in Flex and Flash, SmallWorlds is launching the next generation of online virtual world which users don’t have to download and install.

If you work with Flex, and would like to see the potential of Flex get some wide spread publicity (or if you just think SmallWorlds is cool :) ), please help us out and Digg the article. Thank you!  

Flex LoadingImage Component

Posted on May 19, 2008 by Tony Fendall.
Categories: Adobe, Components, Flex.

My LoadingImage component takes a regular Flex Image component, and adds a self contained ProgressBar to it to show its own loading progress.  I have wanted a nice simple component like this a few times now, so having nothing better to do this evening,  I decided to whip one together.

Check out the demo by clicking on the image below. Full source code is available by right clicking on the application.

LoadingImage Component Example

PostACard – 360|Flex API Contest Winner!!!

Posted on April 11, 2008 by Tony Fendall.
Categories: Adobe, Flex.

712382 Today I received a pleasant surprise when I found out that my PostACard application won the 360|Flex API Contest Community category!  It was a while coming, but I’m stoked to have won :)

Thanks to 360|Flex, and Degrafa for putting the contest together.

A special huge thanks so much to everyone who voted for me!  I really appreciate it!  The only thing I can offer you in appreciation is the full source code of the application. I hope you find it useful :)

Hands Up! Who likes FREE SOURCE CODE?

Posted on April 3, 2008 by Tony Fendall.
Categories: Adobe, Flex, Life.

Your vote counts A few weeks ago now I developed my PostACard app.  PostACard is developed entirely in Flex, and sports an easily reusable movable UI module as well as many other features which are easy to reuse and learn from.

After finishing PostACard (total development time was 6 weeks), I made the source code (both the Flex code, and server side PHP) available on this blog, so that anyone could check it out.  I place no restrictions on how you use this code.  If there’s anything in there that’s useful to you, then you can do what ever you like with it. You can get the code here!

I do have one favour to ask however.  My PostACard app has been entered in the 360|Flex API contest, and the voting to determine the winners closes next week.  If you like free source code, and would like to encourage me to make more code and examples available on my blog :) then please take a minute of your time to head over to the contest page and vote for me.

(more…)

Photoshop Express Out Now!

Posted on March 28, 2008 by Tony Fendall.
Categories: Adobe, Flex, Web 2.0.

pseAdobe’s long awaited free, online edition of Photoshop is now released, and you can try it out here.

I had a bit of a play with it today, and it looks to be very well put together Flex application!  There are a lot of very nice technical aspects, including the use of modules to reduce the weight of what would other wise be a quite heavy app.  In my honest opinion however, it’s a little bit light on features.  Scrapblog for example has more photo editing features that this first version of Photoshop Express.

I’m loving the new trend of ‘useful’ Flex application.  Between Sliderocket, Buzzword and now Photoshop Express, Adobe is rapidly building a very compelling suit of applications.  It’s a great time to be an Adobe Flex developer!

Flex Builder 3 – My shiny new box!

Posted on March 14, 2008 by Tony Fendall.
Categories: AIR, Adobe, Flex.

Picture 7Woohoo!!! My shiny new copy of Flex Builder 3 Professional came in the mail today!

Thanks heaps to Adobe, and to the members of the NZFXUG for making it possible for me to get a copy of FB3.  I can’t wait to start trying out all the new features! :)

It’s funny, but I’ve never owned a boxed copy of an Adobe product before.  I guess that’s because we live in the age of software downloads and emailed serial numbers.  Either way, this is getting pride of place on my shelf, ready to impress anyone who might ask me to code for them :)