00:00
00:00
Newgrounds Background Image Theme

Lolcool800 just joined the crew!

We need you on the team, too.

Support Newgrounds and get tons of perks for just $2.99!

Create a Free Account and then..

Become a Supporter!

The Flash 'Reg' Lounge

3,046,956 Views | 60,186 Replies
New Topic Respond to this Topic

Response to The Flash 'Reg' Lounge 2009-03-18 18:18:37


At 3/18/09 12:05 PM, El-Presidente wrote: Re: Binary Numbahz
At 3/18/09 11:29 AM, Glaiel-Gamer wrote: powers of two (2, 4, 8, 16, 32, 64, ...) are more efficient than other numbers
Just out of curiosity, what else does that apply for? I'm just going to make a wild assumption it's because of their binary numbers [10, 100, 1000, 10000, etc.], but I have no idea how some of this shit works, so I could be entirely wrong.

Multiplication/Division by a power of two can be performed by the processor as a bit-shift instead of a multiplication (assuming it knows ahead of time that it's multiplying/dividing by two, usually a compiler determines that)

Bit-shift is much faster than multiplication

Response to The Flash 'Reg' Lounge 2009-03-18 22:18:23


At 3/18/09 12:11 PM, Kirk-Cocaine wrote: *whistles innocently*

Fourth time reaching 5000. Do it again, I dare you!


MY E-PENIS IS BIGGER THAN YOURS

8=================================>

...and this is my fag...

BBS Signature

Response to The Flash 'Reg' Lounge 2009-03-19 03:23:19


I want Camp North to be up again :(


BBS Signature

Response to The Flash 'Reg' Lounge 2009-03-19 04:21:03


Woot, I'm back after my 14 day BBS...Umm..."Holiday".
Ahh, good to be back, not that anyone really cares that I am but you know what...no neither do I.
Must stop trolling and all that crap.
Meh.

BLINK

Just wondering if anyone's ever read the book Blink by Malcolm Gladwell.
Good book, I'd recommend it.


"To live is the rarest thing in the world. Most people exist, that is all."

- Oscar Wilde

BBS Signature

Response to The Flash 'Reg' Lounge 2009-03-19 11:09:40


Coding Structure

Just thought this might be kind of cool, but where did everyone learn their coding structure from and how does it look. When I mean structure, I don't mean how things are done necessarily, but how they look. Here's mine [as an example and response]:

var number : uint = #; function name (a : type) : type { }

I just mean spacing and enters and stuff. I learned this style from Gust, although I have small adaptations from this style in different places. Also, anyone use any weird colors and shit?

There probably aren't that many variations that people use, but who knows!?

For those of you who are artists and can't answer this question, go draw a cat or do whatever you artists usually do.


MY E-PENIS IS BIGGER THAN YOURS

8=================================>

...and this is my fag...

BBS Signature

Response to The Flash 'Reg' Lounge 2009-03-19 11:39:19


At 3/19/09 11:09 AM, El-Presidente wrote: Coding Structure
var a:int = 0; function do_nothing(count:int):String { if(count == 0) return "Yes"; return "I don't think so."; }

Sup, bitches :)

BBS Signature

Response to The Flash 'Reg' Lounge 2009-03-19 11:40:45


At 3/19/09 11:39 AM, liaaaam wrote: structure

Exactly like that.


BBS Signature

Response to The Flash 'Reg' Lounge 2009-03-19 13:41:17


At 3/19/09 11:09 AM, El-Presidente wrote: Coding Structure
var k = 23 var t:MovieClip; var u = []; //DESCRIPTION OF FUNCTION NORMALLY IN CAPS function doStuff (bleh){ if(!bleh){ return "NO!"; } return "MAYBE"; }

Normally my variables are one letter long, which annoys me when I'm looking back on old stuff.

Pausing

Do you think an acceptable way of putting a pause function in a game is just to make the frame rate 0.01? That means there's a frame every 1 minute 40 seconds. That means if you pause something for 5 hours it would have the same effect as leaving it unpaused for 4.5 seconds (assuming the original frame rate was 40)? It's a kinda lazy way of doing it, but it's nice and easy to do.

Response to The Flash 'Reg' Lounge 2009-03-19 13:46:35


At 3/19/09 01:41 PM, trig1 wrote: Do you think an acceptable way of putting a pause function in a game is just to make the frame rate 0.01? That means there's a frame every 1 minute 40 seconds. That means if you pause something for 5 hours it would have the same effect as leaving it unpaused for 4.5 seconds (assuming the original frame rate was 40)? It's a kinda lazy way of doing it, but it's nice and easy to do.

You can set it to zero. It's acceptable, but it would be even easier if you managed updates yourself.

function onEnterFrame (_) { if (pause) return; everything.update (); }

BBS Signature

Response to The Flash 'Reg' Lounge 2009-03-19 13:59:55


At 3/19/09 01:46 PM, GustTheASGuy wrote: You can set it to zero. It's acceptable, but it would be even easier if you managed updates yourself.

You can't set it to zero using the stage.frameRate, if you try it automatically converts it back to 0.01. I considered managing the updates like you said, but I've got event listeners flying everywhere so it'd be hard to rewrite everything.

Response to The Flash 'Reg' Lounge 2009-03-19 14:35:40


No whitespace unless absolutely necessary, and as much as possible one one line. Every line commented. eg (bbs formatting will probably break this)

function BREAKBARR(mc,sa,n,a){ //SPLIT BALL ARRAY sa=Number(sa);a.splice(sa+1,0,[]); //CREATE NEW SUBARRAY for(var i=0;i<a[sa].length;i++){if((i+1)>n){a[sa+1].push(a[sa][i]);};} //LOOP THROUGH a[sa].splice(n,a[sa].length-n); //REMOVE ITEMS FROM OLD ARRAY mc.ap=a[sa].length;a[sa].push(mc); //PUSH MC TO FRONT ARRAY PUSHIN(mc,sa,n); //PUSH IT IN TO TRACK } //

Mid blue for keywords & identifiers, green for strings, grey for comments. Font: Tahoma 8 so all the comments do line up


- - Flash - Music - Images - -

BBS Signature

Response to The Flash 'Reg' Lounge 2009-03-19 15:48:21


At 3/19/09 02:35 PM, Denvish wrote: No whitespace unless absolutely necessary, and as much as possible one one line. Every line commented. eg (bbs formatting will probably break this)

are you trying to make my brain explode?

Response to The Flash 'Reg' Lounge 2009-03-19 16:08:22


// Comment about something completely obvious; seen frequently. var unimportantvarname:int = 0; var importantVarName:int = 0; var classInstanceName:ClassName = new ClassName(); const CONST_NAME = 0; function doTerribleThings(argone:int, argtwo:String):void { trace("doTerribleThings() - Test"); }

I guess the only interesting thing is I make my comments pink.


what

BBS Signature

Response to The Flash 'Reg' Lounge 2009-03-19 16:20:03


At 3/19/09 04:08 PM, K-Guare wrote: I guess the only interesting thing is I make my comments pink.

I just did that.

PINK COMMENTS! (:

Response to The Flash 'Reg' Lounge 2009-03-19 16:35:03


Oooh, coding styles!

No brace cuddling, custom background colours to make comments and strings stand out, liberal use of whitespace to make things nice and readable. Monaco font, my personal favourite fixed width font

Tom-

The Flash 'Reg' Lounge

Response to The Flash 'Reg' Lounge 2009-03-19 17:34:07


At 3/19/09 04:35 PM, The-Super-Flash-Bros wrote: Oooh, coding styles!

Cuddle those braces yo!

The Flash 'Reg' Lounge


Hi there!

BBS Signature

Response to The Flash 'Reg' Lounge 2009-03-19 17:43:34


At 3/19/09 05:34 PM, jmtb02 wrote: Cuddle those braces yo!

Mine's similar to that, Liams etc. Similar colours too (NG Colours).
Denvish = yuck :P
I like reading El-Presidente's stlye but I don't know why but when it comes to writing out code I never format it like that.

Response to The Flash 'Reg' Lounge 2009-03-19 17:45:12


At 3/19/09 05:34 PM, jmtb02 wrote:
At 3/19/09 04:35 PM, The-Super-Flash-Bros wrote: Oooh, coding styles!
Cuddle those braces yo!

Nice eye-saving colour scheme there. But CUDDLING IS EVIL!

Tom-

Response to The Flash 'Reg' Lounge 2009-03-19 20:47:57


At 3/19/09 05:45 PM, The-Super-Flash-Bros wrote: Nice eye-saving colour scheme there. But CUDDLING IS EVIL!

Prove it. Mathematically.

Response to The Flash 'Reg' Lounge 2009-03-19 21:04:22


At 3/19/09 03:41 PM, BritishMoose wrote: As the nerds have their own coding topic...

Animation

How many of you animators have experimented with different methods of animation asides from flash?

At uni, I'm not allowed to use my Macromedia baby 'cause I'm too good with it: they tell me to try out new programs/techniques 'n' all that so that I develop.

Some time ago, I ran out of luck and I didn't have electricity for a day. I actually started trying out traditional animation. It's preety interesting, I like it. What's hard about it is that unlike flash, if you're working on thick paper like I do (Shwemmer is my personal fave when inking) pulling out smooth animation is HARD because of the lack of onion skin. On office paper it's preety easy, since if you put one sheet over the other one. If you make a good animation and scan it so you can put the images with an alternate programme (Say, LiveSWF...) it is sure lots of people will be impressed. I love traditional animation, it feels so graceful...

Response to The Flash 'Reg' Lounge 2009-03-19 21:10:57


At 3/19/09 09:04 PM, Zyphonee wrote:
At 3/19/09 03:41 PM, BritishMoose wrote: As the nerds have their own coding topic...

Animation

How many of you animators have experimented with different methods of animation asides from flash?

At uni, I'm not allowed to use my Macromedia baby 'cause I'm too good with it: they tell me to try out new programs/techniques 'n' all that so that I develop.
Some time ago, I ran out of luck and I didn't have electricity for a day. I actually started trying out traditional animation. It's preety interesting, I like it. What's hard about it is that unlike flash, if you're working on thick paper like I do (Shwemmer is my personal fave when inking) pulling out smooth animation is HARD because of the lack of onion skin. On office paper it's preety easy, since if you put one sheet over the other one. If you make a good animation and scan it so you can put the images with an alternate programme (Say, LiveSWF...) it is sure lots of people will be impressed. I love traditional animation, it feels so graceful...

traditional animation is fun, I just use computer paper and draw it in one at a time. The problem is that I ran out of paper several times :P. I usually just put on a hole puncher and put rings around it at the end so I can test the animation as often as possible. The coloring and finishing is a lot more fun to do than with flash and I can animate traditionally a good margin faster, But the major problem is that sommetimes I put the character in the wronge place because traditional animation doesn't have onion skin, but much more effects can be applied as well.


BBS Signature

Response to The Flash 'Reg' Lounge 2009-03-19 21:19:14


At 3/19/09 04:35 PM, The-Super-Flash-Bros wrote: Oooh, coding styles!

No brace cuddling, custom background colours to make comments and strings stand out, liberal use of whitespace to make things nice and readable. Monaco font, my personal favourite fixed width font

Tom-

I'm going to assume you and jmtb02 use FlashDevelop. It just looks like it :p


BBS Signature

Response to The Flash 'Reg' Lounge 2009-03-19 23:34:41


At 3/19/09 09:19 PM, Wurmy wrote: I'm going to assume you and jmtb02 use FlashDevelop. It just looks like it :p

I use FlashDevelop and I really like it. I am not the biggest fan of OOP, which FlashDevelop seems to cater too the most. Procedural is just so much more flexible for me to use especially at the scope of Flash games. I just moved up to Flash 10 and am using FlashDevelop in conjunction.

Also, Flash CS4 tweens. What the heck happened there? Seriously.


Hi there!

BBS Signature

Response to The Flash 'Reg' Lounge 2009-03-19 23:54:23


http://www.sendspace.com/file/45pogy

So solid.

I'm getting CS4 through school next year. Whats up with tweeners?


BBS Signature

Response to The Flash 'Reg' Lounge 2009-03-20 00:02:19


CS4 ftw!
Convinced my mom and dad to help me get Creative Suite CS4 (they both have invested interest in some of the programs). So yay, bones here I come!

Also, I'm gonna need a screenshot of the color setting screen, because I want the NG theme please. Someone, oh please!

Response to The Flash 'Reg' Lounge 2009-03-20 01:53:28


Stupid 'AS' question
I can't figure out an easy way to pick -1 or 1 randomly without an if statement.. help :(

I just want to know how.. it's been bothering me for a long time :(

BBS Signature

Response to The Flash 'Reg' Lounge 2009-03-20 02:21:52


At 3/20/09 01:53 AM, Wurmy wrote: Stupid 'AS' question
I can't figure out an easy way to pick -1 or 1 randomly without an if statement.. help :(
I just want to know how.. it's been bothering me for a long time :(

(int(Math.random()*2)-.5)*2;

or

Math.random()<.5?1:-1;

Response to The Flash 'Reg' Lounge 2009-03-20 02:27:46


i just found out you can use graphics to motion tween!

I only found out now because my ICT 9 teach told me it had to be a movie clip


Sig made by me

Once again i'm falling down a mountain like a metaphor

Here ends another post by the grand master of all things: fluffkomix

BBS Signature

Response to The Flash 'Reg' Lounge 2009-03-20 02:46:34


At 3/20/09 02:21 AM, Glaiel-Gamer wrote: (int(Math.random()*2)-.5)*2;

What I was looking for.. not sure why I couldn't come up with it x_x

Math.random()<.5?1:-1;

And although this doesn't use an if statement, isn't it the same as using an if statement anyways? You're just checking whether or not a random number is less than .5 or greater than and getting an answer from that..


BBS Signature

Response to The Flash 'Reg' Lounge 2009-03-20 02:54:06


At 3/20/09 02:46 AM, Wurmy wrote:
Math.random()<.5?1:-1;
And although this doesn't use an if statement, isn't it the same as using an if statement anyways? You're just checking whether or not a random number is less than .5 or greater than and getting an answer from that..

?: is the conditional operator, not an if statement (although it does behave similarly)

like you can do

var a:int = b?1:-1;

but you can't do

var a:int = if(b) 1 else -1 ;
because the if statement is NOT an expression, while the conditional operator is

you'd have to do

var a:int;
if(b) a = 1; else a = -1;

this is fun too

var stuff =
n==a ? 1 :
n==b ? 2 :
n==c ? 3 :
n==d ? 4 :
n==e ? 5 :
n==f ? 6 :
0;