Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev #647

Merged
merged 13 commits into from
Sep 25, 2013
Merged

Dev #647

merged 13 commits into from
Sep 25, 2013

Conversation

larsiusprime
Copy link
Member

I fixed bugs in BitmapFrontEnd, added more features to tilemap, as well as added my simplified invisible button trim-down, "FlxClickArea"

@impaler
Copy link
Member

impaler commented Sep 24, 2013

@larsiusprime these are great additions, I think FlxClickArea and setCustomTileRemapStr are very usefull 👍 With the custom image index remapper could you provide a simple gist that we can test it with?

@Gama11
Copy link
Member

Gama11 commented Sep 24, 2013

@impaler I'm not so sure about the usefulness of FlxClickArea myself. Might be a little redundant considering we already have the MouseEventManager plugin in the core.

@larsiusprime
Copy link
Member Author

Well, FlxClickArea is a FlxObject that has no graphical representation, but still responds properly to things like cameras and scrolling, so you don't even need a FlxSprite. There's a lot of times where you need an invisible clickable area, but not necessarily a graphical object. Also, with a bit of refactoring, FlxButton could be made to extend it perhaps.

@larsiusprime
Copy link
Member Author

Also, @impaler how do I make a gist?

@gamedevsam
Copy link
Contributor

https://gist.github.com

@larsiusprime
Copy link
Member Author

Cool, incoming in a little bit.

@impaler
Copy link
Member

impaler commented Sep 25, 2013

@larsiusprime thanks, also do you think it is necessary to have in core, is it worthwhile putting this feature into a utility class? it does add quite a bit of code to an already huge class.

@Gama11 yes MouseEventManager plugin is great, however if you only need one or two of areas for a click event I suggest this is a cleaner way to do it without a plugin. Also its a good example of how things work, without the bloat of FlxButton. I made something similar to it before.

@gamedevsam
Copy link
Contributor

This pull request now contains conflicts with some changes that were recently made. Please make a pull request, resolve conflicts, and commit the fixed code.

@larsiusprime
Copy link
Member Author

Okay, I pulled latest flixel into my local repo, fixed the conflicts, then pushed to my repo. Also tried to address your comments. How 'bout now?

*/
public var customTileRemap:Array<Int> = null;

public var randomize_indeces:Array<Int> = null;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These randomize_* variables have no documentation, it's unclear what they are for, and how to use them.

@larsiusprime
Copy link
Member Author

Okay, hopefully this addresses those issues.

@larsiusprime
Copy link
Member Author

@impaler: This could easily just go in Flixel-ui instead of flixel-core, I just figured other people would like to have a simple, easy-to-use "invisible button that you can just click." If there's significant resistance to it I'll stuff it in flixel-ui.

}
}

if (randomize_indeces != null) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Brace style doesn't match the rest of the file.


public var randomize_seed:Int = 0; //custom random seed, if any
public var randomize_init:Int->Void = null; //custom random initializer function
public var randomize_lambda:Void->Float = null; //custom random function, returns 0->1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using this functionality is a bit complicated atm. First users need to know that they must prepare this data before calling loadMap. We should add a function to make using this easier. For example:

/*
* Documentation -> mention this needs to be called before loadMap()
*/
function prepareCustomTileMappings(mappings:Array<Int>, randomIndicies:Array<Int> = null, randomChoices<Array<Array<Int>> = null, randomLambda:Void->Float)
{
}

public var randomize_choices:Array<Array<Int>> = null;

public var randomize_seed:Int = 0; //custom random seed, if any
public var randomize_init:Int->Void = null; //custom random initializer function
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think randomize_init is not necessary within the engine. If users want to use a custom lambda function with a predetermined seed, they should prepare the data necessary to do this before calling loadMap.

@larsiusprime larsiusprime merged commit bfd876a into HaxeFlixel:dev Sep 25, 2013
@larsiusprime
Copy link
Member Author

Oops, I think I accidentally pushed this to flixel. Was it okay?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants