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

Pages: [1]
1
graaaaaah. I figured it out. I was not calling super.update() on my main state's update loop. My entities were not updating their last x and y positions, and were permanently fixed at 0,0. The collision hulls in the quad tree were very large.

2
Hey folks.
I just started up a new project with the latest Flixel build (2.5 Master, 8989e50)

I have a bunch of "enemy" sprites on the stage, and a "tool" sprite that follows the Mouse, and deals damage to the enemy when they overlap.

The example is attached. Press and hold the "Up" arrow to spawn new enemy sprites. Move the mouse to move the Tool.

I am seeing some strangeness that seems to stem from the Quad Tree. As you can see in the example, the overlap between the tool sprite and the enemy sprite produces many false positives. This becomes very apparent if you spawn many enemies, and then slowly move the mouse. It looks like the Quad Tree is counting ANYTHING in a large zone as Overlapping, instead of going through those zones, and checking for a valid overlapping. The quad tree seems to be skipping the crucial last step of the process.

Has anyone seen this before? Am I using FlxG.Overlap incorrectly? Is this a known issue? I've never had a problem just shoving Sprites together before.

Example SWF is Here.

Project Source is Here.

Thanks!

3
games / Re: Jets On
« on: Tue, Dec 1, 2009 »
I dig the art style!

4
games / Re: Careless Talk
« on: Sun, Nov 29, 2009 »
@ Hideous: I think we're all familiar with the time at which the Narwahl Bacons.

@ riverguardian: The key to winning is filling up your Info Meter all the way before sending any out. If you manage to catch a large amount of info at the very beginning, it's quite easy.

@ lithander: I like the idea that "Winning" the game isn't necessarily a good thing, kind of like the Turbine Quiz puzzle in Machinarium. When I was thinking up the game, I was drawn to the charm of drawing a toothbrush mustache and angry eyebrows on commonplace objects, in the same style that Propaganda posters simplified and cartoonized them, and in general making Hitler seem silly.

5
games / Careless Talk
« on: Sat, Nov 28, 2009 »
Careless Talk
Costs Lives
A game of WWII stealth and subterfuge.

Well, kind of.  This started off as a game I only intended to have completed start to finish in a week, but I decided to make it into a full fledged portfolio piece.


The idea is centered around those WWII propaganda posters where Hitler himself is listening in on two townsfolk gossiping about troop movements, sometimes disguised as an every day object.


You play as the Fuhrer Himself, deep undercover in London.
Move left and right with the arrow keys
Press X to Disguise yourself as a Post Bin
Move in close to civilians having conversations
If you are not disguised, they will become suspicious, and stop talking.
Press C at the phone booth to relay information back to Headquarters.  Large bursts of information are FAR more usefull than small bursts.


Enjoy, and tell me what you think!

6
help / Re: Flashlight Effect in Fathom
« on: Wed, Aug 12, 2009 »
After some research, persistence, a small amount of cursing, and some timely advice from my roommate, I've figured out this flashlight effect, minus the rotation, oh well.
Here's the end result:  http://www.swfcabin.com/open/1250133097

Heres how I did it:
Every place in my PlayState where I plunk down a regular old green FlxBlock, I also plunk down a custom class, AltBlock.  It is almost identical to FlxBlock with a few alterations.  Here is AltBlock's render function.  Please excuse my slipshod naming conventions.


Code: [Select]
override public function render():void
{

super.render();

getScreenXY(_p);
var opx:int = _p.x;
var glowPoint : Point = new Point(_glow.x, _glow.y);
var rBuffer : BitmapData = new BitmapData(FlxG.buffer.width, FlxG.buffer.height, true, 5);
for(var i:uint = 0; i < _rects.length; i++)
{
if (_rects[i] != null)
{
if (_glow.overlapsPoint(_p.x, _p.y) || _glow.overlapsPoint(_p.x + _tileSize, _p.y) ||  _glow.overlapsPoint(_p.x , _p.y + _tileSize) ||  _glow.overlapsPoint(_p.x + _tileSize, _p.y + _tileSize))
{
rBuffer.copyPixels(_pixels, _rects[i], _p, null, new Point(0, 0), true );
}
}
_p.x += _tileSize;
if(_p.x >= opx + width)
{
_p.x = opx;
_p.y += _tileSize;
}

}

var tRect : Rectangle = new Rectangle(_glow.x, _glow.y, _glow.width , _glow.height);
FlxG.buffer.copyPixels(rBuffer, tRect, glowPoint,_glowPixels,new Point(0,0),true);
}


I have a Glow sprite that follows the mouse cursor around (in playstate).  AltBlock's render function checks to see if it overlaps this glow sprite before writing its pixel data into my rBuffer  (for Red block Buffer) BitmapData object.

At the end of this loop, rBuffer is now filled with every full block that is touching the glow sprite.  Then, using the Glow sprite's pixel data as an alpha channel, I copy rBuffer's bitmap data into the FlxG buffer, constraining the sample size to the size of the glow sprite.  You can press Q to see the black-to-transparent image I using as the glow pixeldata.

Neat!

7
help / Re: DogTree -- A collision quad tree for flixel
« on: Tue, Jul 28, 2009 »
Heres a decent explanation.  It basically only runs hit detection on objects close to one another.  The idea is to cut down on total number of collision checks to speed up your game.

http://lab.polygonal.de/2007/09/09/quadtree-demonstration/

8
games / Re: Wonder Bounce - Completed!
« on: Sun, Jul 26, 2009 »
Nice job man!  You really worked out all of the kinks.

9
help / Re: Flashlight Effect in Fathom
« on: Sat, Jul 25, 2009 »
OK, so I've made a little progress.  I can turn blocks to other color a whole block at a time, but what I really want is a per-pixel show/hide (and also alpha values).  You can press Q to show/hide the flashlight mask.
http://www.swfcabin.com/open/1248569726

OK, here's a quick illustration of what I'm trying to accomplish.
http://imgur.com/qJmKt.jpg

When the "flashlight" is over a block, I want the pixels to show through as if through a mask, alpha and everything.  I am trying to run a copyChannel on the alpha channel, but instead of turning invisible, the FlxBlock is turning black.  You can see this in the top left corner.  Is there something I need to change to get the pixels to accept alpha values?

10
help / Re: Flashlight Effect in Fathom
« on: Wed, Jul 15, 2009 »
phoey.  So I guess my next question is where should I start digging to turn a block array into a display object in order to throw a .mask on to it.  Is FlxGame where everything eventually gets turned into a bitmap and rendered on-screen?

11
help / Flashlight Effect in Fathom
« on: Tue, Jul 14, 2009 »
I'm trying to deconstruct the flashlight effect in Fathom, and can't figure it out.  Is it a massive black and transparent sprite that sit on top of everything else, and has it's alpha dialed up and down?  I don't suppose there is source code available.

I am trying to have 2 different block sprites, one being revealed when the flashlight sweeps over it.  Any suggestions?

Pages: [1]