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,084,939 Views | 60,186 Replies
New Topic Respond to this Topic

Response to The Flash 'Reg' Lounge 2013-06-21 10:24:22


At 6/21/13 07:41 AM, Rustygames wrote: Gentlemen, seed your randoms

That made my day :D


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 2013-06-21 17:39:24


so... Is there really no way to load in a sprite sheet with a JSON counterpart into Flixel?
SOMEONE has had to have thought of this, right???


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 2013-06-21 17:52:57


At 6/21/13 05:39 PM, egg82 wrote: so... Is there really no way to load in a sprite sheet with a JSON counterpart into Flixel?
SOMEONE has had to have thought of this, right???

apparently it'd be really difficult to do. After seeing the code, I agree with this. I'll do it when i'm not on a clock of any sort.
My solution: Make a bunch of sprites inside the player class, add the animations to those sprites, and play and copy them onto the main player sprite when needed.

I win. Kinda.


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 2013-06-21 20:27:04


At 6/21/13 05:52 PM, egg82 wrote:
At 6/21/13 05:39 PM, egg82 wrote:
I win. Kinda.

are you arguing with yourself?


None

BBS Signature

Response to The Flash 'Reg' Lounge 2013-06-21 20:39:38


At 6/21/13 08:27 PM, Luis wrote:
At 6/21/13 05:52 PM, egg82 wrote:
At 6/21/13 05:39 PM, egg82 wrote:
I win. Kinda.
are you arguing with yourself?

The forum can't seem that slow to you...can it?

Response to The Flash 'Reg' Lounge 2013-06-21 20:40:30


At 6/21/13 08:27 PM, Luis wrote: are you arguing with yourself?

no, I just thought i'd won against Flixel.
Turns out, it beat me :(

no matter what I do, I can't remove the whitespace that's around the character. I can just try to minimize it.
I tried pixel-perfect collision detection, but that only works with FlxSprites and the FlxTileMap extends FlxObject directly.
I tried JSON, but Flixel doesn't have anything for loading in sprite sheets with JSON.
I tried making different sprites and copying the images onto the main player sprite, but Flixel doesn't do sprite resizing.

So, i'm stuck with the whitespace unless I start adding extra checks with the pixel-perfect detection, which I really, really don't want to do because that would mean scrapping most of my current code and re-writing some of Flixel's classes.

Screw it. I'll just hide the whitespace as best as possible.


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 2013-06-22 09:22:49


At 6/21/13 08:27 PM, Luis wrote:
At 6/21/13 05:52 PM, egg82 wrote:
At 6/21/13 05:39 PM, egg82 wrote:
I win. Kinda.
are you arguing with yourself?

I thought that too :P

Egg is just too quick for us :)


- Matt, Rustyarcade.com

Response to The Flash 'Reg' Lounge 2013-06-22 09:44:54


Two hundred pages by egg in 5 minutes.

Response to The Flash 'Reg' Lounge 2013-06-22 10:49:42


At 6/22/13 09:22 AM, Rustygames wrote: Egg is just too quick for us :)

I try :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 2013-06-22 11:16:58


_map.load([ [2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2], [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1], [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1], [1, 2, 2, 2, 2, 2, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 1], [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 2, 0, 0, 0, 0, 1], [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1], [1, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 2, 2, 2, 2, 1, 0, 0, 1, 0, 0, 0, 0, 1], [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1], [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1], [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1], [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 2, 2, 0, 0, 2, 1, 0, 0, 0, 0, 1], [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1], [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1], [1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1] ]);

is it just me, or does that make much more sense than the way Flixel does it?
I created that so I can implement the ability to share levels easily, but honestly I think it makes more sense than a string. Mostly because JSON.


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 2013-06-22 11:26:09


and thats why i "grow my own"


RangeError: Error #1125: The index 4 is out of range 4.

Response to The Flash 'Reg' Lounge 2013-06-22 11:29:57


At 6/22/13 11:26 AM, nitokov wrote: and thats why i "grow my own"

grower and not a shower, eh?


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 2013-06-22 11:33:07


At 6/22/13 11:29 AM, egg82 wrote:
At 6/22/13 11:26 AM, nitokov wrote: and thats why i "grow my own"
grower and not a shower, eh?

i will wait until harvest :D


RangeError: Error #1125: The index 4 is out of range 4.

Response to The Flash 'Reg' Lounge 2013-06-22 13:32:59


egg, your team's interpretation of the screenshot is completely different from ours.

Response to The Flash 'Reg' Lounge 2013-06-22 14:41:47


At 6/22/13 01:32 PM, FlyingColours wrote: egg, your team's interpretation of the screenshot is completely different from ours.

i'd hope so! ;)


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 2013-06-22 20:14:35


At 6/22/13 02:41 PM, egg82 wrote:
At 6/22/13 01:32 PM, FlyingColours wrote: egg, your team's interpretation of the screenshot is completely different from ours.
i'd hope so! ;)

Let's prove 4ur's prediction wrong then! :P

Response to The Flash 'Reg' Lounge 2013-06-22 20:39:31


At 6/22/13 11:16 AM, egg82 wrote: is it just me, or does that make much more sense than the way Flixel does it?
I created that so I can implement the ability to share levels easily, but honestly I think it makes more sense than a string. Mostly because JSON.

a string is easier to load from an external file

im pretty sure something like ogmo editor works with flixel (http://www.ogmoeditor.com/)

Even if you're gonna roll your own engine you should stop and think why other engines do things a certain way

Response to The Flash 'Reg' Lounge 2013-06-22 21:16:27


At 6/22/13 08:39 PM, Glaiel-Gamer wrote: a string is easier to load from an external file

very true, but they could have allowed the "[]" in case of arrays, which is really likely.


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 2013-06-22 21:50:35


At 6/22/13 09:16 PM, egg82 wrote:
At 6/22/13 08:39 PM, Glaiel-Gamer wrote: a string is easier to load from an external file
very true, but they could have allowed the "[]" in case of arrays, which is really likely.

you could probably spend 2 minutes writing code to convert the array into a string

Response to The Flash 'Reg' Lounge 2013-06-22 21:51:19


At 6/22/13 09:50 PM, Glaiel-Gamer wrote: you could probably spend 2 minutes writing code to convert the array into a string

already did, that was the load function I displayed :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 2013-06-23 02:45:57


Hmm... speaking of Flixel, I seem to get errors when I try to refer to the player class within the enemy class. For example,
public var player:Player;
^so I set that up, and then within the update function,
if(player.x < this.x)
^This gives me errors. I am still trying to get my head around it =P

Response to The Flash 'Reg' Lounge 2013-06-23 02:50:44


At 6/23/13 02:45 AM, redligot2009 wrote: Hmm... speaking of Flixel, I seem to get errors when I try to refer to the player class within the enemy class. For example,
public var player:Player;
^so I set that up, and then within the update function,
if(player.x < this.x)
^This gives me errors. I am still trying to get my head around it =P

do you know to use trace() ?


RangeError: Error #1125: The index 4 is out of range 4.

Response to The Flash 'Reg' Lounge 2013-06-23 02:59:19


At 6/23/13 02:50 AM, nitokov wrote:
do you know to use trace() ?

Yes. I do use trace...

Response to The Flash 'Reg' Lounge 2013-06-23 03:52:45


At 6/23/13 02:45 AM, redligot2009 wrote: Hmm... speaking of Flixel, I seem to get errors when I try to refer to the player class within the enemy class. For example,
public var player:Player;
^so I set that up, and then within the update function,
if(player.x < this.x)
^This gives me errors. I am still trying to get my head around it =P

Can give us the ID and name of the error? It's hard to tell what's wrong if we don't know what the error is.

Have you tried having the game engine pass the coordinates of the player to the enemy's AI? That would be better than having player as a property of enemy.

Response to The Flash 'Reg' Lounge 2013-06-23 10:52:09


At 6/23/13 03:52 AM, FlyingColours wrote: Can give us the ID and name of the error? It's hard to tell what's wrong if we don't know what the error is.

Have you tried having the game engine pass the coordinates of the player to the enemy's AI? That would be better than having player as a property of enemy.

Oh. I didn't think of that. Thanks buddy :)

Response to The Flash 'Reg' Lounge 2013-06-23 11:02:57


At 6/23/13 03:52 AM, FlyingColours wrote: Can give us the ID and name of the error? It's hard to tell what's wrong if we don't know what the error is.

Have you tried having the game engine pass the coordinates of the player to the enemy's AI? That would be better than having player as a property of enemy.

O-on second thoughts
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at Enemynormal/update()
at org.flixel::FlxGroup/update()
at org.flixel::FlxGroup/update()
at PlayState/update()
at org.flixel::FlxGame/update()
at org.flixel::FlxGame/step()
at org.flixel::FlxGame/onEnterFrame()
this is the error I get =P

Response to The Flash 'Reg' Lounge 2013-06-23 11:12:57


At 6/23/13 03:52 AM, FlyingColours wrote: Have you tried having the game engine pass the coordinates of the player to the enemy's AI? That would be better than having player as a property of enemy.

This. There's no reason the players, enemies, or maps should know about each other. Engine classes are very useful ;)


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 2013-06-23 12:04:16


Oh, PFF. I see where I went wrong. So I put it in a Registry class so I can access it anywhere, that didn't work because I didn't set the value for the public static var player:Player; I put within it, and so I made the Registry.player equal to the player within the Playstate.as :) lol

Response to The Flash 'Reg' Lounge 2013-06-23 12:21:07


At 6/23/13 12:04 PM, redligot2009 wrote: Oh, PFF. I see where I went wrong. So I put it in a Registry class so I can access it anywhere, that didn't work because I didn't set the value for the public static var player:Player; I put within it, and so I made the Registry.player equal to the player within the Playstate.as :) lol

You should still listen to egg's advice. Player, enemy, etc shouldn't be public. Just handle collisions and whatnot in the class where you instantiate both of them. Like if in Main you create a new player and all the enemies, then collisions go there. The Player class doesn't care about the Enemy class, so it shouldn't have any access to an Enemy.

Response to The Flash 'Reg' Lounge 2013-06-23 21:14:07


Hey guys.


BBS Signature