Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411419 Posts in 69363 Topics- by 58416 Members - Latest Member: timothy feriandy

April 17, 2024, 10:13:22 PM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsCommunityTownhallflixel
Pages: 1 2 [3] 4 5
Print
Author Topic: flixel  (Read 24633 times)
Hideous
That's cool.
Level 10
*****


3D models are the best


View Profile WWW
« Reply #40 on: June 11, 2009, 02:58:22 PM »

I just got a game idea I really like.

Will be made with Flixel during summer, most likely. If I can get my lazy ass to do it Gentleman
Logged

agj
Level 10
*****



View Profile WWW
« Reply #41 on: June 12, 2009, 09:30:46 PM »

It's a really cool thing you did with Flixel, Adam. Look forward to using it!
Logged

ஒழுக்கின்மை (Paul Eres)
Level 10
*****


Also known as रिंकू.


View Profile WWW
« Reply #42 on: June 16, 2009, 03:38:34 PM »

i feel that if you're going to have an example game, it should have commenting to let people know what the code is doing.

examples of parts that confuse me from the example game (mode):

Quote
   public class Mode extends FlxGame
   {
      public function Mode():void
      {
         super(320,240,MenuState,2,0xff131c1b,0xff729954);
         help("Jump", "Shoot", "Nothing");
      }
   }

what's this help function? what's super? dunno what's going on in there.

there is some commenting, usually single-word comments in front of 10+ lines of code, so i can sometimes guess what's going on, but things like this are still baffling:

Quote
      private var _timer:Number;
      private var _b:FlxArray;
      private var _b2:FlxArray;
      private var _gibs:FlxEmitter;
      private var _p:Player;

b? b2? p? gibs? those variable names aren't very self-explanatory, and without comments it's hard to guess what each does.

still, i'm trying to work through it and learn how it works, but i just thought i'd offer the idea that it'd be far easier if the example game had more comments.
Logged

AdamAtomic
*BARF*
Level 9
*


hostess w/ the mostest


View Profile WWW
« Reply #43 on: June 16, 2009, 03:44:00 PM »

Yea I just ran out of time :-/  Would have liked to have fully documented it (and may get to, still)  I barely got the thing put together as it is!

stuff like "super" though I didn't feel a lot of pressure to comment because that's how AS3 does constructors?  So if you wanted to know what that line did, I expected folk to look up the FlxGame constructor in the documentation.  I think flixel has the potential to reach a lot of non-AS3 coders though, so I have to probably start thinking about how much AS3 people need to know to actually use flixel, and how to impart that knowledge?  not sure... thanks for feedback though!
Logged

cup full of magic charisma
Glaiel-Gamer
Guest
« Reply #44 on: June 16, 2009, 03:45:08 PM »

what's super? dunno what's going on in there.

Super is AS for "call constructor of base class from derived class"
Logged
Iamthejuggler
Level 6
*


View Profile
« Reply #45 on: June 17, 2009, 10:09:40 AM »

Out of interest, how easy would it be to use this engine for a top down style game? I realise the demos are platformers, but before i dive into the code was it intended only for platformers, or is that just what the demos happen to have used it for? Either way it looks awesome, and you are awesome for doing it and sharing it.
Logged
PGGB
Level 8
***



View Profile
« Reply #46 on: June 17, 2009, 10:33:21 AM »

Out of interest, how easy would it be to use this engine for a top down style game? I realise the demos are platformers, but before i dive into the code was it intended only for platformers, or is that just what the demos happen to have used it for? Either way it looks awesome, and you are awesome for doing it and sharing it.
This works, you just need to disable the gravity.
Logged
Iamthejuggler
Level 6
*


View Profile
« Reply #47 on: June 17, 2009, 11:49:55 AM »

Nice. I will definitely give it a go then. Cheers Smiley
Logged
AdamAtomic
*BARF*
Level 9
*


hostess w/ the mostest


View Profile WWW
« Reply #48 on: June 17, 2009, 12:29:30 PM »

you don't even ahve to disable it, just don't set the Y acceleration on anything and you should be fine Smiley
Logged

cup full of magic charisma
Titch
Level 3
***


Cautiously Pragmatic


View Profile WWW
« Reply #49 on: June 18, 2009, 12:06:16 AM »

well, using Math.floor generates overhead, while using int doesn't. I'm not even sure why there is a Math.floor. Maybe there is some specific use to it?

The difference would be negligeable unless you were doing a shitton of the things though.

The only use of Math.floor() I've found that you can't achieve with an int() cast is when working with large Numbers types. As in ones too large to be cast as an int data type.

AFIK, uints ARE slow. The best number data type test that I've seen, lots of other sources claim the same thing. Although when it comes to flash optimisations your mileage may very; considering the range of opinions I've heard on the subject of the 'best' way to optimise code.

I'll take a poke at this later, it looks real interesting. I've been working on my own framework for FlashDevelop and this looks awesome enough to make it totally redundant.
Logged

Iamthejuggler
Level 6
*


View Profile
« Reply #50 on: June 18, 2009, 12:28:56 AM »

Math.floor and int also work differently in minus numbers. For example:
trace("int "+int(-2.3));
trace("floor "+Math.floor(-2.3));
traces:
int -2
floor -3

uints are slow, i would imagine, because they are basically a custom class that has to check for valid values, i.e. not negative, and presumably uses getters/setters to access the value.

@AdamAtomic: Thanks man. I am probably going to dive into this this weekend, if i get the chance. Looking forward to it Smiley
Logged
Glaiel-Gamer
Guest
« Reply #51 on: June 18, 2009, 06:46:12 AM »

uints are not slow in the latest version of flash, they've fixed that
Logged
AdamAtomic
*BARF*
Level 9
*


hostess w/ the mostest


View Profile WWW
« Reply #52 on: June 18, 2009, 07:35:37 AM »

yea math.floor does more intuitive truncation, which is very handy for snapping the graphics to screen (which is the main place its used in realtime in flixel) and i've heard that uints are slow in flash 9 but they seem to be just as fast or faster than ints in flash 10, so i dunno if i'll end up changing those or not - there's no reason that flixel SHOULDNT be designed to run well in flash 9 but i dunno what the install base numbers are right now?
Logged

cup full of magic charisma
ஒழுக்கின்மை (Paul Eres)
Level 10
*****


Also known as रिंकू.


View Profile WWW
« Reply #53 on: June 18, 2009, 07:38:09 AM »

my experience is that optimization is best when it focuses on bottlenecks, not on everything you could possibly optimize, because often it's the bottlenecks that matter most, not little things like using math.floor rather than int

anyway, back to the topic, would it be possible to create a simple guide to doing stuff with this engine? for instance, just a tutorial that says something like:

'entities in the game use this class. they can have these properties. to draw them use this function'

and so on. because i'm pretty lost otherwise.
Logged

Melly
Level 10
*****


This is how being from "da hood" is like, right?


View Profile
« Reply #54 on: June 19, 2009, 01:05:24 PM »

Yeah, I guess it's safe to say that Adam should just do some crazy stress tests with the engine and see where the bottlenecks are, and then optimize those.  Hand Thumbs Up Left Hand Thumbs Up Right
Logged

Feel free to disregard the above.
Games: Minus / Action Escape Kitty
John Nesky
Level 10
*****


aka shaktool


View Profile WWW
« Reply #55 on: June 19, 2009, 01:18:10 PM »

Yeah, I guess it's safe to say that Adam should just do some crazy stress tests with the engine and see where the bottlenecks are, and then optimize those.  Hand Thumbs Up Left Hand Thumbs Up Right

Why, is it not fast enough already?
Logged
AdamAtomic
*BARF*
Level 9
*


hostess w/ the mostest


View Profile WWW
« Reply #56 on: June 19, 2009, 01:20:04 PM »

I've done *some* stress testing, but I'm not sure where the legit/predictable bottlenecks ARE, really...well, I know that rotation and scaling and anything that uses the Flash vector renderer is a bottleneck but I don't think I can do a lot about that.  Otherwise you can put a few thousand sprites on screen without too much trouble, and a few hundred environmental blocks without causing too many headaches.  My next game is running at 640x480 pretty happily too!

As for a more detailed tutorial, ANYTHING is possible...but all these things take time.  All 10 or so classes are fully documented, and the help forums have quite a few tutorials and hello world type things going on, which is a good start I think.  Someday I will get around to writing a more detailed, helpful take on the framework, but I definitely have higher priorities in the meantime (like an IDE, etc)
Logged

cup full of magic charisma
Titch
Level 3
***


Cautiously Pragmatic


View Profile WWW
« Reply #57 on: June 19, 2009, 01:55:55 PM »

I love the way the engine handles stuff imported through the embed metatag. I've been having headaches trying to work out a good solution to that, but the one you use in flixel is so neat Smiley
Logged

AdamAtomic
*BARF*
Level 9
*


hostess w/ the mostest


View Profile WWW
« Reply #58 on: June 19, 2009, 02:10:31 PM »

haha, thanks i guess Tongue  that's just normal AS3 embedding though!  I can't take any credit for it  Gentleman
Logged

cup full of magic charisma
Melly
Level 10
*****


This is how being from "da hood" is like, right?


View Profile
« Reply #59 on: June 19, 2009, 03:54:02 PM »

I guess we'll just have to wait and see if Adobe can optimize their rendering.
Logged

Feel free to disregard the above.
Games: Minus / Action Escape Kitty
Pages: 1 2 [3] 4 5
Print
Jump to:  

Theme orange-lt created by panic