Flash game question

classic Classic list List threaded Threaded
18 messages Options
Reply | Threaded
Open this post in threaded view
|

Flash game question

fedekun
Hi all, i'm new to flash and haxe but not to game programming. (Altough i dont know much... but just enough i guess :) i have made some games)
I want to make a simple 2D game with haXe / flash.
For what i have seen, i have to use the haxe.Timer class to repeat a function which will update the game logic. I dont know if i also have to draw in that "loop"...
Also, any reccomended library?

--
Best Regards.
fedekun


--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: Flash game question

theRemix
You don't have to use haxe.Timer for the main loop.

I've always used the Event.ENTER_FRAME listener

it goes like this



import flash.events.Event;
import flash.Lib;

class MyGame{

        public function new()
        {
                Lib.current.addEventListener(Event.ENTER_FRAME, loop);
        }

        private inline function loop(_):Void
        {
                // main game loop here
                // logic
                // rendering / update graphics
        }

        public static function main(): Void
        {
                var m: MyGame = new MyGame();
        }
}



hope this helps

-+> theRemix

On Dec 1, 2009, at 1:40 AM, fedekun wrote:

> Hi all, i'm new to flash and haxe but not to game programming.  
> (Altough i dont know much... but just enough i guess :) i have made  
> some games)
> I want to make a simple 2D game with haXe / flash.
> For what i have seen, i have to use the haxe.Timer class to repeat a  
> function which will update the game logic. I dont know if i also  
> have to draw in that "loop"...
> Also, any reccomended library?
>
> --
> Best Regards.
> fedekun
>
> --
> haXe - an open source web programming language
> http://haxe.org

--
haXe - an open source web programming language
http://haxe.org

smime.p7s (5K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Flash game question

Robin Palotai
In reply to this post by fedekun
Hi!

I suggest you would look for AS3 examples of flash games
(ActionScript3 is the native flash language, you'll understand its
syntax which is close to Haxe's) to get ideas about the way things are
with flash, then you can do the same with Haxe. If you are familiar
with game programming there won't be much surprise.

As for timer.. now I see Remix has written it :) For measuring time,
you can use flash.Lib.getTimer() in Haxe (equals
flash.utils.getTimer() in AS3) to get the millisecs.

Good luck,
Robin

On Tue, Dec 1, 2009 at 12:40 PM, fedekun <[hidden email]> wrote:

> Hi all, i'm new to flash and haxe but not to game programming. (Altough i
> dont know much... but just enough i guess :) i have made some games)
> I want to make a simple 2D game with haXe / flash.
> For what i have seen, i have to use the haxe.Timer class to repeat a
> function which will update the game logic. I dont know if i also have to
> draw in that "loop"...
> Also, any reccomended library?
>
> --
> Best Regards.
> fedekun
>
>
> --
> haXe - an open source web programming language
> http://haxe.org
>

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: Flash game question

Gamehaxe
In reply to this post by fedekun
Hi,
Check out http://gm2d.com/ which talks about exactly these things.

As for a library, start with the flash api and get used to it,
and then evaluate exactly what you are looking for later.

Hugh

> Hi all, i'm new to flash and haxe but not to game programming. (Altough i
> dont know much... but just enough i guess :) i have made some games)
> I want to make a simple 2D game with haXe / flash.
> For what i have seen, i have to use the haxe.Timer class to repeat a
> function which will update the game logic. I dont know if i also have to
> draw in that "loop"...
> Also, any reccomended library?
>


--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: Flash game question

fedekun
@Hugh
Thanks for the link!
That tutorial creates a Blob class and then uses that instead of sprite, and uses a "copyPixel" method to render stuff
Is this like the "normal way" to do games in flash / haXe? I dont wanna start learning something nobody does ...

@Robin
Yeah, i will check some AS3 games... and see if i can get something

@theRemix
I see, heh thanks


2009/12/1 Hugh Sanderson <[hidden email]>
Hi,
Check out http://gm2d.com/ which talks about exactly these things.

As for a library, start with the flash api and get used to it,
and then evaluate exactly what you are looking for later.

Hugh


Hi all, i'm new to flash and haxe but not to game programming. (Altough i
dont know much... but just enough i guess :) i have made some games)
I want to make a simple 2D game with haXe / flash.
For what i have seen, i have to use the haxe.Timer class to repeat a
function which will update the game logic. I dont know if i also have to
draw in that "loop"...
Also, any reccomended library?



--
haXe - an open source web programming language
http://haxe.org



--
Best Regards.
fedekun


--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: Flash game question

theRemix
Sprites are one way to render stuff, another common method is to use copyPixel. Both are normal. It would be very beneficial to learn how to do it, not everyone has.

-+> theRemix

On Dec 1, 2009, at 7:27 AM, fedekun wrote:

@Hugh
Thanks for the link!
That tutorial creates a Blob class and then uses that instead of sprite, and uses a "copyPixel" method to render stuff
Is this like the "normal way" to do games in flash / haXe? I dont wanna start learning something nobody does ...

@Robin
Yeah, i will check some AS3 games... and see if i can get something

@theRemix
I see, heh thanks


2009/12/1 Hugh Sanderson <[hidden email]>
Hi,
Check out http://gm2d.com/ which talks about exactly these things.

As for a library, start with the flash api and get used to it,
and then evaluate exactly what you are looking for later.

Hugh


Hi all, i'm new to flash and haxe but not to game programming. (Altough i
dont know much... but just enough i guess :) i have made some games)
I want to make a simple 2D game with haXe / flash.
For what i have seen, i have to use the haxe.Timer class to repeat a
function which will update the game logic. I dont know if i also have to
draw in that "loop"...
Also, any reccomended library?



--
haXe - an open source web programming language
http://haxe.org



--
Best Regards.
fedekun

--
haXe - an open source web programming language
http://haxe.org


--
haXe - an open source web programming language
http://haxe.org

smime.p7s (5K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Flash game question

fedekun
I see, i will check both then, thanks!

2009/12/1 theRemix <[hidden email]>
Sprites are one way to render stuff, another common method is to use copyPixel. Both are normal. It would be very beneficial to learn how to do it, not everyone has.

-+> theRemix

On Dec 1, 2009, at 7:27 AM, fedekun wrote:

@Hugh
Thanks for the link!
That tutorial creates a Blob class and then uses that instead of sprite, and uses a "copyPixel" method to render stuff
Is this like the "normal way" to do games in flash / haXe? I dont wanna start learning something nobody does ...

@Robin
Yeah, i will check some AS3 games... and see if i can get something

@theRemix
I see, heh thanks


2009/12/1 Hugh Sanderson <[hidden email]>
Hi,
Check out http://gm2d.com/ which talks about exactly these things.

As for a library, start with the flash api and get used to it,
and then evaluate exactly what you are looking for later.

Hugh


Hi all, i'm new to flash and haxe but not to game programming. (Altough i
dont know much... but just enough i guess :) i have made some games)
I want to make a simple 2D game with haXe / flash.
For what i have seen, i have to use the haxe.Timer class to repeat a
function which will update the game logic. I dont know if i also have to
draw in that "loop"...
Also, any reccomended library?



--
haXe - an open source web programming language
http://haxe.org



--
Best Regards.
fedekun

--
haXe - an open source web programming language
http://haxe.org


--
haXe - an open source web programming language
http://haxe.org



--
Best Regards.
fedekun


--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: Flash game question

Tony Polinelli

the copypixels method is less the *normal* way to do things - as it is more work, and depending of the game you are making, may not have much benefit.

That said, for the right game is can be perfect, check out Flixel - http://flixel.org/ - an as3 pixel renering lib, make using this approach, it is make by Adam Atomic http://www.adamatomic.com/ - you might have seen the game Canabalt - really nice pixel games here. So, it can be worth your while.

Often just using Sprites and MovieClips (prepare them in Flash IDE) and moving them around - telling MovieClips to jump to different frames for different animations - or still frame states, is the easiest way to start. When this comes too slow (performance wise) you can look to caching the vectors of the animations into bitmaps (or using spritesheets), you can copypixes these into a Bitmap object however, and still use it the same as a Sprite - moving it around on the stage, etc. Thats how we did everything in http://www.scarygirl.com. we didnt end up rasterizing the main character movieclip tho, as since she was rotating so much, it actually reduced performance.

Letting flash handle the overall compositing isnt such a bad idea, as it renders regions which have changed, layers things well, etc. I'm not saying that you couldnt do a more optimized approach with copypixels (probably a more cut back - specialized system) but it is a lot more work to get started.

My advice, start simple with what flash is designed for, and optimize later


On Wed, Dec 2, 2009 at 10:11 AM, fedekun <[hidden email]> wrote:
I see, i will check both then, thanks!

2009/12/1 theRemix <[hidden email]>
Sprites are one way to render stuff, another common method is to use copyPixel. Both are normal. It would be very beneficial to learn how to do it, not everyone has.

-+> theRemix

On Dec 1, 2009, at 7:27 AM, fedekun wrote:

@Hugh
Thanks for the link!
That tutorial creates a Blob class and then uses that instead of sprite, and uses a "copyPixel" method to render stuff
Is this like the "normal way" to do games in flash / haXe? I dont wanna start learning something nobody does ...

@Robin
Yeah, i will check some AS3 games... and see if i can get something

@theRemix
I see, heh thanks


2009/12/1 Hugh Sanderson <[hidden email]>
Hi,
Check out http://gm2d.com/ which talks about exactly these things.

As for a library, start with the flash api and get used to it,
and then evaluate exactly what you are looking for later.

Hugh


Hi all, i'm new to flash and haxe but not to game programming. (Altough i
dont know much... but just enough i guess :) i have made some games)
I want to make a simple 2D game with haXe / flash.
For what i have seen, i have to use the haxe.Timer class to repeat a
function which will update the game logic. I dont know if i also have to
draw in that "loop"...
Also, any reccomended library?



--
haXe - an open source web programming language
http://haxe.org



--
Best Regards.
fedekun

--
haXe - an open source web programming language
http://haxe.org


--

haXe - an open source web programming language
http://haxe.org



--
Best Regards.
fedekun


--
haXe - an open source web programming language
http://haxe.org



--
Tony Polinelli
http://touchmypixel.com

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: Flash game question

fedekun
I see, well i understand the copyPixels method very well because its pretty similar to what i was doing, but, say, i want to use the other method, i want a menu with a background, a button, click the button and start playing, change the background and everything (draw character, enemies, etc)
I can imagine doing a gamestate condition and drawing respective stuff in the "game loop", but, is there an example to do it with the other method? I just cant figure it out... Sorry i have never used flash before.

2009/12/1 Tony Polinelli <[hidden email]>

the copypixels method is less the *normal* way to do things - as it is more work, and depending of the game you are making, may not have much benefit.

That said, for the right game is can be perfect, check out Flixel - http://flixel.org/ - an as3 pixel renering lib, make using this approach, it is make by Adam Atomic http://www.adamatomic.com/ - you might have seen the game Canabalt - really nice pixel games here. So, it can be worth your while.

Often just using Sprites and MovieClips (prepare them in Flash IDE) and moving them around - telling MovieClips to jump to different frames for different animations - or still frame states, is the easiest way to start. When this comes too slow (performance wise) you can look to caching the vectors of the animations into bitmaps (or using spritesheets), you can copypixes these into a Bitmap object however, and still use it the same as a Sprite - moving it around on the stage, etc. Thats how we did everything in http://www.scarygirl.com. we didnt end up rasterizing the main character movieclip tho, as since she was rotating so much, it actually reduced performance.

Letting flash handle the overall compositing isnt such a bad idea, as it renders regions which have changed, layers things well, etc. I'm not saying that you couldnt do a more optimized approach with copypixels (probably a more cut back - specialized system) but it is a lot more work to get started.

My advice, start simple with what flash is designed for, and optimize later


On Wed, Dec 2, 2009 at 10:11 AM, fedekun <[hidden email]> wrote:
I see, i will check both then, thanks!

2009/12/1 theRemix <[hidden email]>
Sprites are one way to render stuff, another common method is to use copyPixel. Both are normal. It would be very beneficial to learn how to do it, not everyone has.

-+> theRemix

On Dec 1, 2009, at 7:27 AM, fedekun wrote:

@Hugh
Thanks for the link!
That tutorial creates a Blob class and then uses that instead of sprite, and uses a "copyPixel" method to render stuff
Is this like the "normal way" to do games in flash / haXe? I dont wanna start learning something nobody does ...

@Robin
Yeah, i will check some AS3 games... and see if i can get something

@theRemix
I see, heh thanks


2009/12/1 Hugh Sanderson <[hidden email]>
Hi,
Check out http://gm2d.com/ which talks about exactly these things.

As for a library, start with the flash api and get used to it,
and then evaluate exactly what you are looking for later.

Hugh


Hi all, i'm new to flash and haxe but not to game programming. (Altough i
dont know much... but just enough i guess :) i have made some games)
I want to make a simple 2D game with haXe / flash.
For what i have seen, i have to use the haxe.Timer class to repeat a
function which will update the game logic. I dont know if i also have to
draw in that "loop"...
Also, any reccomended library?



--
haXe - an open source web programming language
http://haxe.org



--
Best Regards.
fedekun

--
haXe - an open source web programming language
http://haxe.org


--

haXe - an open source web programming language
http://haxe.org



--
Best Regards.
fedekun


--

haXe - an open source web programming language
http://haxe.org



--
Tony Polinelli
http://touchmypixel.com

--
haXe - an open source web programming language
http://haxe.org



--
Best Regards.
fedekun


--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: Flash game question

Tony Polinelli
Heres one possible setup:

Have a Class that extends Sprite called Menu that holds all of those elements (nav buttons bg etc)

Have another Class Level (extends Sprite - with all level functionality) it will have other sprites like Player, Enemies, etc. these can be moved around via your game code. The game loop might even want to be in the Level class.

have a Game class that controls the overall game. When you are in the menu system have the Menu object addChild'ed to the stage, when you click 'play game', the Game class will remove the menu object (removeChild, or just make it invisible via visible=false) and create a Level object ( currentlevel = new Level() )  - then addChild the level object to the stage and it will be visible. When the level is complete - the Game class will remove the level (call a destroy probably to stop game loop, clean up, etc) and redisplay the menu... or an intermediate screen, then instantiate a NEW level.





On Wed, Dec 2, 2009 at 10:40 AM, fedekun <[hidden email]> wrote:
I see, well i understand the copyPixels method very well because its pretty similar to what i was doing, but, say, i want to use the other method, i want a menu with a background, a button, click the button and start playing, change the background and everything (draw character, enemies, etc)
I can imagine doing a gamestate condition and drawing respective stuff in the "game loop", but, is there an example to do it with the other method? I just cant figure it out... Sorry i have never used flash before.

2009/12/1 Tony Polinelli <[hidden email]>

the copypixels method is less the *normal* way to do things - as it is more work, and depending of the game you are making, may not have much benefit.

That said, for the right game is can be perfect, check out Flixel - http://flixel.org/ - an as3 pixel renering lib, make using this approach, it is make by Adam Atomic http://www.adamatomic.com/ - you might have seen the game Canabalt - really nice pixel games here. So, it can be worth your while.

Often just using Sprites and MovieClips (prepare them in Flash IDE) and moving them around - telling MovieClips to jump to different frames for different animations - or still frame states, is the easiest way to start. When this comes too slow (performance wise) you can look to caching the vectors of the animations into bitmaps (or using spritesheets), you can copypixes these into a Bitmap object however, and still use it the same as a Sprite - moving it around on the stage, etc. Thats how we did everything in http://www.scarygirl.com. we didnt end up rasterizing the main character movieclip tho, as since she was rotating so much, it actually reduced performance.

Letting flash handle the overall compositing isnt such a bad idea, as it renders regions which have changed, layers things well, etc. I'm not saying that you couldnt do a more optimized approach with copypixels (probably a more cut back - specialized system) but it is a lot more work to get started.

My advice, start simple with what flash is designed for, and optimize later


On Wed, Dec 2, 2009 at 10:11 AM, fedekun <[hidden email]> wrote:
I see, i will check both then, thanks!

2009/12/1 theRemix <[hidden email]>
Sprites are one way to render stuff, another common method is to use copyPixel. Both are normal. It would be very beneficial to learn how to do it, not everyone has.

-+> theRemix

On Dec 1, 2009, at 7:27 AM, fedekun wrote:

@Hugh
Thanks for the link!
That tutorial creates a Blob class and then uses that instead of sprite, and uses a "copyPixel" method to render stuff
Is this like the "normal way" to do games in flash / haXe? I dont wanna start learning something nobody does ...

@Robin
Yeah, i will check some AS3 games... and see if i can get something

@theRemix
I see, heh thanks


2009/12/1 Hugh Sanderson <[hidden email]>
Hi,
Check out http://gm2d.com/ which talks about exactly these things.

As for a library, start with the flash api and get used to it,
and then evaluate exactly what you are looking for later.

Hugh


Hi all, i'm new to flash and haxe but not to game programming. (Altough i
dont know much... but just enough i guess :) i have made some games)
I want to make a simple 2D game with haXe / flash.
For what i have seen, i have to use the haxe.Timer class to repeat a
function which will update the game logic. I dont know if i also have to
draw in that "loop"...
Also, any reccomended library?



--
haXe - an open source web programming language
http://haxe.org



--
Best Regards.
fedekun

--
haXe - an open source web programming language
http://haxe.org


--

haXe - an open source web programming language
http://haxe.org



--
Best Regards.
fedekun


--

haXe - an open source web programming language
http://haxe.org



--
Tony Polinelli
http://touchmypixel.com

--

haXe - an open source web programming language
http://haxe.org



--
Best Regards.
fedekun


--
haXe - an open source web programming language
http://haxe.org



--
Tony Polinelli
http://touchmypixel.com

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: Flash game question

fedekun
Ahhh, with addChild, i get it now, thanks! I will try these two and see which i like most

2009/12/1 Tony Polinelli <[hidden email]>
Heres one possible setup:

Have a Class that extends Sprite called Menu that holds all of those elements (nav buttons bg etc)

Have another Class Level (extends Sprite - with all level functionality) it will have other sprites like Player, Enemies, etc. these can be moved around via your game code. The game loop might even want to be in the Level class.

have a Game class that controls the overall game. When you are in the menu system have the Menu object addChild'ed to the stage, when you click 'play game', the Game class will remove the menu object (removeChild, or just make it invisible via visible=false) and create a Level object ( currentlevel = new Level() )  - then addChild the level object to the stage and it will be visible. When the level is complete - the Game class will remove the level (call a destroy probably to stop game loop, clean up, etc) and redisplay the menu... or an intermediate screen, then instantiate a NEW level.





On Wed, Dec 2, 2009 at 10:40 AM, fedekun <[hidden email]> wrote:
I see, well i understand the copyPixels method very well because its pretty similar to what i was doing, but, say, i want to use the other method, i want a menu with a background, a button, click the button and start playing, change the background and everything (draw character, enemies, etc)
I can imagine doing a gamestate condition and drawing respective stuff in the "game loop", but, is there an example to do it with the other method? I just cant figure it out... Sorry i have never used flash before.

2009/12/1 Tony Polinelli <[hidden email]>

the copypixels method is less the *normal* way to do things - as it is more work, and depending of the game you are making, may not have much benefit.

That said, for the right game is can be perfect, check out Flixel - http://flixel.org/ - an as3 pixel renering lib, make using this approach, it is make by Adam Atomic http://www.adamatomic.com/ - you might have seen the game Canabalt - really nice pixel games here. So, it can be worth your while.

Often just using Sprites and MovieClips (prepare them in Flash IDE) and moving them around - telling MovieClips to jump to different frames for different animations - or still frame states, is the easiest way to start. When this comes too slow (performance wise) you can look to caching the vectors of the animations into bitmaps (or using spritesheets), you can copypixes these into a Bitmap object however, and still use it the same as a Sprite - moving it around on the stage, etc. Thats how we did everything in http://www.scarygirl.com. we didnt end up rasterizing the main character movieclip tho, as since she was rotating so much, it actually reduced performance.

Letting flash handle the overall compositing isnt such a bad idea, as it renders regions which have changed, layers things well, etc. I'm not saying that you couldnt do a more optimized approach with copypixels (probably a more cut back - specialized system) but it is a lot more work to get started.

My advice, start simple with what flash is designed for, and optimize later


On Wed, Dec 2, 2009 at 10:11 AM, fedekun <[hidden email]> wrote:
I see, i will check both then, thanks!

2009/12/1 theRemix <[hidden email]>
Sprites are one way to render stuff, another common method is to use copyPixel. Both are normal. It would be very beneficial to learn how to do it, not everyone has.

-+> theRemix

On Dec 1, 2009, at 7:27 AM, fedekun wrote:

@Hugh
Thanks for the link!
That tutorial creates a Blob class and then uses that instead of sprite, and uses a "copyPixel" method to render stuff
Is this like the "normal way" to do games in flash / haXe? I dont wanna start learning something nobody does ...

@Robin
Yeah, i will check some AS3 games... and see if i can get something

@theRemix
I see, heh thanks


2009/12/1 Hugh Sanderson <[hidden email]>
Hi,
Check out http://gm2d.com/ which talks about exactly these things.

As for a library, start with the flash api and get used to it,
and then evaluate exactly what you are looking for later.

Hugh


Hi all, i'm new to flash and haxe but not to game programming. (Altough i
dont know much... but just enough i guess :) i have made some games)
I want to make a simple 2D game with haXe / flash.
For what i have seen, i have to use the haxe.Timer class to repeat a
function which will update the game logic. I dont know if i also have to
draw in that "loop"...
Also, any reccomended library?



--
haXe - an open source web programming language
http://haxe.org



--
Best Regards.
fedekun

--
haXe - an open source web programming language
http://haxe.org


--

haXe - an open source web programming language
http://haxe.org



--
Best Regards.
fedekun


--

haXe - an open source web programming language
http://haxe.org



--
Tony Polinelli
http://touchmypixel.com

--

haXe - an open source web programming language
http://haxe.org



--
Best Regards.
fedekun


--
haXe - an open source web programming language
http://haxe.org



--
Tony Polinelli
http://touchmypixel.com

--
haXe - an open source web programming language
http://haxe.org



--
Best Regards.
fedekun


--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: Flash game question

jlm@justinfront.net
If your looking at flash games and you have lots of code experience it  
might be worth looking at one of the flash 3D engines (Sandy3D or  
AwayLite), loading a simple collada model and animating it partially  
as MD2 and partially with code can -  following some of the tutorials  
give you some amazing results ( especially if you use models from  
tutorials ).  For run of the mill movement look at FxEffects as  
applied to MovieClip/Sprite/TextField, if you can access flash IDE (or  
swishMax if your on a budget) then timeline can be great for adding  
looped animations and masked effects, working with pixels are great  
when you want to work with particles or slice up images at run time  
like the 3d engines do rendering triangles but most flashers think of  
MovieClip/Sprite as the work horse and I would tend to agree with Tony.

Cheers

;j

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: Flash game question

theRemix
In reply to this post by Tony Polinelli
Hey Tony,

I always thought that when you do copyPixels, it's best to use just one sprite, and draw everything onto that. I understand how copyPixels on many sprites and moving them around would be so much easier to manage. the way i've been doing it is creating game objects with BitmapData  and x and y coordinates. and in a single render loop i draw the BitmapData at the x, y position of each object, and i can have thousands and it runs just fine. I imagine mixing in some Sprites would bog down a bit. Also, would you render animations within each Sprite? each Sprite has it's own EnterFrame loop? i imagine that would take up lots of resources too.

I'm going to also check out flixel, use it in haXe, and compare the results with mine :) is there a haXe port or equivalent? cause i just forked, i might want to port it to haXe and see if theres any performance differences.

-+> theRemix

On Dec 1, 2009, at 1:27 PM, Tony Polinelli wrote:


the copypixels method is less the *normal* way to do things - as it is more work, and depending of the game you are making, may not have much benefit.

That said, for the right game is can be perfect, check out Flixel - http://flixel.org/ - an as3 pixel renering lib, make using this approach, it is make by Adam Atomic http://www.adamatomic.com/ - you might have seen the game Canabalt - really nice pixel games here. So, it can be worth your while.

Often just using Sprites and MovieClips (prepare them in Flash IDE) and moving them around - telling MovieClips to jump to different frames for different animations - or still frame states, is the easiest way to start. When this comes too slow (performance wise) you can look to caching the vectors of the animations into bitmaps (or using spritesheets), you can copypixes these into a Bitmap object however, and still use it the same as a Sprite - moving it around on the stage, etc. Thats how we did everything in http://www.scarygirl.com. we didnt end up rasterizing the main character movieclip tho, as since she was rotating so much, it actually reduced performance.

Letting flash handle the overall compositing isnt such a bad idea, as it renders regions which have changed, layers things well, etc. I'm not saying that you couldnt do a more optimized approach with copypixels (probably a more cut back - specialized system) but it is a lot more work to get started.

My advice, start simple with what flash is designed for, and optimize later


On Wed, Dec 2, 2009 at 10:11 AM, fedekun <[hidden email]> wrote:
I see, i will check both then, thanks!

2009/12/1 theRemix <[hidden email]>
Sprites are one way to render stuff, another common method is to use copyPixel. Both are normal. It would be very beneficial to learn how to do it, not everyone has.

-+> theRemix

On Dec 1, 2009, at 7:27 AM, fedekun wrote:

@Hugh
Thanks for the link!
That tutorial creates a Blob class and then uses that instead of sprite, and uses a "copyPixel" method to render stuff
Is this like the "normal way" to do games in flash / haXe? I dont wanna start learning something nobody does ...

@Robin
Yeah, i will check some AS3 games... and see if i can get something

@theRemix
I see, heh thanks


2009/12/1 Hugh Sanderson <[hidden email]>
Hi,
Check out http://gm2d.com/ which talks about exactly these things.

As for a library, start with the flash api and get used to it,
and then evaluate exactly what you are looking for later.

Hugh


Hi all, i'm new to flash and haxe but not to game programming. (Altough i
dont know much... but just enough i guess :) i have made some games)
I want to make a simple 2D game with haXe / flash.
For what i have seen, i have to use the haxe.Timer class to repeat a
function which will update the game logic. I dont know if i also have to
draw in that "loop"...
Also, any reccomended library?



--
haXe - an open source web programming language
http://haxe.org



--
Best Regards.
fedekun

--
haXe - an open source web programming language
http://haxe.org


--

haXe - an open source web programming language
http://haxe.org



--
Best Regards.
fedekun


--
haXe - an open source web programming language
http://haxe.org



--
Tony Polinelli
http://touchmypixel.com
--
haXe - an open source web programming language
http://haxe.org


--
haXe - an open source web programming language
http://haxe.org

smime.p7s (5K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Flash game question

Iman Khabazian-2
If you are looking for some ideas regarding the games architecture, check out game object framework: http://imanit.com/blog/?p=87

On Wed, Dec 2, 2009 at 2:17 AM, theRemix <[hidden email]> wrote:
Hey Tony,

I always thought that when you do copyPixels, it's best to use just one sprite, and draw everything onto that. I understand how copyPixels on many sprites and moving them around would be so much easier to manage. the way i've been doing it is creating game objects with BitmapData  and x and y coordinates. and in a single render loop i draw the BitmapData at the x, y position of each object, and i can have thousands and it runs just fine. I imagine mixing in some Sprites would bog down a bit. Also, would you render animations within each Sprite? each Sprite has it's own EnterFrame loop? i imagine that would take up lots of resources too.

I'm going to also check out flixel, use it in haXe, and compare the results with mine :) is there a haXe port or equivalent? cause i just forked, i might want to port it to haXe and see if theres any performance differences.

-+> theRemix

On Dec 1, 2009, at 1:27 PM, Tony Polinelli wrote:


the copypixels method is less the *normal* way to do things - as it is more work, and depending of the game you are making, may not have much benefit.

That said, for the right game is can be perfect, check out Flixel - http://flixel.org/ - an as3 pixel renering lib, make using this approach, it is make by Adam Atomic http://www.adamatomic.com/ - you might have seen the game Canabalt - really nice pixel games here. So, it can be worth your while.

Often just using Sprites and MovieClips (prepare them in Flash IDE) and moving them around - telling MovieClips to jump to different frames for different animations - or still frame states, is the easiest way to start. When this comes too slow (performance wise) you can look to caching the vectors of the animations into bitmaps (or using spritesheets), you can copypixes these into a Bitmap object however, and still use it the same as a Sprite - moving it around on the stage, etc. Thats how we did everything in http://www.scarygirl.com. we didnt end up rasterizing the main character movieclip tho, as since she was rotating so much, it actually reduced performance.

Letting flash handle the overall compositing isnt such a bad idea, as it renders regions which have changed, layers things well, etc. I'm not saying that you couldnt do a more optimized approach with copypixels (probably a more cut back - specialized system) but it is a lot more work to get started.

My advice, start simple with what flash is designed for, and optimize later


On Wed, Dec 2, 2009 at 10:11 AM, fedekun <[hidden email]> wrote:
I see, i will check both then, thanks!

2009/12/1 theRemix <[hidden email]>
Sprites are one way to render stuff, another common method is to use copyPixel. Both are normal. It would be very beneficial to learn how to do it, not everyone has.

-+> theRemix

On Dec 1, 2009, at 7:27 AM, fedekun wrote:

@Hugh
Thanks for the link!
That tutorial creates a Blob class and then uses that instead of sprite, and uses a "copyPixel" method to render stuff
Is this like the "normal way" to do games in flash / haXe? I dont wanna start learning something nobody does ...

@Robin
Yeah, i will check some AS3 games... and see if i can get something

@theRemix
I see, heh thanks


2009/12/1 Hugh Sanderson <[hidden email]>
Hi,
Check out http://gm2d.com/ which talks about exactly these things.

As for a library, start with the flash api and get used to it,
and then evaluate exactly what you are looking for later.

Hugh


Hi all, i'm new to flash and haxe but not to game programming. (Altough i
dont know much... but just enough i guess :) i have made some games)
I want to make a simple 2D game with haXe / flash.
For what i have seen, i have to use the haxe.Timer class to repeat a
function which will update the game logic. I dont know if i also have to
draw in that "loop"...
Also, any reccomended library?



--
haXe - an open source web programming language
http://haxe.org



--
Best Regards.
fedekun

--
haXe - an open source web programming language
http://haxe.org


--

haXe - an open source web programming language
http://haxe.org



--
Best Regards.
fedekun


--
haXe - an open source web programming language
http://haxe.org



--
Tony Polinelli
http://touchmypixel.com
--
haXe - an open source web programming language
http://haxe.org


--
haXe - an open source web programming language
http://haxe.org


--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: Flash game question

fedekun
Interesting...
I also checked out flixel and i loved it :)
I indeed considered making a haXe simple game library when i get more used to AS and haXe

2009/12/9 Iman Khabazian <[hidden email]>
If you are looking for some ideas regarding the games architecture, check out game object framework: http://imanit.com/blog/?p=87

On Wed, Dec 2, 2009 at 2:17 AM, theRemix <[hidden email]> wrote:
Hey Tony,

I always thought that when you do copyPixels, it's best to use just one sprite, and draw everything onto that. I understand how copyPixels on many sprites and moving them around would be so much easier to manage. the way i've been doing it is creating game objects with BitmapData  and x and y coordinates. and in a single render loop i draw the BitmapData at the x, y position of each object, and i can have thousands and it runs just fine. I imagine mixing in some Sprites would bog down a bit. Also, would you render animations within each Sprite? each Sprite has it's own EnterFrame loop? i imagine that would take up lots of resources too.

I'm going to also check out flixel, use it in haXe, and compare the results with mine :) is there a haXe port or equivalent? cause i just forked, i might want to port it to haXe and see if theres any performance differences.

-+> theRemix

On Dec 1, 2009, at 1:27 PM, Tony Polinelli wrote:


the copypixels method is less the *normal* way to do things - as it is more work, and depending of the game you are making, may not have much benefit.

That said, for the right game is can be perfect, check out Flixel - http://flixel.org/ - an as3 pixel renering lib, make using this approach, it is make by Adam Atomic http://www.adamatomic.com/ - you might have seen the game Canabalt - really nice pixel games here. So, it can be worth your while.

Often just using Sprites and MovieClips (prepare them in Flash IDE) and moving them around - telling MovieClips to jump to different frames for different animations - or still frame states, is the easiest way to start. When this comes too slow (performance wise) you can look to caching the vectors of the animations into bitmaps (or using spritesheets), you can copypixes these into a Bitmap object however, and still use it the same as a Sprite - moving it around on the stage, etc. Thats how we did everything in http://www.scarygirl.com. we didnt end up rasterizing the main character movieclip tho, as since she was rotating so much, it actually reduced performance.

Letting flash handle the overall compositing isnt such a bad idea, as it renders regions which have changed, layers things well, etc. I'm not saying that you couldnt do a more optimized approach with copypixels (probably a more cut back - specialized system) but it is a lot more work to get started.

My advice, start simple with what flash is designed for, and optimize later


On Wed, Dec 2, 2009 at 10:11 AM, fedekun <[hidden email]> wrote:
I see, i will check both then, thanks!

2009/12/1 theRemix <[hidden email]>
Sprites are one way to render stuff, another common method is to use copyPixel. Both are normal. It would be very beneficial to learn how to do it, not everyone has.

-+> theRemix

On Dec 1, 2009, at 7:27 AM, fedekun wrote:

@Hugh
Thanks for the link!
That tutorial creates a Blob class and then uses that instead of sprite, and uses a "copyPixel" method to render stuff
Is this like the "normal way" to do games in flash / haXe? I dont wanna start learning something nobody does ...

@Robin
Yeah, i will check some AS3 games... and see if i can get something

@theRemix
I see, heh thanks


2009/12/1 Hugh Sanderson <[hidden email]>
Hi,
Check out http://gm2d.com/ which talks about exactly these things.

As for a library, start with the flash api and get used to it,
and then evaluate exactly what you are looking for later.

Hugh


Hi all, i'm new to flash and haxe but not to game programming. (Altough i
dont know much... but just enough i guess :) i have made some games)
I want to make a simple 2D game with haXe / flash.
For what i have seen, i have to use the haxe.Timer class to repeat a
function which will update the game logic. I dont know if i also have to
draw in that "loop"...
Also, any reccomended library?



--
haXe - an open source web programming language
http://haxe.org



--
Best Regards.
fedekun

--
haXe - an open source web programming language
http://haxe.org


--

haXe - an open source web programming language
http://haxe.org



--
Best Regards.
fedekun


--
haXe - an open source web programming language
http://haxe.org



--
Tony Polinelli
http://touchmypixel.com
--
haXe - an open source web programming language
http://haxe.org


--

haXe - an open source web programming language
http://haxe.org


--
haXe - an open source web programming language
http://haxe.org



--
Best Regards.
fedekun


--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: Flash game question

Luke Schreur-4
In reply to this post by Iman Khabazian-2
Where is the UML coming from? Is that exported from Enterprise Architect?


2009/12/9 Iman Khabazian <[hidden email]>
If you are looking for some ideas regarding the games architecture, check out game object framework: http://imanit.com/blog/?p=87

On Wed, Dec 2, 2009 at 2:17 AM, theRemix <[hidden email]> wrote:
Hey Tony,

I always thought that when you do copyPixels, it's best to use just one sprite, and draw everything onto that. I understand how copyPixels on many sprites and moving them around would be so much easier to manage. the way i've been doing it is creating game objects with BitmapData  and x and y coordinates. and in a single render loop i draw the BitmapData at the x, y position of each object, and i can have thousands and it runs just fine. I imagine mixing in some Sprites would bog down a bit. Also, would you render animations within each Sprite? each Sprite has it's own EnterFrame loop? i imagine that would take up lots of resources too.

I'm going to also check out flixel, use it in haXe, and compare the results with mine :) is there a haXe port or equivalent? cause i just forked, i might want to port it to haXe and see if theres any performance differences.

-+> theRemix

On Dec 1, 2009, at 1:27 PM, Tony Polinelli wrote:


the copypixels method is less the *normal* way to do things - as it is more work, and depending of the game you are making, may not have much benefit.

That said, for the right game is can be perfect, check out Flixel - http://flixel.org/ - an as3 pixel renering lib, make using this approach, it is make by Adam Atomic http://www.adamatomic.com/ - you might have seen the game Canabalt - really nice pixel games here. So, it can be worth your while.

Often just using Sprites and MovieClips (prepare them in Flash IDE) and moving them around - telling MovieClips to jump to different frames for different animations - or still frame states, is the easiest way to start. When this comes too slow (performance wise) you can look to caching the vectors of the animations into bitmaps (or using spritesheets), you can copypixes these into a Bitmap object however, and still use it the same as a Sprite - moving it around on the stage, etc. Thats how we did everything in http://www.scarygirl.com. we didnt end up rasterizing the main character movieclip tho, as since she was rotating so much, it actually reduced performance.

Letting flash handle the overall compositing isnt such a bad idea, as it renders regions which have changed, layers things well, etc. I'm not saying that you couldnt do a more optimized approach with copypixels (probably a more cut back - specialized system) but it is a lot more work to get started.

My advice, start simple with what flash is designed for, and optimize later


On Wed, Dec 2, 2009 at 10:11 AM, fedekun <[hidden email]> wrote:
I see, i will check both then, thanks!

2009/12/1 theRemix <[hidden email]>
Sprites are one way to render stuff, another common method is to use copyPixel. Both are normal. It would be very beneficial to learn how to do it, not everyone has.

-+> theRemix

On Dec 1, 2009, at 7:27 AM, fedekun wrote:

@Hugh
Thanks for the link!
That tutorial creates a Blob class and then uses that instead of sprite, and uses a "copyPixel" method to render stuff
Is this like the "normal way" to do games in flash / haXe? I dont wanna start learning something nobody does ...

@Robin
Yeah, i will check some AS3 games... and see if i can get something

@theRemix
I see, heh thanks


2009/12/1 Hugh Sanderson <[hidden email]>
Hi,
Check out http://gm2d.com/ which talks about exactly these things.

As for a library, start with the flash api and get used to it,
and then evaluate exactly what you are looking for later.

Hugh


Hi all, i'm new to flash and haxe but not to game programming. (Altough i
dont know much... but just enough i guess :) i have made some games)
I want to make a simple 2D game with haXe / flash.
For what i have seen, i have to use the haxe.Timer class to repeat a
function which will update the game logic. I dont know if i also have to
draw in that "loop"...
Also, any reccomended library?



--
haXe - an open source web programming language
http://haxe.org



--
Best Regards.
fedekun

--
haXe - an open source web programming language
http://haxe.org


--

haXe - an open source web programming language
http://haxe.org



--
Best Regards.
fedekun


--
haXe - an open source web programming language
http://haxe.org



--
Tony Polinelli
http://touchmypixel.com
--
haXe - an open source web programming language
http://haxe.org


--
haXe - an open source web programming language
http://haxe.org


--
haXe - an open source web programming language
http://haxe.org


This e-mail is intended only for the named person or entity to which 
it is addressed and contains valuable business information that is 
privileged, confidential and/or otherwise protected from disclosure.  
Dissemination, distribution or copying of this e-mail or the 
information herein by anyone other than the intended recipient, or 
an employee or agent responsible for delivering the message to the 
intended recipient, is strictly prohibited.  All contents are the 
copyright property of TBWA Worldwide, its agencies or a client of 
such agencies. If you are not the intended recipient, you are 
nevertheless bound to respect the worldwide legal rights of TBWA 
Worldwide, its agencies and its clients. We require that unintended 
recipients delete the e-mail and destroy all electronic copies in 
their system, retaining no copies in any media.If you have received 
this e-mail in error, please immediately notify us via e-mail to 
[hidden email].  We appreciate your cooperation.

We make no warranties as to the accuracy or completeness of this 
e-mail and accept no liability for its content or use.  Any opinions
expressed in this e-mail are those of the author and do not 
necessarily reflect the opinions of TBWA Worldwide or any of its 
agencies or affiliates. 


--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: Flash game question

victor / tokiop
In reply to this post by Tony Polinelli
Le 2 déc. 09 à 00:27, Tony Polinelli a écrit :
Thats how we did everything in http://www.scarygirl.com. 

wow very nice game and graphics !!
And thanks for advices and references too..

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: Flash game question

Iman Khabazian-2
In reply to this post by Luke Schreur-4
yes it is.

On 12/8/09, Luke Schreur <[hidden email]> wrote:

> Where is the UML coming from? Is that exported from Enterprise Architect?
>
>
> 2009/12/9 Iman Khabazian <[hidden email]>
>
>> If you are looking for some ideas regarding the games architecture, check
>> out game object framework: http://imanit.com/blog/?p=87
>>
>> On Wed, Dec 2, 2009 at 2:17 AM, theRemix <[hidden email]>wrote:
>>
>>> Hey Tony,
>>>
>>> I always thought that when you do copyPixels, it's best to use just one
>>> sprite, and draw everything onto that. I understand how copyPixels on
>>> many
>>> sprites and moving them around would be so much easier to manage. the way
>>> i've been doing it is creating game objects with BitmapData  and x and y
>>> coordinates. and in a single render loop i draw the BitmapData at the x,
>>> y
>>> position of each object, and i can have thousands and it runs just fine.
>>> I
>>> imagine mixing in some Sprites would bog down a bit. Also, would you
>>> render
>>> animations within each Sprite? each Sprite has it's own EnterFrame loop?
>>> i
>>> imagine that would take up lots of resources too.
>>>
>>> I'm going to also check out flixel, use it in haXe, and compare the
>>> results with mine :) is there a haXe port or equivalent? cause i just
>>> forked, i might want to port it to haXe and see if theres any performance
>>> differences.
>>>
>>>  -+> theRemix
>>>
>>> On Dec 1, 2009, at 1:27 PM, Tony Polinelli wrote:
>>>
>>>
>>> the copypixels method is less the *normal* way to do things - as it is
>>> more work, and depending of the game you are making, may not have much
>>> benefit.
>>>
>>> That said, for the right game is can be perfect, check out Flixel -
>>> http://flixel.org/ - an as3 pixel renering lib, make using this approach,
>>> it is make by Adam Atomic http://www.adamatomic.com/ - you might have
>>> seen the game Canabalt - really nice pixel games here. So, it can be
>>> worth
>>> your while.
>>>
>>> Often just using Sprites and MovieClips (prepare them in Flash IDE) and
>>> moving them around - telling MovieClips to jump to different frames for
>>> different animations - or still frame states, is the easiest way to
>>> start.
>>> When this comes too slow (performance wise) you can look to caching the
>>> vectors of the animations into bitmaps (or using spritesheets), you can
>>> copypixes these into a Bitmap object however, and still use it the same
>>> as a
>>> Sprite - moving it around on the stage, etc. Thats how we did everything
>>> in
>>> http://www.scarygirl.com. we didnt end up rasterizing the main character
>>> movieclip tho, as since she was rotating so much, it actually reduced
>>> performance.
>>>
>>> Letting flash handle the overall compositing isnt such a bad idea, as it
>>> renders regions which have changed, layers things well, etc. I'm not
>>> saying
>>> that you couldnt do a more optimized approach with copypixels (probably a
>>> more cut back - specialized system) but it is a lot more work to get
>>> started.
>>>
>>> My advice, start simple with what flash is designed for, and optimize
>>> later
>>>
>>>
>>> On Wed, Dec 2, 2009 at 10:11 AM, fedekun <[hidden email]> wrote:
>>>
>>>> I see, i will check both then, thanks!
>>>>
>>>> 2009/12/1 theRemix <[hidden email]>
>>>>
>>>>> Sprites are one way to render stuff, another common method is to use
>>>>> copyPixel. Both are normal. It would be very beneficial to learn how to
>>>>> do
>>>>> it, not everyone has.
>>>>>
>>>>>  -+> theRemix
>>>>>
>>>>> On Dec 1, 2009, at 7:27 AM, fedekun wrote:
>>>>>
>>>>> @Hugh
>>>>> Thanks for the link!
>>>>> That tutorial creates a Blob class and then uses that instead of
>>>>> sprite,
>>>>> and uses a "copyPixel" method to render stuff
>>>>> Is this like the "normal way" to do games in flash / haXe? I dont wanna
>>>>> start learning something nobody does ...
>>>>>
>>>>> @Robin
>>>>> Yeah, i will check some AS3 games... and see if i can get something
>>>>>
>>>>> @theRemix
>>>>> I see, heh thanks
>>>>>
>>>>>
>>>>> 2009/12/1 Hugh Sanderson <[hidden email]>
>>>>>
>>>>>> Hi,
>>>>>> Check out http://gm2d.com/ which talks about exactly these things.
>>>>>>
>>>>>> As for a library, start with the flash api and get used to it,
>>>>>> and then evaluate exactly what you are looking for later.
>>>>>>
>>>>>> Hugh
>>>>>>
>>>>>>
>>>>>>  Hi all, i'm new to flash and haxe but not to game programming.
>>>>>>> (Altough i
>>>>>>> dont know much... but just enough i guess :) i have made some games)
>>>>>>> I want to make a simple 2D game with haXe / flash.
>>>>>>> For what i have seen, i have to use the haxe.Timer class to repeat a
>>>>>>> function which will update the game logic. I dont know if i also have
>>>>>>> to
>>>>>>> draw in that "loop"...
>>>>>>> Also, any reccomended library?
>>>>>>>
>>>>>>>
>>>>>>
>>>>>> --
>>>>>> haXe - an open source web programming language
>>>>>> http://haxe.org
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Best Regards.
>>>>> fedekun
>>>>>
>>>>> --
>>>>> haXe - an open source web programming language
>>>>> http://haxe.org
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>>
>>>>> haXe - an open source web programming language
>>>>> http://haxe.org
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Best Regards.
>>>> fedekun
>>>>
>>>>
>>>> --
>>>> haXe - an open source web programming language
>>>> http://haxe.org
>>>>
>>>
>>>
>>>
>>> --
>>> Tony Polinelli
>>> http://touchmypixel.com
>>> --
>>> haXe - an open source web programming language
>>> http://haxe.org
>>>
>>>
>>>
>>> --
>>> haXe - an open source web programming language
>>> http://haxe.org
>>>
>>
>>
>> --
>> haXe - an open source web programming language
>> http://haxe.org
>>
>
>
>
> This e-mail is intended only for the named person or entity to which
> it is addressed and contains valuable business information that is
> privileged, confidential and/or otherwise protected from disclosure.
> Dissemination, distribution or copying of this e-mail or the
> information herein by anyone other than the intended recipient, or
> an employee or agent responsible for delivering the message to the
> intended recipient, is strictly prohibited.  All contents are the
> copyright property of TBWA Worldwide, its agencies or a client of
> such agencies. If you are not the intended recipient, you are
> nevertheless bound to respect the worldwide legal rights of TBWA
> Worldwide, its agencies and its clients. We require that unintended
> recipients delete the e-mail and destroy all electronic copies in
> their system, retaining no copies in any media.If you have received
> this e-mail in error, please immediately notify us via e-mail to
> [hidden email].  We appreciate your cooperation.
>
> We make no warranties as to the accuracy or completeness of this
> e-mail and accept no liability for its content or use.  Any opinions
> expressed in this e-mail are those of the author and do not
> necessarily reflect the opinions of TBWA Worldwide or any of its
> agencies or affiliates.
>

--
haXe - an open source web programming language
http://haxe.org