This tutorial will go through all the basics of FlashPunk. After following it, you’ll be ready to make a simple game with this amazing library!. Browse FlashPunk tutorial direct from indie game developers. Create a simple platformer-style game from scratch using only your brain and FlashPunk! – zachwlewis/FlashPunk-Platform-Tutorial.

Author: Shaktigal Nataur
Country: Senegal
Language: English (Spanish)
Genre: Life
Published (Last): 27 September 2017
Pages: 350
PDF File Size: 1.46 Mb
ePub File Size: 4.83 Mb
ISBN: 580-4-51414-488-8
Downloads: 26450
Price: Free* [*Free Regsitration Required]
Uploader: Togul

This allows for customizable control schemes. Entity ; import net. But in order for Entities to do any of this, they need to be added to a World.

Fill in your details below or click flasypunk icon to log in: I would like to make a character moving also in diagonals. So test the game and see if the trace shows up, and if so we can move onto the next step.

FlashPunk Tutorial: Handling Collision

We then define a speed limit and the curAnimation variable of type String. Thanks for this blow mind read!

But FlashPunk also supports more specific flaahpunk behavior as well. These tutorials serve to teach you how to make games using FlashPunk, but do not teach you the basics of ActionScript3 and how to use it. Look at the dimensions of the spritesheet. We set the FP. Sprite sheets are images that contain single frames laid out in sequence, which tutroial to be read by the game engine.

We create the playerSpritemap instance of type SpriteMap, which is used to store the entire Spritemap of the player character, and to become the graphic property of the Entity superclass.

Those frames are then played at a certain frequency so as to simulate motion. The complete FlashDevelop project can be downloaded here. World is an organizational class in FlashPunk: Usually, your Main class extends the Flash Sprite class, and might look like this:. The update function is overridden and gets called each new frame of the general game loop. The starting point in all Flash games is the Main class, and so it will also be the starting point in your FlashPunk projects.


I hope you enjoyed the first part of the tutorial. More complex games, such as a level-based platformer, might have a menu World and then a separate World for each level of the game. The first line embeds the file found at the specified location relative to this classand the second line assigns that embedded file to a property. Each frame has an index, and they start with 0, so the first frame has index 0, and so on. If you save that and then run your game, your Entity will render the assigned Graphic at its current location, which is 0, 0 by default top-left corner of the screen.

So the next step is to work with the most common class you will be working with in FlashPunk, the Entity class. The function call Input. This function is nothing more than a bunch of add calls on playerSpritemap. Much like defining animations for Spritemaps, the Input class has the define method, that lets you bundle a group of keys under one label.

Leave a Reply Cancel reply Enter your comment here I was wondering is anyone could please me with those? Whew, this is a lot to read and think about, but the biggest chunk of the Player class is done now. But one of the most useful things to be able to do in a game is make Entities interact with each other in different ways, and FlashPunk has a set of useful collision functions for this purpose that will be explained in this tutorial.


When FlashPunk starts ticking, the game loop updates a specific World. Following this is a bunch of if else tutoial that all check whether a particular key is being pressed.

Tutorials – FlashPunk

I have a tjtorial with a couple of errors:. Entity ; import net. The add call is used to define an animation by saying a what name is should have, b what frames should be played, c the framerate of playing the animation and d if the animation should loop or just play once.

Implicit coercion of a value of type Class to an unrelated type net. For this example, since our graphic is just a single, non-animated plane sprite, we will use the Image class, like so:.

FlashPunk Tutorial How to make your avatar move | The Doglion

But for now leave it as false, different timesteps will be discussed in more detail in later tutorials. The last parameter is important, because it decides what type of timestep we want to use for our game.

Player to an unrelated type Class. You are commenting using your WordPress.

Speed means change of position per frame each for the X and Y axis. So now, what if we want the Bullet to be destroyed when the Player collides with it?