Archive

Archive for the ‘main’ Category

Flixel tutorial part 1

Φεβρουαρίου 24th, 2010 ktolis No comments

For the uninitiated, Flixel is a game engine made in/for flash. It is said to be much faster than regular flash because it ditches vector graphics for bitmap ones.

This is a tutorial series that will try to introduce you to the flixel sdk one step at a time. So here we go with part 1.

Flixel tutorial part 1: Set up flixel for Flex.

This part is for OS X users of Flex 3.0 IDE.

Step 1: Download the latest flixel version from http://github.com/AdamAtomic/flixel/archives/master and save on your favorite location on your disk.

Step 2: Start Flex and select File -> New -> ActionScript Project

Step 3: Type your project name (Tutorial_01) and store at a convenient location

Step 4: Click on “Next” button (not Finish) and at the source path field add the path to the library you downloaded from step 1 (you expanded it right?) and then click Finish

That’s it.. you’re done!.. well almost since you aren’t using the library just yet. The Flex IDE created a file titled “Tutorial_01.as” which we’ll have to replace so replace it with this one:

package {
	import org.flixel.*;

	[SWF(width="640", height="480", backgroundColor="#000000")]

	public class Tutorial_01 extends FlxGame
	{
		public function Tutorial_01()
		{
			super(640,480,PlayState,1);
			FlxG.debug=true;
		}
	}
}

In the first lines we use a 640×480 canvas with black color and later on we pass control to the class “PlayState”. We didn’t define Playstate did we? No!. So Select File -> New -> ActionScript Class and at the window that will appear type Name: PlayState, Superclass: FlxState and hit Finish. Now paste inside this one the following:

package
{
	import org.flixel.*;

	public class PlayState extends FlxState
	{
		public var myText:FlxText;
		override public function create():void
		{
			myText=new FlxText(0,30,100,"Hello, World!");
			add(myText);
		}
	}
}

What we do here is we create a new FlxText object called myText to print on screen “Hello, World!” and then we pass it to the game engine to attach it to the rendering loop with the add() function. We don’t need to use the update() function yet as we don’t change anything yet.

Flixel uses states to manage the code. This means that when you are for example in the main screen you should create a separate FlxState called Intro and write code there on what should happen and then pass control to another FlxState called for example PlayState which will have the main game code.

Although we didn’t write much you will notice that if you click on the flash area (to activate it) and then hit ~ then you will see the flixel console (we enabled it using FlxG.debug=true). You will be able to see the flixel library version you are using and the fps you are reaching (frames per second). In the time of writing I get 58-62fps (it’s trying to stay to 60 fps) and flixel version 2.21.

This concludes part 1 of this series. Stay tuned for more :)

Categories: Projects, Tips & Tricks, main Tags:

Flash! (not Gordon)

Φεβρουαρίου 22nd, 2010 ktolis No comments

I’ve always wanted to experiment with flash but the slow versions available on Mac OS X were always a mess. Not to mention the tools. Since Flex was released as open source and the sdk was split from the IDE the situation changed. Now with the release of Flash 10.1 the plugin starts to be workable again. With 10.1 the video sites don’t crash the plugin so easily (less than 1% probability now) and the performance has gone up a bit too since they started using better technologies like Core Animation. I’ve re-installed Flex IDE on my Mac and Flex sdk 3.5 for now. I’m playing a bit with Flixel. Last time I checked (about a week ago) they had stable releases but now all you’ll find is the github link and broken documentation (besides the autogenerated API that is). All in all this tiny library supports blitting and bypasses the regular vector drawing mode. A bunch of games are already using it although in most cases the developers are high school kids. This doesn’t mean the library is less than professional. The library is more than one needs to start away with flash game development, although you’ll need external obfuscators (like mochi) and other libraries for social networking. For the time being I am experimenting with the demos (the only relevant sample code there is) and want to run some benchmarks. I will try to post them here and at the project forums for the community.

Categories: Personal, Projects, main Tags:

WLAN Router working again!!!

Φεβρουαρίου 8th, 2010 ktolis No comments

After my short trip to Larisa I made my mind to fix the WRT54GL router that couldn’t connect with my home wlan. And after about 30 minutes of resetting and fiddling with the knobs I managed to succeed. My WLAN is now working again and my G3 and the PC will be online again woohoo!!..

Categories: main Tags:

HTML5 + OS X

Ιανουαρίου 26th, 2010 ktolis No comments

If you have an OS X machine you will proably feel enraged when you play movie clips on youtube as the flash plugin will suck all of your machines heart. No more. Visit http://www.youtube.com/html5 and apply for the html5 version of the site. Your system load will come down to a magical less than 5%. The reason behind this is because you skip the plugin and start using the embedded html5 feature to play video content online. Youtube decided to serve html5 content at the same time as flash content. I think it’s a clear win situation for the end-user. They have me at least on their side so far with this move.

Categories: /dev/random, main Tags:

27/1/2010 The day the world stopped moving…

Ιανουαρίου 26th, 2010 ktolis No comments

Tomorrow something big is supposedly coming to the world. From Apple Inc of course. Many years ago people started speculating on the Apple “iPad”. A “revolutionary” computing tablet. There is nothing revolutionary at Apple. There never was. It is evolution that is taking place!

In the design and computing industries there are many forces trying to compete with each other in order to find the next big thing. In most cases they all fail. Apple has managed through all these years, especially after the “comeback” of Steve Jobs to stay ahead of the competition. The solution to being ahead is not to produce revolutionary products but to evolve and re-iterate until the final product feels flawless from all aspects.

Apple so far has managed to pull many surprises on the design sector. The same counts for the end user experience. In order to deliver you need to listen and research. Creating something because YOU like it doesn’t mean that the whole world will too.

During the last 3 years and after the iPhone research team produced the end product there was much speculation on what Apple will come forward with. In the last 24 months there was an outbreak of rumors of epic proportions. The last 12 months all hell broke loose. So what IS coming?

Apple is selling pro and consumer products on the axis of software solutions. The big companies buy the expensive pro suites but the real money comes from the consumers. The last update to the iLife suite brought face recognition and geospatial metadata to your media. A dare move almost two years before other companies had market-ready products. Last year Apple wanted to dedicate developer resources to cloud computing and storage and bought some related small-sized companies too. If we only had this then tomorrow would be the day the cloud computing was born for consumers. The day that iLife and iWork, together, as an office and home productivity suite started living on the same cloud. And us the users enjoying the view from any computing device on the world. Including the iPhone. If MobileMe was documents to take away tomorrow your apps would be to take away. And together with a special version of the AppleStore, more developers might be able to sell cloud applications for pennies.

But this is not the case. Jobs in an interview confessed that when the hardware exists they will unleash the real deal to the consumers. But that was on the OS X 10.4 era. With 10.6 they managed to move forward by pushing the boundaries of optimization and letting the hardware finally do some work. Since 10.6 developers are rallying to compute more and more stuff in order to get ready for the 10.7 era. 10.7 is coming sometime in 2011. The most realistic date is September 2011 and it will have to show what at least Apple can do with the technology innovations they introduced with 10.6. But what happens till then?

The hardware to produce the Apple iPad is already here long time ago. The iPhone was only the testbed for the new era on the hardware. Recent revelations introduced us to a new processing unit capable of doing much more than Intel or AMD are able to do with only a tiny fraction of the energy they require to do so. And is leading as the only one being able to use all this juice. 10.6 and iPhoneOS 3.x was the first to benefit from this research. iPhoneOS 3.x is based on 10.4 but it combines technologies from 10.6.

In the next days the iPhone will become the entry level on computing for consumers, bringing technology to the illiterate. A new computing device will take the place between the iPhone and the computer. This is what at least the mass of speculations realize. The device is supposedly based on iPhoneOS 4.x which will come sometime after the summer and will bring new features to the (now old) iPhone devices. More services for the consumers. Probably the ability for some lucrative developers to host their apps on the cloud too, but this will come after September with demos this summer at the already sold out WWDC 2010.

The new device won’t do much of the computing we are used to do on the desktop computers but it will be able to cope with everyday computing needs of the masses. That means web connectivity, archiving, browsing and publishing of personal media like photos and videos. The ability to store them online and edit them on the cloud. The computing to edit offline is already here but for the final touch the tasks will probably be pushed on the cloud. Syncing with the iPhone and the computers should be a child’s play and social networking services will start booming on the device. Media consuming (newspapers, tabloids, magazines) will of course be included on the package since it’s already possible through the AppleStore and Apple proved that they can deliver. The same counts for off-the-cloud apps (off- and online).

The iPad itself won’t be sold before the summer but users will have a first preview tomorrow if God (Steve) permits. The price should be around 800-1100, with a sweet spot being at 999 $ and an introduction first edition at 1200 with the second version next year at 999$.

We have less than 24 hours from now. Grab some cola and popcorn and enjoy the show!

Categories: Personal, main Tags: