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

Pages: 1 2 [3] 4 5
41
You've never instantiated g, so it's not yet a Sprite.  You should be getting an error in the debug player.

LMAO oh god I'm so embarrassed  :-[

thanks  :D

42
What is g ? As the State extends Sprite it should just be graphics (or this.graphics if you want more clarity)



Sorry, g is defined as follows: private var g:Sprite;

That should work, no?

Edit: Here's the entire file:
Code: [Select]
package

{

import flash.display.*;
import org.flixel.*;

public class MainMenu extends FlxState
{

private var drawing:Boolean;

private var g:Sprite;

override public function create():void
{
bgColor = 0xffffffff;
var t:FlxText;
t = new FlxText(0,FlxG.height/2-10,FlxG.width,"Mouse Gestures Test");
t.size = 16;
t.alignment = "center";
t.color = 0xff000000;
add(t);
t = new FlxText(FlxG.width/2-50,FlxG.height-20,100,"click to play");
t.alignment = "center";
t.color = 0xff000000;
add(t);

drawing = false;

g.graphics.lineStyle(2, 0xFF0000,1);
addChild(g);

FlxG.mouse.show();
}



override public function update():void
{
super.update();

/*if (FlxG.mouse.pressed())
drawing = true;
else
drawing = false;*/

/*if (drawing)
g.graphics.lineTo(mouseX, mouseY);*/


/*if(FlxG.mouse.justPressed())
{
//FlxG.mouse.hide();
FlxG.state = new PlayState();
}*/
}

}

}

I have the things in update() commented out for testing purposes.

43
I'm trying to implement mouse gestures into my game right now. I started off simple, just trying to enable the mouse to draw on the screen when the mouse is held down.

For some reason when I have this line in the create() function of the state:

g.graphics.lineStyle(1, 0x000000);

it breaks the state. Nothing appears and it seems frozen. Any ideas why this is happening?  ???

44
help / Re: DAME - a new map editor made using flixel!
« on: Sat, Nov 13, 2010 »
To do anything this complex you would really need to write your own custom exporter. It could be simple enough to create a modified version of the existing exporter with extra functionality that is dependant on your setup. Otherwise, if you'd rather stick with the sample exporters, then I recommend your Enemies just ask the PlayState for the player and the map layers. You could also pass in the map layer name as a property, so if you add a string property called map then %prop:map% should output whatever you have for that sprite.
But I personally recommend creating a custom exporter in this instance.

It makes me very sad that I just now found out that you could simply ask the playstate for the instantiations... On the bright side I learned something extremely valuable and now understand static variables!  :D

I have a couple more questions:

What are the Layer Properties for? Is it possible to use them to set a tilemap layer's collideBottom to false?

Also, can I pass a simple string into the necessary parameters of my enemy sprite via constructor text?

45
help / Re: DAME - a new map editor made using flixel!
« on: Fri, Nov 12, 2010 »
Question:

I am trying to set up a sprite of an enemy which needs the player passed in as one of the parameters. The player is instantiated in DAME. How can I take that instance of the player sprite and pass it into the enemy via the enemy's constructor text?

E.g. new Enemy(%xpos%, %ypos%, %thisplayer:Player%)

Also, is there a way to pass in map layers?

46
releases / Re: Flixel on Android
« on: Thu, Sep 23, 2010 »

47
chat / RPG Stat System Framework
« on: Tue, Aug 17, 2010 »
I found a neat RPG stat system framework while looking into how to implement stats into my game. Thought I would share it here, in case anyone else was looking for something similar.

http://pixelwelders.com/blog/game-design/2009/as3-rpg-style-stats-system/

I think it's a very neat system. I'll be modifying this and using it in my games for sure.

Enjoy!

48
games / Re: [Finished] Beat Boost
« on: Tue, Aug 10, 2010 »
Hey guys,

I had previously mentioned I'd be writing a post about my process in creating Beat Boost and, it's more than a little bit delayed but you can now read it here.

I don't go into any specifics on using Flixel as the post is about my process for designing the gameplay.

Awesome! I love reading dev articles. Thanks :D

49
help / Re: Multi-layered Tilemap Collisions
« on: Fri, Aug 6, 2010 »
One-way tileblocks are also sometimes called "Clouds", I find it easier to type :P

Here's my player code that prevents my guy popping up onto a cloud while just walking from left to right, basically checks his velocity, and then check his height relative to the cloud block:
-snip-

Cloud is much easier to say, yeah xD. I'm having trouble with this. When you call Contact.y, what is that returning? The y value of the tile that the player is colliding with?

50
help / Re: Multi-layered Tilemap Collisions
« on: Thu, Aug 5, 2010 »
If you implement the preCollide stuff for jumping down thru the one-way platform, that should take care of this problem, as preCollide is only triggered when you're above the tile.

In order for preCollide to work I need to collide() my platforms tilemap with the player, right? I've tried it with and without. With, it just snaps up to the top of the tile. Without it does no collision at all.

51
help / Re: Multi-layered Tilemap Collisions
« on: Thu, Aug 5, 2010 »
make a class, name it something, make it extend flxTilemap, then load your one way tiles in that tilemap (have it be a separate tile map) same way as normal, then adjust that code to be if Contact is (whatever you named that class.)
The custom tilemap class probable doesnt need any special code, other then extending tilemap, so you can basically make it totally empty.
Another thing you could do, is pass a tilemap to the player as a variable, and change Contact is OneWayTileBlock to Contact == the tilemap you passed as a variable, provided you only have one map of one way tiles.

Yeah, I ended up passing the tilemap into my player class. It's somewhat working now. My player is two tile blocks high, so if any of hit hitbox collides with the top of the tile he instantly zips up to the top of the tile. How can I prevent this?

52
help / Re: Multi-layered Tilemap Collisions
« on: Thu, Aug 5, 2010 »
http://flashgamedojo.com/wiki/index.php?title=Platform,_One-Way_%28Flixel%29

I've read through that before, but didn't notice the usefulness of precollide. Okay so I'm working with Flan's style of setting up maps and now I'm having a bit of trouble working with these two methods together.

In this bit of code here:
Code: [Select]
override public function preCollide(Contact:FlxObject):void
{
if(_falling && Contact is OneWayTileBlock && (_fallingThrough == null || _fallingThrough == Contact))
{
_fallingThrough = Contact
collideBottom = false
}
else
{
collideBottom = true
}
super.preCollide(Contact);
}

What do I replace OneWayTileBlock with if I want it to be an entire FlxTilemap? The contact needs to be a class (at least that's what my compiler says).
I'm so confused D:

53
help / Multi-layered Tilemap Collisions
« on: Thu, Aug 5, 2010 »
Can anyone suggest a way to give my character the ability to "jump up" a layer of tilemaps? Very similar to the mechanics of Mario; how you can run sideways through tiles that you can get on top of if you jump up.

54
chat / Re: 2D sideview action game
« on: Tue, Aug 3, 2010 »
I've messed with it some, but I couldn't get it working well on my machine. The frequent crashes and freeze-ups made me uninstall.

Other than that, I love the game. It's very fun and especially competitive when you get good at it. The controls are certainly unique, but they feel great.

55
chat / Re: Shmup lovers!
« on: Tue, Aug 3, 2010 »
I always thought shmup scoring systems were pretty straight-forward? I mean you shoot a dude, get some points. Collect items, maybe more points. What kind of depth is there?

Placement patterns of enemies and stuff. Where and how you should path through a certain level or phase. It comes down to a science for some games, which I really don't like. Just IMO, though.

56
games / Re: [WIP] Casual Guy
« on: Mon, Jul 26, 2010 »
cute. looks like any generic platformer currently.  controls flow well - the AI's kinda stupid with the movement (make him jump if wall encountered! he gets stuck sometimes).

what you need to focus on (in case you haven't yet) is that you're gonna need something unique that makes your game stand out from the rest!  mario didn't have that problem back in the days because it was unprecedented at its time.  Today, a mario-style platformer (as the flixel engine so easily provides) is a bit boring.
The graphics are decent too, especially for a sketch version as it currently seems. I'd suggest you not worry about them so much yet and focus on your engine!

you're doing well, keep it up! I'll be expecting more soon ;)

Thanks for the reply, very encouraging :D

I know what you mean when you say I need to make it unique. I've been reading up on that recently, checking out ludum dare, the experimental game project, and all of these real cool and unique prototype games and articles about game design. I really love indie game development. If I could make a career out of it I so would.

The thing is that I'm still very new to game design and programming, so I'm going to make a few "copy games" first so I can learn design techniques and get more familiar with OOP. If I happen to stumble upon something that's unique and fun I'll keep it in my game, but I wanna focus on just getting a complete game done.

Again thanks for the input. I'll keep going :]

57
games / [WIP] Casual Guy
« on: Sun, Jul 25, 2010 »
I'm working on my very first semi-large scale complete game project. It's a platformer. I plan on implementing some really nice melee combo moves and maybe some magic or ranged attack.

Here's the prototype engine so far:

http://www.swfcabin.com/open/1280101397

Space to jump, again to double jump. X to attack (no animation for attacking yet). The blob thing has a simple AI in him. He will randomly wander about. If you get too close he will chase you, and stop if you get too far.

As you can see I'm still working on the graphics :P.

How do the controls feel? Any critiques / ideas / suggestions / input?

58
http://flixel.org/forums/index.php?topic=2012.0

also: Where is this EZ platformer setup you speak of?

59
help / Re: Enemy AI - Jumping up to a platform
« on: Thu, Jul 22, 2010 »
Okay I overrode the hitSide function like so:

Code: [Select]
override public function hitSide(Contact:FlxObject, Velocity:Number):void
{

super.hitSide(Contact, Velocity);

velocity.y = -100;

}

I tested it and the enemy does nothing when coming in contact with a wall. Am I missing something?


Edit:

I've been running some tests. I believe that hitSide() will only trigger if neither hitTop() nor hitBottom() are being triggered. I overrode hitBottom() to give a small upward velocity every time the enemy touched the ground, and then hitSide() triggered properly.

So I took your code, xkoster, modified it a tad and put it into my update function. Worked like a charm. Thanks!

Here's the code:
Code: [Select]
var tileX:uint = x / 24; // my tiles are 24x24
var tileY:uint = y / 24;

if (_map.getTile(tileX - 1, tileY) && velocity.x < 0)
jump();
else if (_map.getTile(tileX + 2, tileY) && velocity.x > 0)
jump();

60
help / Re: Enemy AI - Jumping up to a platform
« on: Thu, Jul 22, 2010 »
try something like
Code: [Select]
override public function hitLeft(Contact:FlxObject, Velocity:Number):void
{
if (player.x < x)
jump();

super.hitLeft(Contact, Velocity);
}

I'm hoping for something a little more predictive. Is there any way I can check if my enemy sprite is colliding with a specific tile index or tile block?

Pages: 1 2 [3] 4 5