Author Topic: Flash Game Dev Tips  (Read 52827 times)

photonstorm

  • Administrator
  • Key Contributor
  • *****
  • Posts: 1502
  • Karma: +1/-0
    • View Profile
    • Photon Storm
Re: Flash Game Dev Tips
« Reply #60 on: Sun, Sep 18, 2011 »
http://www.photonstorm.com



"Tell me and I will forget, show me and I might remember, involve me and I will understand" - Confucius

photonstorm

  • Administrator
  • Key Contributor
  • *****
  • Posts: 1502
  • Karma: +1/-0
    • View Profile
    • Photon Storm
Re: Flash Game Dev Tips
« Reply #61 on: Wed, Sep 21, 2011 »
And here's Part 2 to the above article: Building a Retro Platform Game in Flixel, Part 2
http://www.photonstorm.com



"Tell me and I will forget, show me and I might remember, involve me and I will understand" - Confucius

test84

  • Key Contributor
  • *****
  • Posts: 1328
  • Karma: +0/-0
  • ت
    • View Profile
    • My personal site.
Re: Flash Game Dev Tips
« Reply #62 on: Wed, Sep 21, 2011 »
And here's Part 2 to the above article: Building a Retro Platform Game in Flixel, Part 2

Thanks! They are invaluable.
blog, twitter, Check out my award winning game, Rot Gut:

Kimikaze-N00B

  • King
  • Member
  • **
  • Posts: 20
  • Karma: +0/-0
  • -The leader of everything-
    • View Profile
Re: Flash Game Dev Tips
« Reply #63 on: Wed, Oct 19, 2011 »
My way of getting confidence back to making a game: Make a blank room,like a new house.Set it up so your friend can join,and start chatting about what to add in the room.A bed,table,lamp,chairs and a bookshelf.Then we add doors,and doors,and doors untill we have a game.I don't know what game I'm gonna make untill it's done,most of the time

Crowley

  • Member
  • **
  • Posts: 9
  • Karma: +0/-0
    • View Profile
Re: Flash Game Dev Tips
« Reply #64 on: Sat, Oct 22, 2011 »
I've noticed we've gone through two archetypes of games, being a shoot 'em up and a sidescrolling platforming adventure game.

What about a top down RPG game? Preferably something that takes advantage of FlxWeapon, as I've seen a good deal of people over the forums having trouble with that...

photonstorm

  • Administrator
  • Key Contributor
  • *****
  • Posts: 1502
  • Karma: +1/-0
    • View Profile
    • Photon Storm
http://www.photonstorm.com



"Tell me and I will forget, show me and I might remember, involve me and I will understand" - Confucius

photonstorm

  • Administrator
  • Key Contributor
  • *****
  • Posts: 1502
  • Karma: +1/-0
    • View Profile
    • Photon Storm
Re: Flash Game Dev Tips
« Reply #66 on: Wed, Nov 30, 2011 »
http://www.photonstorm.com



"Tell me and I will forget, show me and I might remember, involve me and I will understand" - Confucius

test84

  • Key Contributor
  • *****
  • Posts: 1328
  • Karma: +0/-0
  • ت
    • View Profile
    • My personal site.
Re: Flash Game Dev Tips
« Reply #67 on: Thu, Dec 1, 2011 »
It's fantastic, thanks!
blog, twitter, Check out my award winning game, Rot Gut:

Alextfish

  • Active Member
  • ***
  • Posts: 174
  • Karma: +0/-0
    • View Profile
Re: Flash Game Dev Tips
« Reply #68 on: Thu, Dec 1, 2011 »
Yay, this is indeed useful. Many thanks!

test84

  • Key Contributor
  • *****
  • Posts: 1328
  • Karma: +0/-0
  • ت
    • View Profile
    • My personal site.
Re: Flash Game Dev Tips
« Reply #69 on: Thu, Dec 1, 2011 »
I have a question: I was reading your coin collision code to learn more from how you code and I wondered about several places that you overrided a method but just called the super version of it, is there anything to do with this?
i.e. in coin.as:
Code: [Select]
override public function update():void
{
super.update();
}

or in PlaySate:      
Code: [Select]
override public function destroy():void
{
super.destroy();
}
blog, twitter, Check out my award winning game, Rot Gut:

photonstorm

  • Administrator
  • Key Contributor
  • *****
  • Posts: 1502
  • Karma: +1/-0
    • View Profile
    • Photon Storm
Re: Flash Game Dev Tips
« Reply #70 on: Thu, Dec 1, 2011 »
I just do it as standard because for nearly everything I build my update/destroy methods are far more complex than the above. You don't technically need them in this specific example.
http://www.photonstorm.com



"Tell me and I will forget, show me and I might remember, involve me and I will understand" - Confucius

test84

  • Key Contributor
  • *****
  • Posts: 1328
  • Karma: +0/-0
  • ت
    • View Profile
    • My personal site.
Re: Flash Game Dev Tips
« Reply #71 on: Thu, Dec 1, 2011 »
I just do it as standard because for nearly everything I build my update/destroy methods are far more complex than the above. You don't technically need them in this specific example.

Tnx.
While we are at it, would you name situations where you would need a destroy method? I know about C/C++'s case but not about AS3.
blog, twitter, Check out my award winning game, Rot Gut:

photonstorm

  • Administrator
  • Key Contributor
  • *****
  • Posts: 1502
  • Karma: +1/-0
    • View Profile
    • Photon Storm
Re: Flash Game Dev Tips
« Reply #72 on: Thu, Dec 1, 2011 »
When you want to do some house-keeping, i.e. the class has maybe created its own local bitmapDatas that need nuking, or event listeners, etc.
http://www.photonstorm.com



"Tell me and I will forget, show me and I might remember, involve me and I will understand" - Confucius

Jeff

  • Active Member
  • ***
  • Posts: 127
  • Karma: +0/-0
    • View Profile
    • Entertainment Evolution
Re: Flash Game Dev Tips
« Reply #73 on: Sat, Jul 28, 2012 »
In general, do you people often have problems with performance? What are some pitfalls that can make noticeable setbacks to performance? This is generally a subject I'm timid about, since if performance declines, it may be hard to figure out what to do about it.

With what I've tested now, it seems like having extra FlxCameras can reduce performance significantly. In general, this is understandable, if you have lots of stuff within the camera's viewing range, but if the camera doesn't see anything, should it then decrease performance? And if you have a camera that basically just shows text, should that decrease performance? By default I only used two cameras, but I added two more to hide things. It worked fine, but seemed to damage performance. Any comments about that? Should one seriously avoid having extra FlxCameras or can you do something to avoid this kind performance decline?
Please give me feedback for my latest game in progress:
Blog: Entertainment Evolution

zaphod

  • Member
  • **
  • Posts: 25
  • Karma: +0/-0
    • View Profile
Re: Flash Game Dev Tips
« Reply #74 on: Sat, Jul 28, 2012 »
@Jeff: extra cameras means extra checks for visibility (includes square root calculation) also.
If you want to use extra camera for showing just a single text then you need to exclude that camera from .cameras array property of all other sprites. For example:

Code: [Select]
var sprite:FlxSprite;
for each (basic:FlxBasic in FlxG._state.members)
{
    if (basic is FlxSprite)
    {
        sprite = FlxSprite(basic);
        sprite.cameras = [camera1, camera2];
    }
}

It will reduce number of visibility checks for your "text" camera. Plus you can set:
Code: [Select]
yourtext.cameras = [textCamera];And this text will never appear on other camera's view

Jeff

  • Active Member
  • ***
  • Posts: 127
  • Karma: +0/-0
    • View Profile
    • Entertainment Evolution
Re: Flash Game Dev Tips
« Reply #75 on: Tue, Aug 21, 2012 »
@Jeff: extra cameras means extra checks for visibility (includes square root calculation) also.
If you want to use extra camera for showing just a single text then you need to exclude that camera from .cameras array property of all other sprites. For example:

Code: [Select]
var sprite:FlxSprite;
for each (basic:FlxBasic in FlxG._state.members)
{
    if (basic is FlxSprite)
    {
        sprite = FlxSprite(basic);
        sprite.cameras = [camera1, camera2];
    }
}

It will reduce number of visibility checks for your "text" camera. Plus you can set:
Code: [Select]
yourtext.cameras = [textCamera];And this text will never appear on other camera's view

This was a very slow answer from my side, but thanks! That should be very useful! :) I would have thought it's the cameras where it's defined what they render, not objects defining by which cameras they are rendered. I'll probably try that out at some point. Then I could do the hiding and even make it faster than originally by selecting what the two absolutely necessary cameras see! Hmm... in fact this could even be used in a more creative way, not just for performance issues.  8)

I would have another general question. Do people usually just use the "kill" function when getting rid of objects? Doesn't that often mean wasting resources unnecessarily? I mean kill only kind of "disables" the object, it doesn't really remove it, right? What's the point of having the objects around, even if they will never be used again? Similarly, I'm wondering what's the purpose of the "exists" flag? I find the name misleading since when you're able to call myObject it does exist, even if it's "exists" flag were false. Moreover, if setting it false just disables both updating and drawing, you can do the same thing by using active and visible.
Please give me feedback for my latest game in progress:
Blog: Entertainment Evolution

sriram

  • New Member
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Re: Flash Game Dev Tips
« Reply #76 on: Sat, Sep 29, 2012 »
The Retro Platform Game tips was highly informative and inspiring ! I've been looking into making a Platformer game and this really helped me get a start (still checking out the code,experimenting)

Any chance of sharing tips on dealing with an auto runner Platformer ? Both as in Canabalt ,and like the HTML5 nutmeg game on your site, that would be great! :)

Gama11

  • Contributor
  • ****
  • Posts: 390
  • Karma: +0/-0
    • View Profile
Re: Flash Game Dev Tips
« Reply #77 on: Mon, Nov 5, 2012 »
The Retro Platform Game tips was highly informative and inspiring ! I've been looking into making a Platformer game and this really helped me get a start (still checking out the code,experimenting)

Any chance of sharing tips on dealing with an auto runner Platformer ? Both as in Canabalt ,and like the HTML5 nutmeg game on your site, that would be great! :)

Canabalt for iOS is actually on github, which might help, because it uses the iOS port of flixel.

novellof

  • Member
  • **
  • Posts: 19
  • Karma: +0/-0
    • View Profile
Re: Flash Game Dev Tips
« Reply #78 on: Mon, Nov 12, 2012 »
Hey great post but on tip #1 when you build the registry i am wondering what do you put in the class like:

in the registry we have public static var player:Player

What do i put in the Player.as class?

please pm me

Vax

  • New Member
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Re: Flash Game Dev Tips
« Reply #79 on: Tue, Nov 20, 2012 »
Hey Richard, thanks for all the great tutorials. They really helped me out starting with Flixel. Keep up the good work!
p.s.: I would love to see a tutorial on FlxWeapon/Lasers/Beams/Raycasts/etc. ;)