8bitrocket.com
31Dec/100

Last Review Of Our Book For The Year

I just found this nice little review of our book here at zhione.com .

"The essential guide to flash games written by Jeff Fulton and Steve Fulton is definitely a noteworthy and pleasant Book that sheds light on how to build flash games. Well, building flash games might sound tricky to you at first however; Jeff and Steve have made this Book relatively easy to comprehend."

You can take a look over here: http://www.zhione.com/programming-languages/book-review-the-essential-guide-to-flash-games/

11Dec/100

Target Now Sells Our Book!

I was just doing my cursory "search of the internet to see if anyone has written anything about our book, The Essential Guide To Flash Games lately",  the same search that has become less and less frequent as the months since the release have passed, and I came across this:

Yes, it appears that even target knows what's best for you when trying to learn how to build Flash games!

13Oct/100

A Completely Biased Opinion Of Our Book

I'm not sure if this makes sense,  but it's not easy for me to recall everything that we wrote about in The Essential Guide To Flash Games.  Like any long-term project, the minute it was complete, I took a deep breath and then dove into something else.  At this point, it's like a car far off in the rear-view mirror, driving in the opposite direction.  At the same time,  looking at the book is like listening to myself on tape recorder: I cringe the whole time, anticipating some kind of disaster.  It rarely occurs, but the potential is still there.

Anyway, Jeff just called me on the phone, and he said this:

"Hey Steve, our book is not that bad!  I needed some timer loop code, and I thought 'wait, I wrote a book about that'  You know, there is a lot of usable code in that thing!"

So, there you go, a totally biased opinion of our book from one of the authors.  Take that for what it is worth.

-8bitsteve

2Aug/100

Vortix Games Reviews The Essential Guide To Flash Games

Hey, I just noticed this review from Vortix Games for our book The Essential Guide To Flash Games.   It's a very nice review, and I think it really captures what the book is all about.  Here is a quote:

"It is not a book for coders or a book for designers. It is a book for flash game developers. The best one I’ve read about the subject."

You can read the rest here: http://blog.vortixgames.com/the-essential-guide-to-flash-games-review

20Jul/100

The Polish Adobe Flex User Group Really Likes 'The Essential Guide To Flash Games"

We've reached Poland!  The Polish Adobe Flex User Group just reviewed The Essential Guide To Flash Games, and they seem to really like it!

"In my opinion, it is the most valuable book about seriously flash games developing available on the market. The most important thing: authors does not avoid complex techniques, they just explain problems on real-life game examples. Highly recomended!"

You can read the rest here.

Interesting story (to me anyway).  Back when I was making games full-time for hotwheels.com, the fine people of Poland were some of the most frequent players of them.  Synchronicity? I think so.

15Jul/100

The Essential Guide To Flash Games Conspiracy?

Over at GamingYouWay.com, they might have found some sort of odd conspiracy from the pages of the Essential Guide To Flash Games Book, and all over the web.   Here is a quote:

"Somehow, Jeff & Steve have managed to put together a six hundred plus page definitive guide to Flash game development, a truly essential guide to modern game development in Flash which covers everything from blitting to using Mochi services, and yet at the same time have managed to take over the web."

We are not all-together sure what this is referring to, but we will try to look into it further.   Could someone at the publishing house slipped those symbols in as part of a bigger conspiracy on the Internet?  And what does that symbol mean?   Did the Flash Game World just a get a little creepier?  Are the "Ancient Aliens" involved?

7Jun/100

Huw Collingbourne Of bitwise Magazine Really Likes The Essential Guide To Flash Games

Huw Collingbourne Of bitwise Magazine just posted his review of The Essential Guide To Flash Games.  He really liked it!  Here is my favorite quote:

"What a great book this is! Don't be deceived into thinking that, since
it is a book about games programming, it must necessarily be trivial.
It isn't. I've read many books on 'serious' programming topics that are
much less informative and well structured than this one.
"

Here is a link to the review: http://www.bitwisemag.com/2/The-Essential-Guide-to-Flash-Games

24May/100

Geometry Attack: First Found Game Made From The Essential Guide To Flash Games Book?

Yesterday we were alerted to this game, Geometry Attack. It appears to be the first game made from the games from our book: The Essential Guide To Flash Games. However, this is not a complaint. The whole point of the book is to get people to make games. 

We want to highlight the creations of others.

You be the judge though, is this an iteration of Blaster Mines?:

19May/100

Essential Guide To Flash Games Chapter 13 Part 1. Modified BasicScreen and new ImageButton class

Essential Guide To Flash Games Chapter 13 Part 1.  Modified BasicScreen and new ImageButton class

The Essential Guide To Flash Games only contains 12 chapters, so what is chapter 13? Chapter 13 and beyond will be additions to the book and efg framework that build on what has been created so far. When adding or changing classes in the original efg framework we need to be extra careful that all existing games will still compile. For this reason we will not make wholesale changes to existing classes, but we will add functionality where we can. In some cases we can add this functionality to existing classes through new methods by adding new constructor parameters with default values. In other cases we need to build new classes or extend existing ones.

If you have taken a look at the book and have visited this site for any length of time you will notice that some of the book chapters were greatly expanded versions of tutorials that we had presented as blog entries. Everything was re-written to work with the efg framework and re-coded to fit within some basic common coding standards. We have decided that we will continue to support the book in a similar manner. With chapter 13 and beyond you will be getting a preview of what could possibly be included in the second edition of the book (also in an expanded form). By utilizing the framework and expanding on the existing code-base we are also demonstrating how creating a re-usable, expandable framework can aid the developer in simplifying future development efforts through shared code libraries, re-use and iteration. Plus it's fun and I get to channel all of my tutorials and dev into an area that will be useful now and in the future.

You will benefit most from this information if you have some familiarity with the book or the efg framework. The entire framework and set of game examples is a free download on the book site. It will make much more sense if you have the book in some form as a reference though.

Chapter 13: Part 1
Modified BasicScreen and the new ImageButton Classes

The plan all along has been for us to keep updating the Essential Guide To Flash Games book with more game and more chapters. Now that the book has been out for a couple months we are going to begin that process by updating the efg framework a bit. The BasicScreen class as presented in the book is a little limited in functionality (on purpose). The point was to build a foundation that readers could add to and extend as needed. It turns out that Steve and I needed to do just that when we sent a couple of the book games (Blaster Mines and Tunnel Panic) virally to promote the book release. We found that we needed to add two basic functions to the class to make it more useful:

1. The ability to add an image to a screen
2. The ability to use images in place of the the text in the SimpleBlitButton class.

The new ImageButton class

We will begin by taking a look a the first new class, ImageButton. Rather than extend the SimpleBlitButton class we found it much more straight-forward to create a similar class with slightly different functionality. This class i adds the ability for the an image to be used for the "off" and "over" states of the button.. In fact, this class is designed to also be expanded with other button states of needed.

Here is the full text of this class. It should be saved in the com/efg/framework package with the name ImageButton.as.

This class only contains the physical look of the button states and provides a mechanism function for changing the state based on a constant. It does not actually contain the listening functions to respond to events. The container class (BasicScreen) will be used for this as it is with the SimpleBlitButton class.

This class extends the Sprite class and contains a single Bitmap object (buttonBitmap). The bitmapData attribute of buttonBitmap will be swapped based on the state of the button. This class was designed to function very similar to the BasicBlitButton class in the original framework.

Note: the "_" character in the code is used to designate line continuation. If you are going to cut and paste the code, search for these lines and re-attach them in you IDE. They are necessary to ensure that the page layout of the site is not affected by the length of the code lines.

<font color="blue" size="3"><br /><br />package com.efg.framework {<br />   import flash.display.Bitmap;<br />   import flash.display.BitmapData;<br />   import flash.display.Sprite;<br />   import flash.geom.Point;<br />   /**<br />   * ...<br />   * @author Jeff Fulton<br />   */<br />   public class ImageButton extends Sprite{<br />      public static const OFF:int = 1;<br />      public static const OVER:int = 2;<br />		<br />      public var buttonBitmap:Bitmap;<br />      public var offBitmapData:BitmapData;<br />      public var overBitmapData:BitmapData;<br />		<br />      public function ImageButton(off:BitmapData, over:BitmapData, location:Point) {<br />         offBitmapData = off;<br />         overBitmapData = over;<br />         buttonBitmap = new Bitmap(offBitmapData);<br />         addChild(buttonBitmap);<br />         x = location.x;<br />         y = location.y;<br />         this.buttonMode = true;<br />         this.useHandCursor = true;<br />      }<br />		<br />      public function changeButton(typeval:int):void {<br />         if (typeval == OFF) {<br />            buttonBitmap.bitmapData = offBitmapData;<br />         }else {<br />            buttonBitmap.bitmapData = overBitmapData;<br />         }<br />      }<br />   }<br /><br />}<br /><br /></font><br />

ImageButton Constants

The constants designate the two simple states of the button: OFF or OVER. These will be controlled by the container class (BasicScreen) and passed into the changeButton() function as needed.

The constructor

The constructor accepts in the two BitmapData objects representing the look for the OFF and OVER states for the button. It also accepts in a Point class instance used to position the button inside it's container object (the BasicScreen class in this example).

The changeButton() function

This function is the public interface used to change the button state. It is a simple if/else statement now, but can be expanded to add further states if needed. It accepts an integer typeval. This integer must be one of the defined state constants. The bitmapData attribute of the buttonBitmap will be swapped based on the typeval passed in.

 

The modified BasicScreen class

The original BasicScreen class in the efg framework remains essentially intact, but we are going to add in functionality to add a background image and use an instance of the ImageButton class in place of the SimpleBlitButton if desired.

We we be adding a new function called addImage() that will allow the developer to add a single image to the BasicScreen instance. We thought about allowing the developer to add "N" number of images, but this would necessitate creating our own interface for managing the layering (or display list) inside the BasicScreen. We might add that functionality in the future, but for now a single image can be added to a BasicScreen instance. We will also create a new function called createImageButton() that will allow the current single button on the BasicScreen to be an ImageButton instance instead of the BasicBlitButton. There is a lot more we can do with this class such as allow the creation of multiple buttons, adding swfs as well as multiple images, etc. For now we will be adding this simple functionality and tackle the more advanced additions in a later addition to the framework.

<font color="blue" size="3"><br />package  com.efg.framework<br />{<br />   // Import necessary classes from the flash library<br />	import flash.display.Bitmap;<br />	import flash.display.BitmapData;<br />	import flash.display.Sprite;<br />	import flash.events.Event;<br />	import flash.geom.Point;<br />	import flash.text.TextField;<br />	import flash.text.TextFormat;<br />	import flash.events.Event;<br />	import flash.events.MouseEvent;<br />	import flash.text.TextFormatAlign;<br />	<br />	<br />	/**<br />	 * ...<br />	 * @author Jeff Fulton<br />	 */<br />	public class BasicScreen extends Sprite {<br />		<br />		<br />      public var displayText:TextField = new TextField();<br />      public var backgroundBitmapData:BitmapData;<br />      public var backgroundBitmap:Bitmap;<br />      public var okButton:SimpleBlitButton;<br />      public var imageButton:ImageButton;<br />	<br />		<br />      public var imageBitmapData:BitmapData;<br />      public var imageBitmap:Bitmap;<br />		<br />      public var useImageButton:Boolean = false;<br />		<br />		<br />      //ID is passed into the constructor. When the OK button is clicked, <br />      //a custom event sends this id back to Main<br />		<br />      private var id:int;<br />		<br />      //Constructor accepts our two passed in vars and then calls init<br />		<br />      public function BasicScreen(id:int,width:Number, height:Number, _<br />       isTransparent:Boolean, color:uint) {<br />			<br />         this.id = id;<br />         backgroundBitmapData = new BitmapData(width, height, isTransparent, color);<br />         backgroundBitmap = new Bitmap(backgroundBitmapData);<br />         addChild(backgroundBitmap);<br />      }<br />		<br />      public function addImage(bitmapData:BitmapData):void {<br />         imageBitmapData = bitmapData;<br />         imageBitmap = new Bitmap(imageBitmapData);<br />         addChild(imageBitmap);<br />      }<br />		<br />      public function createDisplayText(text:String, width:Number, _<br />       location:Point, textFormat:TextFormat):void {<br /> <br />         displayText.antiAliasType = flash.text.AntiAliasType.ADVANCED;<br />         displayText.y = location.y;<br />         displayText.x = location.x;<br />         displayText.width = width;<br />         displayText.defaultTextFormat=textFormat;<br />         displayText.text = text;<br />         addChild(displayText);<br />      }<br />		<br />      public function createOkButton(text:String,location:Point, width:Number, _<br />       height:Number, textFormat:TextFormat, offColor:uint=0x000000, _<br />       overColor:uint=0xff0000, positionOffset:Number=0):void {<br />			<br />         useImageButton = false;<br />         okButton = new SimpleBlitButton(location.x, location.y, width, height, _<br />          text, 0xffffff, 0xff0000, textFormat, positionOffset);<br /><br />         addChild(okButton);<br />         okButton.addEventListener(MouseEvent.MOUSE_OVER, okButtonOverListener, false, 0, true);<br />         okButton.addEventListener(MouseEvent.MOUSE_OUT, okButtonOffListener, false, 0, true);<br />         okButton.addEventListener(MouseEvent.CLICK, okButtonClickListener, false, 0, true);<br />      }<br />	<br />      public function createImageButton(imageOff:BitmapData,  imageOver:BitmapData, _<br />       location:Point):void {<br />         <br />         useImageButton = true;<br />         imageButton = new ImageButton(imageOff, imageOver, location);<br />         imageButton.addEventListener(MouseEvent.MOUSE_OVER, okButtonOverListener, false, 0, true);<br />         imageButton.addEventListener(MouseEvent.MOUSE_OUT, okButtonOffListener, false, 0, true);<br />         imageButton.addEventListener(MouseEvent.CLICK, okButtonClickListener, false, 0, true);<br />         addChild(imageButton);<br />      }<br />		<br />		<br />		<br />      public function setDisplayText(text:String):void {<br />         displayText.text = text;<br />      }<br />		<br />      //Listener functions <br />      //okButtonClicked fires off a custom event and sends the "id" to the listener.<br />      private function okButtonClickListener(e:MouseEvent):void {<br />         dispatchEvent(new CustomEventButtonId(CustomEventButtonId.BUTTON_ID,id));<br />      }<br />		<br />      private function okButtonOverListener(e:MouseEvent):void {<br />         if (useImageButton) {<br />            imageButton.changeButton(ImageButton.OVER);<br />         }else{<br />            okButton.changeBackGroundColor(SimpleBlitButton.OVER);<br />         }<br />      }<br />		<br />      private function okButtonOffListener(e:MouseEvent):void {<br />         if (useImageButton) {<br />            imageButton.changeButton(ImageButton.OFF);<br />         }else{<br />            okButton.changeBackGroundColor(SimpleBlitButton.OFF);<br />         }<br />      }<br />		<br />	}<br />	<br />}<br /></font><br />

The addImage() function

The addImage() function takes a BitmapData instance as it only parameter and sets the public imageBitmap variable's bitmapData attribute to reference it. We made this a public attribute so we would not need to code an interface for all of the transformations such as scale, alpha, etc that the developer might want to apply to the image. The external calling class can control this imageBitmap directly. This also applies to positioning the image. We will see an example shortly on how to do this.

The createImageButton() function

This function takes in the same parameters as the ImageButton class: A BitmapData instance for the "OFF" state, a BitmapData instance for the "OVER" state, and a point instance for the location of the button. In turn, this function creates an instance of ImageButton called imageButton and also sets the internal class variable useImageButton to true. This allows the code to switch between using the SimpleBlitButton and the ImageButton as the click through "ok" button. If we were adding this to the framework's Main.as class we would use that button click to move to the next state in the game loop state machine. For part 1 we simply demonstrate how to use these two classes together without utilizing the entire framework. In part two we will start to utilize the GameFrameWork.as base class and integrate in these new classes.

Creating the BasicScreenDemo.as

Using the the new ImageButton and expanded BasicScreen class we are going to create a simple example called BasicScreenDemo.as. I have done my demo in FlashDevelop and will embed the images needed at compile time. If you are using the Flash IDE you should import the images into the library using the same class names that I use in my embed. I have provided code that will allow you to use images from the library. You will need to comment out the embed statements and the change the variable instantiation for the BitmapData instances to the "//Flash IDE " lines. If you are using Flash CS4 or CS5 you can embed your assets as long as you set the location of the FlexSDK. In CS5 you will automatically be prompted to do this when you try to compile the first time.

Note: The zip file download contains code, project files, assets, and the .fla file (in CS4 format) to support both versions

Creating the project

1. Inside the /source/projects folder you will want to create a new folder called "ch13_classupdates".

2. Inside this folder you will want to create a folder called "flashIDE" or "flexSDK" depending on the development environment of your choice.

3. If you are using Flash Develop, Create a Flash Develop project (AS3 Project) inside the flexSDK folder with a class path of com.efg.demos.classupdates. This will create a src/com/efg/demos/classupdates folder. You will also want to create a folder called "assets" in this folder: src/com/efg/demos/classupdates/assets.

4. If you are using the FlashIDE you will want to create the com/efg/demos/classupdates folder inside the source/projects/ch13_classupdates/flashIDE folder. You will also want to Create the BasicScreenDemo.fla in this folder: source/projects/ch13_classupdates/flashIDE/BasicScreenDemo.as

5. Set the dimensions to 400x400 with a frame rate of 30.

6. Add the classes folder that contains the com/efg/framework package to your class path.

Creating the BasicScreenDemo.as class

The BasicScreenDemo.as file will be the "always compile" or "document class" (depending on your IDE of choice).

<font color="blue" size="3"><br />package com.efg.demos.classupdates<br />{<br />	import flash.display.Bitmap;<br />	import flash.display.BitmapData;<br />	import flash.display.Sprite;<br />	import flash.events.Event;<br />	import com.efg.framework.BasicScreen;<br />	import flash.geom.Point;<br />	/**<br />	 * ...<br />	 * @author Jeff Fulton<br />	 */<br />	public class BasicScreenDemo extends Sprite {<br />		<br />      [Embed(source = 'assets/asciirooidstitle.jpg')]<br />      public static const TitleJpg:Class;<br />		<br />      [Embed(source = 'assets/playbutton_off.jpg')]<br />      public static const PlayButtonOffJpg:Class;<br />		<br />      [Embed(source = 'assets/playbutton_on.jpg')]<br />      public static const PlayButtonOnJpg:Class;<br />		<br />      private var titleScreen:BasicScreen;<br />		<br />      //FlexSDK <br />      private var titleBitmap:Bitmap = new TitleJpg();<br />      // end Flex SDK<br />		<br />      //Flash IDE<br />      //private var titleBitmapData:BitmapData = new TitleJpg(0,0);<br />      //end flash IDE<br />		<br />      public function BasicScreenDemo():void {<br />         if (stage) init();<br />         else addEventListener(Event.ADDED_TO_STAGE, init);<br />      }<br />		<br />      private function init(e:Event = null):void {<br />         removeEventListener(Event.ADDED_TO_STAGE, init);<br />         // entry point<br />			<br />         titleScreen = new BasicScreen(1, 400, 400, false, 0x000000);<br />			<br />         //Flex SDK<br />         titleScreen.addImage(titleBitmap.bitmapData);<br />         //end Flex SDK<br />			<br />         //Flash IDE<br />         //titleScreen.addImage(titleBitmapData);<br />         //end Flash IDE<br />			<br />         titleScreen.imageBitmap.x = 50;<br />			<br />         titleScreen.useImageButton = true;<br />			<br />         //Flex SDK<br />         titleScreen.createImageButton(new PlayButtonOffJpg().bitmapData, new PlayButtonOnJpg().bitmapData, _<br />          new Point(150, 300));<br />         //end Flex SDK<br />			<br />         //Flash IDE<br />         //titleScreen.createImageButton(new PlayButtonOffJpg(0,0), new PlayButtonOnJpg(0,0), _<br />           new Point(150, 300));<br />         //end Flash IDE<br />         addChild(titleScreen);<br />		}<br />		<br />	}<br />	<br />}<br /></font><br />

This demonstration class simply creates an instance of the BasicScreen class (titleScreen) and then adds an instance of the TitleJpg embedded/imported class to the BasicScreen with the addImage() function call. To add the ImageButton we call the createImageButton() function passing in the PlayButtonOffJpg class, the PlayButtonOnJpg, and a Point instance to place the ImageButton on the TitleScreen.

Here are the assets that we use in this demo:

title
asciirooidstitle.jpg

on
playbutton_on.jpg

off
playbutton_off.jpg

Below is the working swf example:

By moving the mouse pointer over and off the "Play" Button the state will change.


Download the .zip file with all code, assets, and project files.

16May/100

GameDev.net Gives The Essential Guide To Flash Games 4 Gs!

GameDev.net has reviewed The Essential Guide To Flash games, and has given it 4 Gs! 

Here is a good quote:

"The level of the book starts off quite simply. While it might help to
know a bit of computer programming, knowledge of ActionScript or the
"Flash way of doing things" isn't important. If you have a little bit of
programming, the book will move at a reasonable pace to teach you the
rest."

While the review has a few inaccuracies (there are 10 games, not 6, and while we don't create and graphics for title screens we certainly create them in our framework and we also show you how to create a high score table with Mochi services), it's still nice to see a review in the wild.

You can read the review here:
http://www.gamedev.net/columns/books/bookdetails.asp?productid=778

This site is protected by Comment SPAM Wiper.