Be a Supporter!
Customizing The Ng Api Preloader? Posted September 6th, 2011 in Game Development

So I've got the API working with my current project in FlashDevelop. I've never worked with SWCs before so I'm rather unsure how I can go about customizing the preloader rather than using the default one.

Response to: Flixel questions Posted August 7th, 2011 in Game Development

At 8/7/11 03:44 PM, ixfd64 wrote: After playing a bunch of impressive games on NG, I've recently picked up an interest in making Flash games. From what I've heard, Flixel is very easy to use. As such, I have a few questions.

1. Is it really true that one does not require Adobe Flash (only FlashDevelop) in order to make games using Flixel? My biggest problem is that I do not have a copy of Flash. While I know it's possible to "acquire" it at no cost, I'd rather stick to legally obtained programs.

2. What's the current latest version of Flixel? The website says it's 2.43, but many users are talking about 2.50 and 2.53, etc.

3. Are certain genres of games easier or harder to make with Flixel? I've heard some people say that Flixel is best suited for platformers.

4. Can Flixel be used to make movies?

Thanks.

1. Yep, all that's required to make games with Flixel is FlashDevelop or a similar IDE.

2. The current master version is 2.55, you really should be using this. Versions like 2.43 etc. are kept on the site for people who created games with those versions in the past and don't want to port or learn the new Flixel which has changed a fair amount (for the better in most cases).

3. Flixel is great for making platformers but you can literally make any type of game in Flixel, Flixel doesn't create a game for you it just provides a lot of generic features that are often needed in flash games. Rather than reinventing the wheel and spending days or weeks coding blitting and collision detection systems you can just get straight into building your game on top of Flixel.

4. Not really no, as I said Flixel is just a framework containing common game features and logic for you to build upon.

Response to: Launcher Help Posted July 19th, 2010 in Game Development

At 7/19/10 11:39 AM, game155 wrote: ... Theres nothing on that website about launchers.

The first step is to stop looking at games and the content of games as specific objects with one solution for each problem.

Break it down. What do you want your "launcher" to do? What else in your game does it interact with? The player? So first work on detecting when your player has interacted (touched, whatever) with the launcher. Once you've got that down you can start thinking about what should reaction should occur when this interaction happens.

Break everything down into little manageable steps and you'll find you can build anything.

Response to: Api Problem Posted July 15th, 2010 in Game Development

At 7/15/10 12:54 PM, Sandremss128 wrote: things couldn't be more ironic...
Just when I saw your problem I saw this wonderfull tutorial being submitted on the flash protal. The sound loop doesn't work but the information inside it is good ^^:

That isn't irony...

Response to: Flash artwork > 5000px wide = Crash Posted July 15th, 2010 in Game Development

Break them up into smaller chunks and use code to draw them only when you're going to need them.

Response to: algorithm to convert shape to rects Posted June 23rd, 2010 in Game Development

Okay I've pretty much got most of the theory down on paper (never done that before, I'm going to from now on. it's so much easier). One problem I am having though is determining which lines are upper and which lines are lower. I might be missing something very simple but for the life of me I can't find a foolproof way. Any pointers?

Response to: algorithm to convert shape to rects Posted June 22nd, 2010 in Game Development

At 6/22/10 12:27 PM, GustTheASGuy wrote: I mean you take the horizontal lines of the shape. The ones that are above the area of the shape are upper ones, the others lower.

Ah I understand. Thanks, I can sort of visualise how that is going to work. I'll have a thrash around with that tonight and see how far it gets me. Thanks again.

Response to: algorithm to convert shape to rects Posted June 22nd, 2010 in Game Development

At 6/22/10 11:58 AM, GustTheASGuy wrote: Find the lower and upper edges of the shape, two lists. Take a lower edge, find the closest opposing upper edge, register a rectangle on the area where they oppose, replace the edges' entries in the lists with the disjoint subsegments. Repeat.

This sounsd good. Thank you. However I'm not sure what you mean by upper and lower edges, what defines a lower or an upper edge?

Response to: algorithm to convert shape to rects Posted June 22nd, 2010 in Game Development

I'm still having trouble getting my head around the problem and visualising it.

I keep having ureka moments and thinking "Ahh it was so simple", then look into my idea more and realise it falls apart with more complex shapes and this needs to work with any shape within the given boundarys (straight lines and 90 degree angles).

The line example above helped me a bit, but I can't really see how I can get from that to rectangles.

Maths isn't exactly my strong point and this is a real headache haha.

Response to: algorithm to convert shape to rects Posted June 21st, 2010 in Game Development

No I have the points that draw the shape, in an array convieniently called points.

My ultimate goal is to have an algorithm that takes in my points array, and spits out an array of rectangles (let's call it rects) that make up that shape.

Basically I'm looking for the theory behind slicing a shape up into smaller rectangles. See the screenshot, I hope I'm describing this properly.

algorithm to convert shape to rects

Response to: AS3 light - looping lag Posted June 21st, 2010 in Game Development

At 6/21/10 09:45 AM, yyyyyyy wrote:
At 6/21/10 09:37 AM, Gutya wrote:
At 6/21/10 09:36 AM, yyyyyyy wrote: Anyone?
I get a pretty solid 30 FPS when I run that swf, no lag at all.
What are your specs? (CPU, browser, flash version, etc.)
Thanks :)

Firefox 3.3.6
Flash Player 10.0.45.2
Windows XP
2.99 Ghz Processor
2GB RAM

Response to: AS3 light - looping lag Posted June 21st, 2010 in Game Development

At 6/21/10 09:36 AM, yyyyyyy wrote: Anyone?

I get a pretty solid 30 FPS when I run that swf, no lag at all.

Response to: algorithm to convert shape to rects Posted June 21st, 2010 in Game Development

Forgot the screenshot I mentioned whoops.

algorithm to convert shape to rects


Okay, in my game I have an array which is filled an arbitrary number of Point() objects. These points plot the outside edge of a shape. The shape can only possibly contain right angles and straight lines, therefore this shape can definitely be broken up into rectangles.

I'm not really asking for the code, I'm just looking for a little bit of a push in the right direction as to how I should be handling this algorithm. I can think of a few things, and I always seem like I get it until I realise a situation that would break that approach.

My first thought was to take two bottom "corner" points on the shape and then draw a rectangle upwards until we hit a right angle, then take the next set of points and draw another rectangle up to the next angle. That would work for simple shapes, but for more complex shapes I need something a bit more advanced. (See my attached terrible screenshot, the first shape with the tick would be processed easily with my technique above, however the second shape with the cross wouldn't be that simple)

I can kinda see what I need to do, however I feel like I'm just on the tip of finding it and need a few pointers. Maybe I would need to use recursion? I'm not sure. Any pointers in the right direction will be taken very well.

As3 Snake Movement Help Posted March 16th, 2010 in Game Development

hey guys, i've been following flixel for a while but since starting a new job etc. I've had no time for programming this year. I've decided to jump back in now and refresh my AS3 knowledge by making a little flixel game. I decided to remake the old classic snake as a little project. Now it was all going fine until now, I'm having a little problem and I've tried a lot of things and I can't seem to fix it, I'm almost certain I'm overlooking something very simple, so here goes, maybe your eye's will see what my tired eyes can't :)

Here we go, arrow keys to move, the problem should be pretty evident, the tail is always one "block" behind the head, they should be attached. (i'm aware there's no collision and i'm aware the snake can leave the map, it's only there as a reference)

http://www.newgrounds.com/dump/item/eb09 a25953c1a2c6ed1547983a9a02ba

I'm aware some of my code is redundant and messy, it was quite clean before but trying to fix this messed it up a little. As soon as I find a solution I'm going to smooth it out a bit

The head is an instance of the snakeHead class:

package snake
{
	import org.flixel.*;
	
	public class snakeHead extends snakeSeg
	{
		public var direction:int;
		public var moving:Boolean;
		public var delay:int;
		public var count:Number;
		public var children:int;
		public var childCount:int;
		
		public function snakeHead(s:int, dir:int, del:int):void
		{
			this.x = playState.X_OFFSET;
			this.y = playState.Y_OFFSET;
			
			curTileX = FlxU.floor((x - playState.X_OFFSET) / width);
			curTileY = FlxU.floor((y - playState.Y_OFFSET) / width);
			lastTileX = curTileX;
			lastTileY = curTileY;
			
			width = s;
			height = s;
			direction = dir;
			delay = del;
			
			createGraphic(width, height, 0xffff0000);
			
			moving = true;
			count = 0;
		}
		
		override public function update():void
		{
			if (FlxG.keys.LEFT) 
			{
				direction = LEFT;
			}
			else if (FlxG.keys.RIGHT)
			{
				direction = RIGHT;
			}
			else if (FlxG.keys.UP)
			{
				direction = UP;
			}
			else if (FlxG.keys.DOWN)
			{
				direction = DOWN;
			}
			
			if (count == delay) {
				switch(direction) {
					case LEFT:
						x -= width;
						break;
					case RIGHT:
						x += width;
						break;
					case UP:
						y -= width;
						break;
					case DOWN:
						y += width;
						break;
				}
				lastTileX = curTileX;
				lastTileY = curTileY;
				curTileX = FlxU.floor((x - playState.X_OFFSET) / width);
				curTileY = FlxU.floor((y - playState.Y_OFFSET) / width);
				count = 0;
			} else {
				count += FlxG.Elapsed * 100;
			}
			
			super.update();
		}
	}
}

and the tail pieces are all instances of the snakeSeg class:

package snake 
{
	import org.flixel.*;
	
	public class snakeSeg extends FlxSprite
	{
		public var curTileX:int;
		public var curTileY:int;
		public var lastTileX:int;
		public var lastTileY:int;
		public var parent:snakeSeg;
		public var head:snakeHead;
		
		public function snakeSeg(p:snakeSeg = null, h:snakeHead = null):void
		{
			parent = p;
			head = h;
			
			if (parent != null)
			{
				width = parent.width;
				height = parent.height;
			
				createGraphic(width, height, 0xffff0000);
			
				x = (parent.curTileX * width) + playState.X_OFFSET;
				y = (parent.curTileY * height) + playState.Y_OFFSET;
				
				curTileX = FlxU.floor((x - playState.X_OFFSET) / width);
				curTileY = FlxU.floor((y - playState.Y_OFFSET) / width);
			}
		}
		
		public override function update():void
		{		
			if (parent != null)
			{	
				if (head != null)
				{
					if (head.count == head.delay)
					{
						x = (parent.lastTileX * width) + playState.X_OFFSET;
						y = (parent.lastTileY * height) + playState.Y_OFFSET;
						lastTileX = curTileX;
						lastTileY = curTileY;
						curTileX = FlxU.floor((x - playState.X_OFFSET) / width);
						curTileY = FlxU.floor((y - playState.Y_OFFSET) / width);
					}
				}
			}
			super.update();
		}
	}
}

I appreciate anyone taking a quick glance!

Response to: Using Ng Preloaders In Flashdevelop Posted December 3rd, 2009 in Game Development

So it's as simple as compiling the swf in the Flash IDE and then embedding it into my project in FlashDevelop?


I recently migrated to FlashDevelop and i'm still figuring out some of the quirks of using Flex. I can make my own preloader okay but I was just wondering how I would go about using the NG preloaders?

Response to: Top Skills for '09 Posted January 1st, 2009 in Programming

Note the Apple logo in his signature...

Response to: The Flash 'Reg' Lounge Posted December 30th, 2008 in Game Development

At 12/30/08 07:39 PM, Toast wrote: Imagine an arrow moving in empty space.

http://en.wikipedia.org/wiki/Zeno%27s_pa radoxes

Response to: The Flash 'Reg' Lounge Posted December 30th, 2008 in Game Development

I think he said he liked it, then read some online reviews and changed his opinion to fit in with the popular opinion.

Response to: Actionscript _global question! Posted December 29th, 2008 in Programming

This belongs in the Flash Forum.

Response to: System Restore Posted December 29th, 2008 in Programming

Format and reinstall the OS.

Response to: Ok, one question... Posted December 29th, 2008 in Programming

I can vouch for XNA, it's pretty good. The biggest appeal for me though was running code on my 360.

Response to: The Flash 'Reg' Lounge Posted July 17th, 2008 in Game Development

Wait...

Americans don't understand 24 Hour time?

XFD
Response to: AS3 font question Posted July 16th, 2008 in Game Development

Ah sorry I didn't read your post properly.

instanceName.htmlText = 'blah';

Response to: AS3 font question Posted July 16th, 2008 in Game Development

instanceName.text = 'suck mah dick';

Response to: Actionscript Help Posted July 16th, 2008 in Game Development

I guess you could check for the cookie with PHP or javascript then tell the SWF if it exists. And set the cookie in the same way.

But seriously just use the Flash SharedObject.

Response to: Actionscript Help Posted July 16th, 2008 in Game Development

Why do you need to?

What EXACTLY do you want to do?

Response to: The Flash 'Reg' Lounge Posted July 14th, 2008 in Game Development

At 7/14/08 05:49 PM, NG-Unit wrote:
At 7/14/08 05:01 PM, Gutya wrote: or even more stupidly people posting SECOND or THIRD and so on.
Hah whoops. Don't go looking at the second post on TomFulp's newest post then :D.

Yeah but you're a Juggalo so you're more prone to stupidity.