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
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
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
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
At 6/21/13 08:27 PM, Luis wrote:At 6/21/13 05:52 PM, egg82 wrote:are you arguing with yourself?At 6/21/13 05:39 PM, egg82 wrote:I win. Kinda.
The forum can't seem that slow to you...can it?
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
At 6/21/13 08:27 PM, Luis wrote:At 6/21/13 05:52 PM, egg82 wrote:are you arguing with yourself?At 6/21/13 05:39 PM, egg82 wrote:I win. Kinda.
I thought that too :P
Egg is just too quick for us :)
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
_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
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
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
egg, your team's interpretation of the screenshot is completely different from ours.
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
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
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
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
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 filevery 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
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
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
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() ?
At 6/23/13 02:50 AM, nitokov wrote:
do you know to use trace() ?
Yes. I do use trace...
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.
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 :)
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
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
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
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.