Project FBG Day 1

Welcome to Project FBG Development Diary.

Day 1

I’m going to be posting regularly on my learning progress with snippets of code that I have written and what I learnt with that snippet in such a way that people can read it and sort-of learn from my progress but not boring!

Using the method here

http://flashgamedojo.com/go/

and

I’m Starting with Flash Punk

I like Flash Punk because of the style of the website lol

I’ll move onto

Flixel after Flash Punk.

I’m going to be using the http://vimeo.com/channels/makingflashpunkgames video series after the introduction to flash punk which is fun-illy enough “Hello World!

Flash Punk likes people to be able to make their games for free so they use all their tutorials with Flash Develop which is like a free Adobe Flash CS5.5

Ok enough this is what im doing this is what im using onto the info!

FlashPunk is a free ActionScript 3 library designed for developing 2D Flash games. It provides you with a fast, clean framework to prototype and develop your games in. This means that most of the dirty work (timestep, animation, input, and collision to name a few) is already coded for you and ready to go, giving you more time and energy to concentrate on the design and testing of your game.

Straight from their about page ;D

It uses bitmap sprites instead of using vector graphics so you work with the png,jpg,etc    wait that last one isn’t a picture file…yes I know it’s a etcetera. So  i’ll be back after watching some videos and “Hello World!” intro and give you some feedback.

                                                                                          

No Joke after the “Hello World” intro which was pretty routine just made “Hello World” appear in what’s called a trace, it’s a message of sorts to test wether your Flash Player is getting the sent messages. If that makes any sense if not go and have a lookie over at FlashPunk.

Then

I wrote 3 .as files for The Basics tutorial.

Main which was the game engine pretty basic stuff.


package
{
 import net.flashpunk.Engine;

 import net.flashpunk.FP;

 public class Main extends Engine
 {
 public function Main()
 {
 super(800, 600, 60, false);

 FP.world = new MyWorld;
 }

 override public function init():void
 {
 trace("FlashPunk has started successfully!");
 }
 }
}

MyWorld which was the screen and its settings plus what needs to happen in the screen.


package
{

 /**
 * ...
 * @author Fallen
 */
 import net.flashpunk.World;
 public class MyWorld extends World
 {
 public function MyWorld()
 {

 add(new MyEntity);

 }
 }

}

and

MyEntity which was this little baby    


package
{

 /**
 * ...
 * @author Fallen
 */
 import net.flashpunk.Entity;
 import net.flashpunk.utils.Input;
 import net.flashpunk.utils.Key;

 import net.flashpunk.graphics.Image;

 public class MyEntity extends Entity
 {

 [Embed(source = 'assets/player.png')] private const PLAYER:Class;

 public function MyEntity()
 {

 graphic = new Image(PLAYER);

 }

 }

}

that’s all that appeared! BUT

It was so worth it!

My first Flash Punk Game (SO BASIC!) but still the feeling of my first game was awesome!

Here’s a screenie below!

Decided to do some more ;D couldn’t help myself so do did the Keyboard and Mouse tutorial.

It was so easy only added

override public function update():void
{
if (Input.check(Key.LEFT)) { x -= 5; }
if (Input.check(Key.RIGHT)) { x += 5; }
if (Input.check(Key.UP)) { y -= 5; }
if (Input.check(Key.DOWN)) { y += 5; }
}

to MyEntity and it added movement to the little ship.

The mouse function was just to make the ship where my mouse was.

Gotta really into the tutorials and finished them…OOPS


package
{

 /**
 * ...
 * @author Fallen
 */

 import net.flashpunk.Entity;
 import net.flashpunk.graphics.Spritemap;
 import net.flashpunk.utils.Input
 import net.flashpunk.utils.Key

 public class Player extends Entity
 {
 [Embed(source = 'assets/swordguy.png')]
 private const SWORDGUY:Class;

 public var sprSwordGuy:Spritemap = new Spritemap(SWORDGUY, 48, 32);

 public function Player()
 {
 sprSwordGuy.add("stand", [0, 1, 2, 3, 4, 5], 20, true);
 sprSwordGuy.add("run", [6, 7, 8, 9, 10, 11], 20, true);
 graphic = sprSwordGuy;
 x = 300;
 y = 300;
 }

 override public function update():void
 {
 var b:Bullet = collide("bullet", x, y) as Bullet;

 if (b)
 {
 b.destroy();
 }

 if (Input.check(Key.LEFT)) { x -= 5, sprSwordGuy.play("run", false); }
 if (Input.check(Key.RIGHT)) { x += 5, sprSwordGuy.play("run", false); }
 if (Input.check(Key.UP)) { y -= 5, sprSwordGuy.play("run", false); }
 if (Input.check(Key.DOWN)) { y += 5, sprSwordGuy.play("run", false); }
 if (Input.released(Key.LEFT)) { x -= 5, sprSwordGuy.play("stand", false); }
 if (Input.released(Key.RIGHT)) { x += 5, sprSwordGuy.play("stand", false); }
 if (Input.released(Key.UP)) { y -= 5, sprSwordGuy.play("stand", false); }
 if (Input.released(Key.DOWN)) { y += 5, sprSwordGuy.play("stand", false); }

 }

Made a game where its a sword guy that runs around and you can collect a dice that does nothing.

Play Here

http://megaswf.com/serve/2400581

Download Source Code Here

http://81f3f85c.linkbucks.com

or

http://www.4shared.com/rar/sepWl6zo/The_Basics.html

For Flash Punk’s Tutorial goto

http://flashpunk.net/tutorials/

Fallen.

Advertisements

2 thoughts on “Project FBG Day 1

  1. Thank you a bunch for sharing this with all folks you really recognize what you’re speaking about! Bookmarked. Kindly also visit my website =). We could have a link exchange contract between us

  2. […] Project FBG Day 1 (projectfbg.wordpress.com) […]

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s