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]
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


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();


Ok, thanks!

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

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


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]
explode(E.x, E.y);

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

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!

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]
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){

nHeight = Height;
var mygutter:Rectangle = new Rectangle(nX, nY, nWidth, nHeight);

override public function draw():void {
var mygutter:Rectangle = new Rectangle(nX, nY, nWidth, nHeight);, 0x66FF0080);


override public function update():void{


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

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

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?


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.

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

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?


Pages: [1]