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.


Topics - Chelnok

Pages: [1]
1
help / DAME and custom properties..
« on: Fri, Feb 10, 2012 »
No luck from sticky topic: DAME - a new map editor made using flixel!

I suppose this is not too advanced question, so.. copyPaste from original post:

I have a door sprite with property jammed (boolean). I can get the value exported correctly, but i cant get my custom properties to work like i understand from helppage:
http://damehelp.dambots.com/index.php/Writing_An_Exporter#Properties

How should i use this in exporter:

Code: [Select]
%%if prop:NAME%% This should be exported if there is property NAME %%endprop%%

I have tried all combinations, but it always exports everything including all those %%things%%

-----
If you have any experience with DAME or LUA, please drop a comment. DAMEs exporters is not so easy to understand, so any info is quite wellcome for me ..and probably to many others.

2
help / Line of sight
« on: Sun, Nov 13, 2011 »
I've been cheking los between two groups, five members each. No performance hit. But now i need to go bigger groups with more members. How would you do it?

3
help / FlxGroup, members and nullMembers
« on: Thu, Nov 3, 2011 »
I need to use FlxGroup like normal array, like myFlxGroup[2]. As far as i know, its not good to use myFlxGroup.members[2], cos there might be some null members. So i made this kind of thing:

Code: [Select]
package
{
import org.flixel.FlxGroup;

public class FlxGroupExt extends FlxGroup
{
public var trueMembers:Array;
private var i:uint;

public function FlxGroupExt(MaxSize:uint=0)
{
super(MaxSize);

}

public function getTrueMembers():Array
{
trueMembers = new Array()

if(members != null)
{
i = 0;
while(i < members.length)
{
if ( members[i] != null)
{
trueMembers.push(members[i])
}
i++;
}
}

return trueMembers;
}

}
}

For some reason i have a doubt. After few test, everything seems to work fine, but still.. i dunno :)

4
releases / FlxTilemapExt - tile to FlxSprite
« on: Fri, Oct 28, 2011 »
Small extension that let you grab particular tile from tilemap to FlxSprite.

How to use:

Code: [Select]
var myTileSprite:FlxSprite = map.tileToFlxSprite(15,16)
add(myTileSprite)
myTileSprite.velocity.x = 15 //for testing

Code: [Select]
package
{
import flash.geom.Point;
import flash.geom.Rectangle;

import org.flixel.FlxSprite;
import org.flixel.FlxTilemap;


/**
* This is an extension that adds one function to FlxTilemap class: tileToFlxSprite().
* You can also copy the function and paste it to FlxTilemap. No need to change anything.

* @author Chelnok
*/
public class FlxTilemapExt extends FlxTilemap
{
public function FlxTilemapExt()
{
super();
}


/**
* Chance a particular tile to FlxSprite. Or just copy the graphic if you dont want any chances to mapdata itself.
*
* @param X The X coordinate of the tile (in tiles, not pixels).
* @param Y The Y coordinate of the tile (in tiles, not pixels).
* @param NewTile New tile to the mapdata. Use -1 if you dont want any changes. Default = 0 (empty)
*
* @return FlxSprite.
*/
public function tileToFlxSprite(X:uint,Y:uint,NewTile:int=0):FlxSprite
{
var rowIndex:int = X + (Y * widthInTiles);
var rect:Rectangle = _rects[rowIndex] as Rectangle;
var pt:Point = new Point(0, 0);
var tileSprite:FlxSprite = new FlxSprite();

tileSprite.makeGraphic(_tileWidth,_tileHeight,0x00000000,true)

tileSprite.x = X * _tileWidth;
tileSprite.y = Y * _tileHeight;

if (rect != null)
tileSprite.pixels.copyPixels(_tiles, rect, pt);

tileSprite.dirty = true

if (NewTile >= 0)
setTile(X,Y,NewTile);

return tileSprite;
}
}
}

5
help / default camera
« on: Sun, Jul 31, 2011 »
I was just wondering am i doing this right:

Code: [Select]
cam = new FlxCamera(0,19, FlxG.width, 400);
//all other code..
FlxG.cameras.pop(); // pop the default camera away
FlxG.addCamera(cam);

When i changed cam x and height i found this default camera, so i poped it out :)

Just curious ..i usually need only one camera, and still i always have this line: cam = new FlxCamera(0,0,FlxG.width,FlxG.height) in override create(). Does Flixel do the rendering for both cams?

6
help / 404, broken links with earlier forums posts
« on: Tue, Jul 26, 2011 »
There is lot of broken links in messages posted before new forumEngine.
If any admin have some time to run mysql query to fix this, it would be nice.

Tip to show the post behind broken url:

Take those numbers from the end of broken url (nothing but the numbers) and goto url:

http://forums.flixel.org/index.php/topic,
..and add those numbers after comma


Old, broken links looks like this: http://flixel.org/forums/index.php?topic=884.0
Correct link would be like this: http://forums.flixel.org/index.php/topic,884.0


7
help / FlxPath, drawing the line?
« on: Mon, Jul 18, 2011 »
Have anyone done anykind of drawline ..things based on FlxPath data?

I mean.. simply drawing the lines to screen :) Yes, i know its probably pretty simple, but i just havnt use to work with bitmapdata and that kind of things, so any code examples are wellcome.

8
help / Spritesheet and performance
« on: Sun, Jul 17, 2011 »
I have quite many images in spritesheet, and i was wondering with graf.designer if there was better way to handle those sheets and animations.

It would be great to separate images to multiple sheets.

Question is; is there big hit to performance with these kind of tricks:

1. in avatar class (extends FlxSprite)
switch (avatarAction)
 "walkAndShootLeft" -> loadGraphic(walkAndShootLeft)
 "walkAndShootTopLeft" -> loadGraphic(walkAndShootTopLeft)
 ..

2. in avatar class (extends FlxGroup)
avatar class (FlxSprite)

avatarWalkAndShootLeft (FlxSprite)
avatarWalkAndShootTopLeft (FlxSprite)
..
switch (avatarAction)
 "walkAndShootLeft" -> walkAndShootLeft visible (hide others)
 ...

Or is there better way to do this?


9
help / followPath and callback
« on: Fri, Jul 8, 2011 »
I couldnt find any callback for followPath. I need to calc new path after one is walked..

Should i try to add callback option, or is there any other (good) way to do this?

10
games / No Candyday!
« on: Fri, Jun 24, 2011 »
First Flixel based game:

AS3 (mostly) learned from tutorials:
http://gamedev.michaeljameswilliams.com/

Flixel (+ lot more) learned from tutorials:

http://www.photonstorm.com/

And finally:
http://www.flashgamelicense.com/view_game.php?from=dev&game_id=18826 (not sure.. you might need to login..?)

___________________________
FGL seems to have fan-accounts, so here is the link to login for ppl who doesnt have an account @fgl:

http://www.flashgamelicense.com/login.php?username=nocandyday

user: nocandyday
pass: nocandyday
___________________________




Pages: [1]