00:00
00:00
Newgrounds Background Image Theme
Upgrade Your Account!

HO HO HOPE you become a Newgrounds Supporter this year!

We're working hard to give you the best site possible, but we have bills to pay and community support is vital to keep things going and growing. Thank you for considering!

Become a Supporter so NG can see another Christmas!

The Flash 'Reg' Lounge

3,085,981 Views | 60,186 Replies
New Topic Respond to this Topic

Response to The Flash 'Reg' Lounge 2014-01-28 19:51:59


At 1/28/14 05:25 PM, kkots wrote

Let X be the number of replies displayed in Flash forum near this thread.
Then your post will create a new page if and only if

(X+1)%30==0

I know how the modulo operator works. I was asking if he did the math, or just simply counted the number of posts on the previous page.

Response to The Flash 'Reg' Lounge 2014-01-28 20:46:31


Here's another completely random thing. Coding at 3:40 AM (7 minutes ago), in absolute darkness. It's damn awesome.

The Flash 'Reg' Lounge


Nav.. I'm the Nav!

Response to The Flash 'Reg' Lounge 2014-01-28 20:53:54


At 1/28/14 08:46 PM, TheNavigat wrote: Here's another completely random thing. Coding at 3:40 AM (7 minutes ago), in absolute darkness. It's damn awesome.

Don't your eyes hurt? Sometimes I have to open my blinds (especially when the light in my room goes out for 5 mins).

Response to The Flash 'Reg' Lounge 2014-01-28 20:55:35


At 1/28/14 08:53 PM, MSGhero wrote:
At 1/28/14 08:46 PM, TheNavigat wrote: Here's another completely random thing. Coding at 3:40 AM (7 minutes ago), in absolute darkness. It's damn awesome.
Don't your eyes hurt? Sometimes I have to open my blinds (especially when the light in my room goes out for 5 mins).

The brightness is the lowest. So nah, it doesn't. Actually it's quite comfortable.


Nav.. I'm the Nav!

Response to The Flash 'Reg' Lounge 2014-01-28 21:12:56


At 1/28/14 08:55 PM, TheNavigat wrote: Actually it's quite comfortable.

Okay, I take that back... I turned on the light again ._.


Nav.. I'm the Nav!

Response to The Flash 'Reg' Lounge 2014-01-28 22:11:15


At 1/28/14 07:51 PM, Diki wrote: I know how the modulo operator works. I was asking if he did the math, or just simply counted the number of posts on the previous page.

And I felt like some great mathematician and decided to invent a super-useful for everyone formula that no one has thought of before.
I just like being useful. If .. but alright, I'll stop.

I can tell what JSFL commands I've written so far.

Response to The Flash 'Reg' Lounge 2014-01-29 00:04:27


At 1/27/14 12:51 PM, PSvils wrote: // The Physics Component question from slugrail
About the Physics Component. The Physics Component should contain information about the physics object in a "raw" way. So basically no NAPE specific classes, just very simple stuff like Floats and other simple objects. This helps when it comes to serialization. Then, when an entity with the Physics Component pops up, you create the actual NAPE body judging by the component.

This is what I had in mind and this is what I implemented last night.

You're using a very odd setup for the entity-system concept thing...since I don't see how a manager can pick up an entity with at least 2 components, and then use those components together. Like, copying the physics object x/y/rotation to the entity's transform component x/y/rotation, or vice versa.

Each component has a "holder" which backtracks to the entity itself, if not, it'd be impossible to get the position of the player and render it in the DisplayManager.

private function processContainer(obj:Container):void { var entity:Entity = obj.getHolder(); var position:Physics = entity.fetch(Physics.CURRENT_FRAME) as Physics; if (position == null) { return; } obj.getDisplayObject().x = position.getPosition().x; obj.getDisplayObject().y = position.getPosition().y; obj.getDisplayObject().rotation = (position.getRotation() * 180) / Math.PI; }
In terms of what's going on, the Position component is doing much more than that, since it has a velocity property and other stuff. In my engine, I have a TransformComponent which simply has x/y/rotation, and then maybe a VelocityComponent, or a PhysicsComponent. Then other systems that manage input can manipulate those components, or rather, spawn a new entity that has a ChildOfComponent and ImpulseComponent (and it's a child of the entity that I want to apply the impulse to). This way the input system generates the ImpulseComponent, and I can either have it handled by a physics system, or a simpler movement system. Doesn't affect the input though, or the way I apply the movement.

Yeah I refactored it now and the Position component is now a full featured physics component.

And you seem to be using a lot of type casting = baaaaad

I can't think of any other way for something as abstract and dynamic as this, if it involves hardcoding then no thanks, it's not worth the CPU cycle it saves.

This is what I came up with (used public domain art):
http://www.newgrounds.com/dump/item/fe6558d7a8c74693d4d0403bb63948a7

Response to The Flash 'Reg' Lounge 2014-01-29 00:55:27


At 1/29/14 12:04 AM, slugrail wrote: This is what I came up with (used public domain art):
http://www.newgrounds.com/dump/item/fe6558d7a8c74693d4d0403bb63948a7

Good ol kenney art. What fps is that? It looks really low, unless it's just lagging hard (it shouldn't be).

Response to The Flash 'Reg' Lounge 2014-01-29 00:57:06


At 1/28/14 10:11 PM, kkots wrote: And I felt like some great mathematician and decided to invent a super-useful for everyone formula that no one has thought of before.
I just like being useful. If .. but alright, I'll stop.

No worries, man. I didn't really phrase that post very well (i.e. the one where I was responding to MSGHero), and there's nothing wrong with trying to teach someone about something as useful s the modulo operator. It really is a handy-dandy operator.

Also, in retrospect, and in an unrelated matter, I could have been less blunt and harsh in my response to egg82 in this post. Sorry egg, wasn't trying to condescend you or anything. ;(
I agree with MSGHero that there really should be a different word than "theory" when used in a scientific context. It would bring an end to people confusing it with "hypothesis". Oh well.

Response to The Flash 'Reg' Lounge 2014-01-29 01:12:15


At 1/29/14 12:55 AM, MSGhero wrote:
At 1/29/14 12:04 AM, slugrail wrote: This is what I came up with (used public domain art):
http://www.newgrounds.com/dump/item/fe6558d7a8c74693d4d0403bb63948a7
Good ol kenney art. What fps is that? It looks really low, unless it's just lagging hard (it shouldn't be).

It's running at 30 fps on a single core Atom at 1.6ghz on Power Saver mode, might have something to do with ASC2.0 since that's what I "compiled" with.

It is more than likely just the values I set for the acceleration and the level's gravity or the fact I'm using an uncached conventional Flash bitmap to render the tiles (just tested on an i5 2.3ghz and I get a constant 30 fps)

Response to The Flash 'Reg' Lounge 2014-01-29 01:38:03


At 1/29/14 01:12 AM, slugrail wrote: It is more than likely just the values I set for the acceleration and the level's gravity or the fact I'm using an uncached conventional Flash bitmap to render the tiles (just tested on an i5 2.3ghz and I get a constant 30 fps)

Does your physics have a delta time thing? Nape space.step takes a delta t (1 / framerate normally). Either that is low or your box just moves way too slowly.

Response to The Flash 'Reg' Lounge 2014-01-29 02:13:25


At 1/29/14 01:38 AM, MSGhero wrote:
At 1/29/14 01:12 AM, slugrail wrote: It is more than likely just the values I set for the acceleration and the level's gravity or the fact I'm using an uncached conventional Flash bitmap to render the tiles (just tested on an i5 2.3ghz and I get a constant 30 fps)
Does your physics have a delta time thing? Nape space.step takes a delta t (1 / framerate normally). Either that is low or your box just moves way too slowly.

Yes, but the box isn't moving with a fixed velocity, I'm applying a force to the middle of it. This shouldn't be causing any problems though:

space.step((1 / 30)* deltaTimeFactor);

that should multiply the frame rate in seconds by a factor between 0.01 to 29

Response to The Flash 'Reg' Lounge 2014-01-29 15:00:11


@InnerMike just as quickly as I signed up for last.fm, they fuck it up. I'm not a subscriber, but now non-subs are required to use their beta player which uses a youtube link instead of whatever it used before. The video loading is one issue, but it's not the same version as the song I favorited. One turned from a 7 min song to a 2 hr album. Come on man...

Response to The Flash 'Reg' Lounge 2014-01-29 22:37:40


At 1/29/14 03:21 PM, PSvils wrote: Of course I don't mean hardcoding, that removes all of the advantages of using components in the first place. :D

I just keep forgetting that AS3 really doesn't have generics like Haxe does (Haxe is all I use now).
I'm used to a different type of entity systems is all, instead of having managers for each separate component class.

P.

Yeah when I encountered the Adobe blog post about using Vectors the first thing I did was:

class Test<T> { var data:T; }

before I was deeply disappointed. They were amazingly helpful when I was writing with Java and using its HashMap class as a key-value list, I really wanted to get the same functionality in AS3.

Might actually consider Haxe I guess, the syntax throws me off especially for loops, they could've just used the exact same syntax as Java and made the learning curve zero.

Response to The Flash 'Reg' Lounge 2014-01-29 22:40:03


At 1/29/14 10:37 PM, slugrail wrote: Might actually consider Haxe I guess, the syntax throws me off especially for loops, they could've just used the exact same syntax as Java and made the learning curve zero.

Have you tried switching from AS3 to C# to Java with different programs that link together? 3:


Programming stuffs (tutorials and extras)

PM me (instead of MintPaw) if you're confuzzled.

thank Skaren for the sig :P

BBS Signature

Response to The Flash 'Reg' Lounge 2014-01-29 23:10:19


At 1/29/14 10:40 PM, egg82 wrote:
At 1/29/14 10:37 PM, slugrail wrote: Might actually consider Haxe I guess, the syntax throws me off especially for loops, they could've just used the exact same syntax as Java and made the learning curve zero.
Have you tried switching from AS3 to C# to Java with different programs that link together? 3:

Yes in fact I have. The Swing ActionListeners to C#'s & Objective-C's delegates (C# was a brainfsck) to AS3's event handlers, I've been through it all.

Response to The Flash 'Reg' Lounge 2014-01-29 23:18:54


At 1/29/14 11:10 PM, slugrail wrote: Yes in fact I have. The Swing ActionListeners to C#'s & Objective-C's delegates (C# was a brainfsck) to AS3's event handlers, I've been through it all.

You used Objective-C and you're saying C# was the brainfuck out of all of that?

I meant developing part of an application, switching to another language, then developing some of that application...
"private var _loader:URLLoader- no, wait. private HttpWebRequest request- no, damnit..."


Programming stuffs (tutorials and extras)

PM me (instead of MintPaw) if you're confuzzled.

thank Skaren for the sig :P

BBS Signature

Response to The Flash 'Reg' Lounge 2014-01-29 23:53:09


At 1/29/14 11:18 PM, egg82 wrote:
At 1/29/14 11:10 PM, slugrail wrote: Yes in fact I have. The Swing ActionListeners to C#'s & Objective-C's delegates (C# was a brainfsck) to AS3's event handlers, I've been through it all.
You used Objective-C and you're saying C# was the brainfuck out of all of that?

I meant developing part of an application, switching to another language, then developing some of that application...
"private var _loader:URLLoader- no, wait. private HttpWebRequest request- no, damnit..."

I took a harder hit, I used to switch between C (Yea, not C++, C) and Objective-C each day. I was studying both at the same time... Both languages are completely opposite. One is built on MVC OOP, and the other has no classes. One has a helluva IDE (Xcode), and the other, well, CodeBlocks compared to Xcode is nothing.

Also, Objective-C is an ultimate mindfuck.


Nav.. I'm the Nav!

Response to The Flash 'Reg' Lounge 2014-01-30 01:16:38


Maybe that's evil, but I had to post it...

The Flash 'Reg' Lounge


Nav.. I'm the Nav!

Response to The Flash 'Reg' Lounge 2014-01-30 02:19:59


At 1/29/14 11:18 PM, egg82 wrote:
You used Objective-C and you're saying C# was the brainfuck out of all of that?

What's so hard about:

// header @interface ... : UIView <RandomDelegate>@end // implementation object.delegate = self; - (void) randomDelegate { }

C# is a brainfsck because of how it handles multiple delegates, I mean look at this, there's no logical reason to do this when you can just have an Add and Remove function:

TapDoubleTapMultiDel= TapDel+ DoubleTapDel;

When I first saw this:
http://www.quickmeme.com/img/26/2604c8c350d537bb08322a3ea7a94a0fcf8606b56e39ba1f62301224aa417e84.jpg

I meant developing part of an application, switching to another language, then developing some of that application...
"private var _loader:URLLoader- no, wait. private HttpWebRequest request- no, damnit..."

It's not really that to be honest, AS3 is just a really high level language. You can literally read a file on the HDD or from the net in a couple of lines and one callback. With Java, C# and Objective-C you're bound to use some multithreaded approach that splits GUI and background tasks for example.

I took a harder hit, I used to switch between C (Yea, not C++, C) and Objective-C each day. I was studying both at the same time... Both languages are completely opposite. One is built on MVC OOP, and the other has no classes. One has a helluva IDE (Xcode), and the other, well, CodeBlocks compared to Xcode is nothing.

Objective-C is a subset of C99, meaning you can work entirely in C for your app/program if you wanted to and nothing's stopping you (in terms of UI you're stuck with UIKit and Cocoa so that's the only drawback). I have an iOS app I'm building that works directly on the protected blocks of memory and majority of it is written in C (minus UI) - jailbreak only or Apple would put me on a uberban list for vm_write calls not that they would work on non-jb devices.

Response to The Flash 'Reg' Lounge 2014-01-30 03:07:23


At 1/30/14 02:19 AM, slugrail wrote: Objective-C is a subset of C99, meaning you can work entirely in C for your app/program if you wanted to and nothing's stopping you (in terms of UI you're stuck with UIKit and Cocoa so that's the only drawback). I have an iOS app I'm building that works directly on the protected blocks of memory and majority of it is written in C (minus UI) - jailbreak only or Apple would put me on a uberban list for vm_write calls not that they would work on non-jb devices.

At that time I had to avoid "entirely in C" in my app because I had to learn how to use Objective-C's OOP. The syntax itself isn't hard, but the concept and understanding of how everything works takes much time before you can finally absorb it.


Nav.. I'm the Nav!

Response to The Flash 'Reg' Lounge 2014-01-30 15:05:01


Um.. guys?
Completely random thing here again:
I think I ran into a problem with matrices and transformation in JSFL.
I think that b and c members are messed up.

When I rotate an object 45 degrees clockwise (which means rotation by a positive angle in Flash, since y axis is looking down) it traces that

a=cosA b=sinA c=-sinA d=cosA //not literally, of course, I determined this via experiment

But this is wrong! This is mathematically incorrect! A matrix looks like

(a b) (c d)

And if I multiply it by point I get

(a b)*(x)=(cosA*x + sinA*y) (c d)*(y)=(-sinA*x + cosA*y)

But this contradicts the famous formula for rotation of a point (x,y) by angle B

x'=x*cosB - y*sinB; y'=y*cosB + x*sinB;

Because the matrix in JSFL would mean that a point would get rotated by the opposite angle (-45).

Onwards, I try to paste selected stuff inside a transformed (scaled/skewed) symbol, and then transform it so that it stays the same outside the symbol. To do that I transform the pasted stuff by a reversed matrix of the symbol and move using projection of the stuff's top left corner outside the symbol (multiplying the reversed matrix by the position of top left corner).
But in every test I get rotation of stuff in opposite angle
Replacing

doc.transformSelection(matrix.a,matrix.b,matrix.c,matrix.d);

with

doc.transformSelection(matrix.a,matrix.c,matrix.b,matrix.d);

solved the issue and everything worked perfectly fine (even surprised me).

I'd like to know who is being weird: my math, Flash's math or doc.transformSelection in particular (it has messed up b and c members, maybe)?

Response to The Flash 'Reg' Lounge 2014-01-30 15:36:44


At 1/30/14 03:33 AM, PSvils wrote: BTW, http://justgetflux.com/

It's a great little program if you use your computer after-dark for things that don't relate to entertainment, but for me most of the time it just interferes with game recordings.


Programming stuffs (tutorials and extras)

PM me (instead of MintPaw) if you're confuzzled.

thank Skaren for the sig :P

BBS Signature

Response to The Flash 'Reg' Lounge 2014-01-30 16:00:48


At 1/30/14 03:05 PM, kkots wrote: I think I ran into a problem with matrices and transformation in JSFL.

Problem solved. It turns out Flash has flipped matrices, i.e.

(a c) (b d)

And they refer to coordinates of elements by (j;i) and those coordinates start from 0 in documentation.
I was taught in school that matrices are written

(a b) (c d)

and coordinates of elements are (i;j) (i is vertical, j is horizontal) and start from 1.
EVERYTHING IS FREAKING TOPSY-TURVY IN THIS DUMB JSFL.

Also, I found out more bugs in JSFL:
1) You cannot determine that a shape is indeed a group until you select it and obtain it from doc.selection (which will yield you a completely different object which does not really exist), and that object will have isGroup display proper value.
2) If you use library.addItemToDocument it will override the clipboard with the symbol being added, meaning if you had cut or copied anything, it will be overriden by the symbol. This is just dumb and causes inconveniences.
3) If you change symbolType of a SymbolInstance, it will get removed from stage and get replaced by a completely different object which is put on the same spot as the old one. If you refer to the old symbol after changing its type (to, say, Movie Clip, or Button or Graphic) it will be all useless because that symbol is removed. New symbol can be obtained from the doc.selection of course which eases the problem.

Well, I think those are all the bugs. They are probably caused by lazy coding of JSFL interpreter engine, and all these problems are very silly and difficult to figure out on your own, lol.
And now flipped matrices is the new problem.

So do you guys write matrices in form

(a b) (c d)

And get

(a b)*(x)=(a*x+b*y) (c d)*(y)=(c*x+d*y)

or we do it like this only in Russia, and Flash is actually doing it correctly?

Response to The Flash 'Reg' Lounge 2014-01-30 17:01:15


At 1/30/14 03:33 AM, PSvils wrote:
At 1/28/14 08:46 PM, TheNavigat wrote: Here's another completely random thing. Coding at 3:40 AM (7 minutes ago), in absolute darkness. It's damn awesome.
BTW, http://justgetflux.com/ I've used it for quite some time now, and I'm used to the way the glow changes. It's muuuch easier on the eyes.

And Haxe really isn't hard:
http://www.openfl.org/developer/documentation/actionscript-developers/
And if you're targeting Flash, you can still use any as3 .swc/.swf libraries.

Flux is of completely no use for me here. The brightness adjusting buttons (since I'm using a laptop) are good enough. Thanks, though :)

And I'm more of a webdev right now than a gamedev, so I don't believe I'm interested in Haxe ._. But I'll check it out sooner or later! :)


Nav.. I'm the Nav!

Response to The Flash 'Reg' Lounge 2014-01-30 17:05:36


At 1/30/14 04:00 PM, kkots wrote: (a b)*(x)=(a*x+b*y)
(c d)*(y)=(c*x+d*y)

or we do it like this only in Russia, and Flash is actually doing it correctly?

It might have something to do with positive y going downwards. Maybe it's easier or makes more sense for the b and c to be swapped.

Response to The Flash 'Reg' Lounge 2014-01-30 17:12:33


At 1/30/14 05:05 PM, MSGhero wrote: It might have something to do with positive y going downwards. Maybe it's easier or makes more sense for the b and c to be swapped.

Nope, because the y axis on the monitor screen is going downwards too, by all standards. Not sure why they decided to flip b and c.
And in Flash Player the matrix is flipped too, just tested.

Response to The Flash 'Reg' Lounge 2014-01-30 18:40:31


Did anyone notice this? The new sound icon in Chrome?

The Flash 'Reg' Lounge


Nav.. I'm the Nav!

Response to The Flash 'Reg' Lounge 2014-01-30 18:53:54


At 1/30/14 06:40 PM, TheNavigat wrote: Did anyone notice this? The new sound icon in Chrome?

Go back like four or five pages :P


Programming stuffs (tutorials and extras)

PM me (instead of MintPaw) if you're confuzzled.

thank Skaren for the sig :P

BBS Signature

Response to The Flash 'Reg' Lounge 2014-01-30 20:10:50


Shop menu. The "Sell All" button sets the number to the right to however many you have in your inventory. But "Sell All" might get confused with "Sell everything in my inventory." Any ideas on what I can change that to to make it less confusing?

The Flash 'Reg' Lounge