HaxeFlixel / flixel

Free, cross-platform 2D game engine powered by Haxe and OpenFL
https://haxeflixel.com/
MIT License
1.99k stars 439 forks source link

Port some of the sfx classes from FlixelPowerTools #79

Closed Beeblerox closed 11 years ago

Beeblerox commented 12 years ago

maybe others (don't know yet)

Beeblerox commented 12 years ago

StarfieldFX is complete

Beeblerox commented 12 years ago

porting GlitchFX should be easy. It isn't complicated effect.

Beeblerox commented 12 years ago

GlitchFX is complete. It was harder that I thought

Beeblerox commented 12 years ago

floodfill fx should be not harder than glitch fx. Maybe it will be next fx I'll convert

Beeblerox commented 12 years ago

I won't port RainbowLine fx since it heavily relies on setPixel() method which make it very-very hard to recreate with drawTiles()

impaler commented 12 years ago

I was testing StarfieldFX on cpp and it is giving me a "Segmentation fault" crash. Sorry but the code behind your port is beyond my understanding.

Am I using it ok here https://github.com/impaler/HaxeFlixelDemoes/blob/master/BulletManager1/source/Registry.hx ?

It is working awesome in flash :)

Beeblerox commented 12 years ago

I think you do it wrong. Here is working example:

if (FlxG.getPlugin(FlxSpecialFX) == null)
{
    FlxG.addPlugin(new FlxSpecialFX());
}

starfield = FlxSpecialFX.starfield();

stars = starfield.create(0, 32, 320, 176, 256);
starfield.setStarSpeed ( 0, 1 );

add(stars);

think about starfield object as a model and star object as a view

P.S. I'll upload updated (beta-) version of lib later (today)

impaler commented 12 years ago

Thanks starfield looks awesome on android!! :)

Exciting about new version of lib, make it an alpha version, I'll help you test it.

There maybe another cpp bug with FlxG.keys.justReleased, at least it doesnt crash if you remove the lines in keys in https://github.com/impaler/HaxeFlixelDemoes/blob/master/BulletManager1/source/PlayState.hx#L35

I must be in a very different timezone to you Beeblerox, I am already awake too late and have to go to bed now to wake up for work :)

Beeblerox commented 12 years ago

@impaler If I remember you live in the capital of Australia, so the difference between our timezones is about 6 and a half hours. I havent tested functional keys on cpp target, but remember that there was problems with wrong key codes.

Beeblerox commented 12 years ago

need to make GlitchFX work with new layer system

impaler commented 12 years ago

Yes you were correct the problem is with the function keys in cpp.

I wanted to offer a patch but looks like function keys have a bug in cpp for now as their key code conflicts with others, http://www.haxenme.org/community/forums/bugs/f1-f12-generate-wrong-keycodes/

Beeblerox commented 12 years ago

@impaler yes, unfortunately it's quite old problem

Beeblerox commented 12 years ago

I think I'll leave these classes until next release