Author Topic: Flixel Power Tools  (Read 79327 times)

LoveMeDo

  • Member
  • **
  • Posts: 45
  • Karma: +0/-0
    • View Profile
    • Bear Air
Re: Flixel Power Tools
« Reply #140 on: Mon, Feb 27, 2012 »
test84,

Thank you for your great advice. I'm totally new to coding. I will try it out and let you know how it went.

Cheers,
lovemedo!

test84

  • Key Contributor
  • *****
  • Posts: 1328
  • Karma: +0/-0
  • ت
    • View Profile
    • My personal site.
Re: Flixel Power Tools
« Reply #141 on: Mon, Feb 27, 2012 »
Glad I could be of any help.
blog, twitter, Check out my award winning game, Rot Gut:

7heSAMA

  • Member
  • **
  • Posts: 12
  • Karma: +0/-0
    • View Profile
Re: Flixel Power Tools
« Reply #142 on: Tue, Feb 28, 2012 »
FlxText just creates an image file anyway, if you look at it you'll see it extends FlxSprite and the "text" is stored in the pixels value. So basically I'm pretty sure Glitch will just work out of the box with it.

That's awesome! I didn't even bother to try I admit, assumed it wouldn't work. Thanks a ton, I'll check it out ASAP!

EDIT: It does work! This:

Code: [Select]
var title:FlxSprite;
var glitch:GlitchFX;

override public function create():void
{
if (FlxG.getPlugin(FlxSpecialFX) == null)
{
FlxG.addPlugin(new FlxSpecialFX);
}

var txt = new FlxText(0, (FlxG.height / 4), FlxG.width, "Foxline");
txt.setFormat(null, 24, 0xFFFFFFFF, "center");

glitch = FlxSpecialFX.glitch();

title = glitch.createFromFlxSprite(txt, 2, 2);

glitch.start(1);

this.add(title);
}

gets me some nice, flickering text. No code changes. Cool! Thanks again, photonstorm.
« Last Edit: Tue, Feb 28, 2012 by 7heSAMA »

frth

  • New Member
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
Re: Flixel Power Tools
« Reply #143 on: Wed, Mar 7, 2012 »
I would like that my spaceship could fire at sametime two types of weapons - laser and rocket, but problem that I can use only one FireButton. So if I write:
Code: [Select]
FlxControl.player1.setFireButton("CONTROL", FlxControlHandler.KEYMODE_PRESSED, 50, lazer.fireFromParentAngle);
FlxControl.player1.setFireButton("SPACE", FlxControlHandler.KEYMODE_PRESSED, 50, rocket.fireFromParentAngle);
Then player will fire onle rocket. And I don't want to swap weapons, they both must fire at the same time. I looked in FlxContol and FlxControlHandler, but didn't found any function for secondary weapon.

Could anyone help me with this?

test84

  • Key Contributor
  • *****
  • Posts: 1328
  • Karma: +0/-0
  • ت
    • View Profile
    • My personal site.
Re: Flixel Power Tools
« Reply #144 on: Sat, Mar 10, 2012 »
Just setFireButton to one of them Override your fire method and fire both of those weapons, don't forget to call super.

OR

Have two different fire methods in another wrapper method that calls fireFromParentAngel with different parameters or sets a currentWeapon property and then calls that method.
blog, twitter, Check out my award winning game, Rot Gut:

Irtorius

  • Member
  • **
  • Posts: 16
  • Karma: +0/-0
    • View Profile
Re: Flixel Power Tools
« Reply #145 on: Fri, Mar 16, 2012 »
Hi, got this problem, im trying to make so that the player can shoot bullets by pressing the spacebar several times, but it just does not work for some reason :-\

This is my current code for setting the control and firerate for the weapon
Code: [Select]
// Set fire button and other settings
FlxControl.player1.setFireButton("SPACE", FlxControlHandler.KEYMODE_PRESSED, 0, Registry.pistol.fire);

// Set fire rate
Registry.pistol.setFireRate(0);

It works but does not perfrom the task i want i to, i just want to shoot one bullet/keypress so i thought if i changed to:
Code: [Select]
// Set fire button and other settings
FlxControl.player1.setFireButton("SPACE", FlxControlHandler.KEYMODE_JUST_DOWN, 0, Registry.pistol.fire);

// Set fire rate
Registry.pistol.setFireRate(0);

I would be able to perform the task, but instead, i can't fire any bullets at all  :-\
Some advice would be greatly appreciated  :)

test84

  • Key Contributor
  • *****
  • Posts: 1328
  • Karma: +0/-0
  • ت
    • View Profile
    • My personal site.
Re: Flixel Power Tools
« Reply #146 on: Sat, Mar 17, 2012 »
First of all, welcome to flixelville ;)

I never used FlxControl personally but looking at it's code, I would try to change the repeatdelay parameter to a bigger value since 0 apparently means that no delay between shoots/fires and thus meaning all bullets at once.

Also, don't set your fire rate to 0.

And since it's a common mistake, it doesn't hurts to say that if you don't see your bullets, you need to set boundries for your bullets with setBulletBounds, like setBulletBounds(new flxRect(0,0,6000,6000);

Another common mistake that you're better be safe than sorry is that make sure you "add" your bullets group to the scene with "add()" or FlxG.state.add() methods, depending on scope of them.
blog, twitter, Check out my award winning game, Rot Gut:

Irtorius

  • Member
  • **
  • Posts: 16
  • Karma: +0/-0
    • View Profile
Re: Flixel Power Tools
« Reply #147 on: Sun, Mar 18, 2012 »
Thanks for your reply and I hope I'll enjoy my stay :)
I fixed the holes in the code, but the problem is still there.
The weapon now fires a bullet once in a while when i spam the spacebar.
I want to fire a bullet everytime I press the spacebar. Could this be some bug when using FlxControlHandler.KEYMODE_JUST_DOWN?  :'(

test84

  • Key Contributor
  • *****
  • Posts: 1328
  • Karma: +0/-0
  • ت
    • View Profile
    • My personal site.
Re: Flixel Power Tools
« Reply #148 on: Tue, Mar 20, 2012 »
try KEYMODE_PRESSED
blog, twitter, Check out my award winning game, Rot Gut:

Irtorius

  • Member
  • **
  • Posts: 16
  • Karma: +0/-0
    • View Profile
Re: Flixel Power Tools
« Reply #149 on: Wed, Mar 21, 2012 »
Yes, I've tried that and i know it works, but it does not do what I want it to. If I use KEYMODE_PRESSED, the weapon keeps fireing if I hold the button down. I want just want it to fire one bullet, and then the user have to press again.  ;)
How could I do this I asked myself, but it was a little bit overwhelming for me to solve that question.  :-\
Is there any solution for this?

test84

  • Key Contributor
  • *****
  • Posts: 1328
  • Karma: +0/-0
  • ت
    • View Profile
    • My personal site.
Re: Flixel Power Tools
« Reply #150 on: Wed, Mar 21, 2012 »
That would be the exact purpose of KEYMODE_JUST_DOWN. That doesn't work for you?
blog, twitter, Check out my award winning game, Rot Gut:

ben657

  • Member
  • **
  • Posts: 5
  • Karma: +0/-0
    • View Profile
Re: Flixel Power Tools
« Reply #151 on: Wed, Mar 21, 2012 »
Hey, i've just started using these tools, and first of all, theyre excellent! but one thing that eludes me, is how to put in key strings... in the docs it says to use the flixel.system.input.keyboard class to get key strings, but I see no way of using it... is it just me not seeing something or..? :P

dncwalk99

  • New Member
  • *
  • Posts: 1
  • Karma: +0/-0
    • View Profile
Re: Flixel Power Tools
« Reply #152 on: Thu, Mar 22, 2012 »
Great addition to Flixel.  I've just started using Flixel and the Powertools come in handy.  One question though.  How would I apply a BlurFX to a StarfieldFX?

tomii

  • Active Member
  • ***
  • Posts: 108
  • Karma: +0/-0
    • View Profile
Re: Flixel Power Tools
« Reply #153 on: Tue, Mar 27, 2012 »
I'm having this problem with FlxScrollZone (I know I'm not the only one), where it just stops working all of a sudden. Anyone know how to fix this?
My online portfolio // www.tomii.se
My twitter

photonstorm

  • Administrator
  • Key Contributor
  • *****
  • Posts: 1502
  • Karma: +1/-0
    • View Profile
    • Photon Storm
Re: Flixel Power Tools
« Reply #154 on: Tue, Mar 27, 2012 »
Yeah pretty sure the problem is that the translation matrix values just get too big and can't cope any more. Not sure exactly what the limit is though, sorry - might be worth tracing out or something. It's the tx/ty values of the matrix. Could be that it exceeds the value of an integer maybe.

I think the solution would be to look for a "wrap point", i.e. rather than scroll infinitely (until it breaks!) you'd look to see if the translation values matched a seamless loop, and then reset them.
http://www.photonstorm.com



"Tell me and I will forget, show me and I might remember, involve me and I will understand" - Confucius

tomii

  • Active Member
  • ***
  • Posts: 108
  • Karma: +0/-0
    • View Profile
Re: Flixel Power Tools
« Reply #155 on: Tue, Mar 27, 2012 »
Okay, I'll see what I can find.
My online portfolio // www.tomii.se
My twitter

paala

  • Contributor
  • ****
  • Posts: 250
  • Karma: +0/-1
    • View Profile
Re: Flixel Power Tools
« Reply #156 on: Thu, Mar 29, 2012 »
I have a problem with FlxBar.
If I set max value different than 100 it doesn't update correctly.
Is this a known issue?
Should I create a separate help topic or is it ok to post here?

test84

  • Key Contributor
  • *****
  • Posts: 1328
  • Karma: +0/-0
  • ت
    • View Profile
    • My personal site.
Re: Flixel Power Tools
« Reply #157 on: Sat, Mar 31, 2012 »
I have a problem with FlxBar.
If I set max value different than 100 it doesn't update correctly.
Is this a known issue?
Should I create a separate help topic or is it ok to post here?

probably something else is wrong since none of my FlxBars have a max value of 100. Do you update it?
blog, twitter, Check out my award winning game, Rot Gut:

photonstorm

  • Administrator
  • Key Contributor
  • *****
  • Posts: 1502
  • Karma: +1/-0
    • View Profile
    • Photon Storm
Re: Flixel Power Tools
« Reply #158 on: Wed, Apr 4, 2012 »
Hi all,

I'm putting together Flixel Power Tools 2.0 at the moment. So far I've got several fixes across the classes, a bunch of new tile map based stuff and integration of Flod 4.

This will be the last release of FPT that I'm responsible for (someone else is welcome to pick up the mantle and carry on!) so I'm going to ask here now - what are the top (SMALL!) features you would like to see added for version 2? Nothing ridiculous please (don't ask for Stage3D support for example). But if I feel the request is manageable enough, then I'll implement it.

So get your requests in now :)
http://www.photonstorm.com



"Tell me and I will forget, show me and I might remember, involve me and I will understand" - Confucius

paala

  • Contributor
  • ****
  • Posts: 250
  • Karma: +0/-1
    • View Profile
Re: Flixel Power Tools
« Reply #159 on: Wed, Apr 4, 2012 »
Well, I would love box 2d sprites, if is not so hard.