Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - dca

Pages: [1]
1
help / Moving a Hero in a game
« on: Tue, Nov 17, 2015 »
Hello all,

I'm having a real tough time figuring this one out.

I have a Hero sprite and I need to do the following. (I can capture the right and left keys, just don't know the logic to get the sprite to move properly)

  • The sprite starts moving right at a constant speed.
  • If you press the left arrow key it should move left; right arrow key move right. When the key is pressed it should speed up, then slow down to the constant speed. The more you press a key, the faster it goes in that direction before slowing down again.
  • If the sprite is on the right side of the screen, and no keys are pressed, it will continue right at a constant speed. The same goes for the left.

I can get the sprite to move left and right but the speed up/slow down I can't get. I've read tutorials but nothing is working for me

Thanks!

2
help / Re: Noob Question - Overlap() and FlxGroups
« on: Mon, Feb 23, 2015 »
On a side note, you don't need to add each object once it's in a group.  You can simply add the group.
Code: [Select]
override public function create():void
      {
        interactableGroup = new FlxGroup();
        interactableGroup.add(player);
        interactableGroup.add(char2);

        add(interactableGroup);
      }

3
Ok, thanks!

4
help / Flixel Power Tools Demo Source or Documentation
« on: Sun, Feb 15, 2015 »
Hello,

I've been looking for the Flixel Power Tools demo source or documentation and can't find it anywhere. Can someone post a link?

Thanks!

5
help / Re: Overlap being called twice
« on: Sun, Feb 15, 2015 »
Tried posting once before but don't know why it didn't appear

Code: [Select]
E.solid=false;
explode(E.x, E.y);
E.kill();

This should stop the double Overlap as E.solid turns off collision for the object.

6
help / Re: Colliding with rectangle drawn in a sprite
« on: Sat, Jan 24, 2015 »
Didn't know I could just use it to do that. Thanks!

7
help / Colliding with rectangle drawn in a sprite
« on: Fri, Jan 23, 2015 »
I have a class that extends FlxSprite and I can draw the rectangle in the class in the draw() function.

What I need to do is to have other sprites collide with it.
Code: [Select]
package 
{
import flash.geom.Rectangle;

import org.flixel.FlxG;
import org.flixel.FlxSprite;

/**
* ...
* @author ...
*/
public class gutter extends FlxSprite
{
private var nX:Number=0;
private var nY:Number=0;
private var nWidth:Number=0;
private var nHeight:Number=0;

public function gutter (X:Number=0, Y:Number=0, Width:Number=0, Height:Number=0){

nX=X;
nY=Y;
nWidth=Width;
nHeight = Height;
var mygutter:Rectangle = new Rectangle(nX, nY, nWidth, nHeight);
super();
}

override public function draw():void {
super.draw();
var mygutter:Rectangle = new Rectangle(nX, nY, nWidth, nHeight);
FlxG.camera.buffer.fillRect(mygutter, 0x66FF0080);

}

override public function update():void{

super.update();
}
}
}

When I do this, though, the collisions don't happen. Any ideas?

8
help / Re: Adding Emitters to FlxGroup help
« on: Sat, Jan 3, 2015 »
Ok, thanks! I'll give that a try.

9
help / Re: Adding Emitters to FlxGroup help
« on: Thu, Jan 1, 2015 »
So I would create some sprites, add them to the FlxGroup and then use FlxEmitter:at() to link them? How do I differentiate those in the FlxGroup?

Thanks!

10
help / Re: Adding Emitters to FlxGroup help
« on: Tue, Dec 30, 2014 »
I have 6 emitters I need to place at at the top of my game. They need to fall down the screen, emitting particles as they do. I've added these 6 to an FlxGroup, so I can reuse them after they fall off the screen.

11
help / Adding Emitters to FlxGroup help
« on: Mon, Dec 29, 2014 »
Hello,

I'm adding Emitters to an FlxGroup and have some questions:

1) How do I make these emitters have a velocity like a FlxSprite? I want each to fall down the screen at a constant rate (particles would continually be emitted as they fall).
2) Once the emitter leaves the screen how can I reuse it at the top?

Thanks!

Pages: [1]