haxeflixel / flixel-docs Goto Github PK
View Code? Open in Web Editor NEWDocumentation for HaxeFlixel
Documentation for HaxeFlixel
Spent a couple days struggling to animate a sprite that had multiple animations on multiple rows of an image. This should be documented that HaxeFlixel calculates the full spritesheet, starting from the top left of the image to the bottom right.
See e.g. aduros/flambe#259 and https://aduros.com/flambe/api/ for inspiration
Note: these are about the tutorial pages in the documentation.
<em>
and <strong>
tags. All lines declaring image or Ogmo map files are appearing as coin<strong>png
instead of coin__png
. The underscore in Coin.hx's finishKill()
function is also appearing this way. Random <br />
tags are also appearing sometimes, but this is far less confusing than missing underscores.FlxGroup
is imported for HUD.hx instead of FlxTypedGroup
, and the health graphic is not on the page as previous graphics were.changeEnemy()
is never added to Enemy.hx in the tutorial.On the Haxe documentation website, the entry for haxe.constaints.Constructible links to the import haxe.constraints which doesn't currently exist, causing a 404.
Hi,
not sure if you still use chxdoc,
but if you do I pushed it to haxelib and removed the install command,
so a haxelib run chxdoc -o docs_dev -f myproject.xml
is enough now.
On the topic of Spacing; should it mention something about blank lines? For example: Do use blank lines to group things that are related, or do similar things, like variable declarations. And, do not use blank lines if the previous/next line only contains a single opening/closing parenthesis etc.
When is it okay to omit parentheses in if-statements?
The following paragraph has a typo:
To compile to desktop and mobile targets, you have to make sure you have run their respective lime setup commands are completed, each are specified in the OpenFL platform docs.
It should probably read something like:
To compile to desktop and mobile targets, you have to make sure you have run the respective lime setup commands. Each are specified in the OpenFL platform docs.
In addition, it is not immediately obvious upon visiting the OpenFL pages exactly what commands are required. It may be worthwhile adding them in short on this page (I actually ended up running different commands to the ones specified on the OpenFL page, choosing to use "lime setup windows" etc. instead).
The steps in Part 11 of the tutorial have you download the completed OptionsState.hx
file. This file uses 2 assets that have not previously been mentioned in the tutorial: button.png
and select.wav
source/OptionsState.hx:45: characters 29-51 : Class<AssetPaths> has no field button__png
source/OptionsState.hx:46: characters 46-68 : Class<AssetPaths> has no field select__wav
source/OptionsState.hx:50: characters 27-49 : Class<AssetPaths> has no field button__png
source/OptionsState.hx:51: characters 44-66 : Class<AssetPaths> has no field select__wav
source/OptionsState.hx:73: characters 45-67 : Class<AssetPaths> has no field select__wav
source/OptionsState.hx:77: characters 40-62 : Class<AssetPaths> has no field select__wav
Build halted with errors.
A clever developer will go find these assets in the demo's assets folder on github (or an ambitious developer would make their own), but it should probably be addressed in the tutorial itself.
I read some quirks about it (like HaxeFlixel/flixel#2575). Also got some struggle with it by myself - asset file names started with a digit is not shown on AssepPaths
. Would be nice to have proper documentation, either as API docs or a page in handbook.
scale
Change the size of your sprite's graphic. NOTE: The hitbox is not automatically adjusted, use updateHitbox() for that (or setGraphicSize()). WARNING: With FlxG.renderBlit, scaling sprites decreases rendering performance by a factor of about x10!
setGraphicsSize()
Helper function to set the graphic's dimensions by using scale, allowing you to keep the current aspect ratio should one of the Integers be <= 0. It might make sense to call updateHitbox() afterwards!
From the description of scale
it sounds like setGraphicsSize()
will automatically update the hitbox, which it maybe doesn't ("It might make sense to call updateHitbox() afterwards!") according to the description of setGraphicsSize()
.
It is most likely that the issue lies in setGraphicsSize()
's description, and it should be clarified. Why does it might make sense to call updateHitbox()
afterwards? Does it update hitbox or not? If it doesn't, then scale
should also be fixed as it implies that setGraphicsSize()
does update the hitbox.
FlxSprite does not contain drawRect.
flixel version: 4.7.0
Krita is a very handy raster based painting program, I feel it should be mentioned in here http://haxeflixel.com/documentation/game-development-tools/
It is to Corel Painter what Gimp is to Photoshop essentially, some artists even use it professionally.
Reading the handbook, I found out the FlxSprite
section is displaying the markdown's heading notation: ####
.
e.g. in the APIs I click outside the search box and then press the space bar to try to scroll the page. But somehow the web page has recaptured my mouse focus, making it on the text search field again, and the spacebar doesn't scroll it just inserts a space in there. this is driving me kind of utterly bat crazy.
ubuntu 14.04 lts intel/amd 64bit
firefox 50.1.0
on pages like e.g. http://api.haxeflixel.com/flixel/index.html
on ditto any keys at all?! apparently?! like page down, or down arrow?! :-(
Following the TurnBasedRPG tutorial, part 7 references width and height arguments that aren't yet provided by the template code:
It says to change the width and height, but for me the game constructor is called like so: new FlxGame(0, 0, MenuState)
. That's how it was when I called flixel tpl
to get started (after changing PlayState to MenuState). So that line in the tutorial is a little confusing. It should either say to add arguments for width and height, or to edit the width and height arguments in Project.xml.
There's a dead link in this tutorial which takes you to the old Haxe Macro Manual page. http://haxeflixel.com/documentation/sprites-and-animation/
It should be
http://haxe.org/manual/macro.html
instead of
http://haxe.org/manual/macros
Chapter 10 of the tutorial points to Combat.hx where the code for the sound files is included before sound is discussed in Chapter 12. It produces errors when building.
A paragraph needs added to Chapter 10 to add Pointer.png to the asset/images path to prevent build errors also.
Currently we only have flash there, would be nice to have the remaining targets as well (html5, cpp, neko, android, ios...)
Part 4 - "Sprites and Animation" contains a slight error in the code.
In step 3, the code is supposed to "end with the player in their 'neutral' pose (legs together), that way each time we animate the player, it will return to the correct frame as soon as they stop animating"
However, that doesn't seem to be working. After moving, the animation always stops on the last frame where one leg is out. Maybe the player sprite got updated after the tutorial and the frames changed?
Either way, the solution is simply to move the first frame numbers in each array to the very end of the array, like this:
animation.add("lr", [4, 3, 5, 3], 6, false);
animation.add("u", [7, 6, 8, 6], 6, false);
animation.add("d", [1, 0, 2, 0], 6, false);
That way the animation sequence will end with the neutral pose.
Another solution I found online was to add the code below after if(up || down || left || right){
:
else if(animation.curAnim!=null)
{
animation.curAnim.curFrame = 0;
animation.curAnim.pause();
}
i am finding the search ux to be not useful for me personally. for me it would just be better if the search text field were a front for just doing a Google query restricted by "site:http://api.haxeflixel.com".
First tells to stop capitalising parameters and make use of "this", then in another section tells the opposite? which one is correct?
For example http://api.haxeflixel.com/flixel/util/FlxPoint.html#x - x
isn't visible.
We'd need to be able to specify a different source URL depending on the package. This is a dox limitation, it only supports one global source link (HaxeFoundation/dox#51).
In the Tutorial Chapter 12, step 8: the supplied code uses a variable called _halfWidth
we set the position of our sound to wherever our enemy is (to the bottom of his sprite - where his feet are), and then play the sound.
if ((velocity.x != 0 || velocity.y != 0) && touching == FlxObject.NONE) { _sndStep.setPosition(x + _halfWidth, y + height); _sndStep.play(); }
Using this code results in the following error:
source/Enemy.hx:70: characters 28-38 : Unknown identifier : _halfWidth
I'm not sure what was intended here, but there are a few options to correct is:
A. FlxSprite
has a variable called _halfSize
, which is set in resetFrameSize()
. I'm not sure if this is the intended use though.
B. In my Enemy
class, I declared a Float called _halfWidth
and set it in the constructor function: _halfWidth = width * 0.5;
C. In the demo source code, this is calculated each frame when making the call to setPositon: _sndStep.setPosition(x + frameWidth / 2, y + height);
I would like someone to weigh in on the "best approach" here.
Just a few things that were missing in the tutorial but were shown in the source.
http://haxeflixel.com/documentation/part-ix-ui-and-combat/
At stage 4 there is nothing saying about the _checkEnemyVision()_ function needing to have the for loop inside of it.
Nowhere did it say to add _using flixel.util.FlxSpriteUtil;_ to the top of the _PlayState_ or _Enemy_ classes so that flickering could work.
Related to my other issue here the current tutorial for HaxeFlixel still uses Ogmo 2. With the release of (Ogmo 3)[https://ogmo-editor-3.github.io/] we ought to update the tutorial to teach the updated workflow of Ogmo 3, including working with JSON as opposed to XML.
The following two pages are specifically the ones in question:
https://haxeflixel.com/documentation/creating-a-tilemap/
https://haxeflixel.com/documentation/loading-the-tilemap/
Parsing ls is considered a shell scripting anti-pattern. It's recommended by most advanced shell scripters to use the find command instead.
http://haxeflixel.com/documentation/cheat-sheet/
The cheat sheet is not up to date with flixel.
proposed changes here master...Alvalol:patch-1
Part 3 - "Groundwork" of the Tutorial
Last steps, #6 and #7
While following the tutorial, I couldn't quite understand on step 7 if I was supposed to put the directional moving code in the if statement
from step 6 or not.
I assumed at first that would be the case, but step 7 starts with "After that", so I thought the if statement would be saved for later and step 7 code should follow after the if statement. The correct code was to put step 7 code inside step 6 if statement (after seeing the source code).
Would love to see this clarified better for n00bs like me :)
Also, the directional moving angle code could need some good explanation as it felt like a huge chunk of code that got little to no simple explanation to it. The drag
code could also need a better explanation, unless this gets covered later on in the tutorial.
In the tutorial on some of the pages the HTML tags are showing in the code examples.
http://haxeflixel.com/documentation/part-v-tiles-maps-and-collisions/
Shows " < strong > " and " < / strong > " instead of " __ ".
http://haxeflixel.com/documentation/part-viii-enemies-and-basic-ai/
Shows " < em > " and " < / em > " instead of multiply. Also shows " < br > ".
Working versions of dependencies should be written here.
A line like This build is best used with openfl 2.0.1 and lime 1.0.1
would be a great addition since actually, the latest of lime doesn't work, you can't know which version of lime you need to install to get HaxeFlixel working.
On section 11 of the Turn Based RPG Tutorial, Game Over Menu (http://haxeflixel.com/documentation/game-over-menu/), there is a reference to an inexistent code.
On line 7 of this file it says
- The first thing we want to do is stop our
CombatHUD
from stopping once the player has been defeated. So indoneResultsIn()
, remove theif (outcome != DEFEAT)
statement.
There's no such if (outcome != DEFEAT)
statement in CombatHUD.hx
.
Maybe the text is outadated and this existed in a previous version.
<assets path="assets/data" include="*.oel|*.oep" />
I don't get it why we may need "*.oep"
? It's a Ogmo Editor project file, and I don't think that FlxOgmoLoader
needs it.
http://haxeflixel.com/documentation/loading-the-tilemap/ I'm trying to get back into flixel I remember that this page was showing how to load a tilemap from tiled instead of whatever that program is. And the demo code seems to be to complex for this tutorial, there is any place where I can reach those docs?
Need to make sure that the correct / compatible OpenFL and Lime versions are installed at the end.
Gotta merge it again with our custom changes, there's been a nice amount of improvements recently.
In the tutorial, Part VIII: Enemies and Basic AI, there is a step left out where the following piece of code needs to be added to the Enemy class in order for them to update properly.
override public function update():Void
{
_brain.update();
super.update();
}
There is also a typo in the same page where
loadGraphic("assets/images/enemy-" + Std.string(etype) + ".png, true, 16, 16);
should read:
loadGraphic("assets/images/enemy-" + Std.string(etype) + ".png", true, 16, 16);
Also:
public var activeState:Void-<Void;
public function new(?InitState:Void-<Void):Void
{
activeState = InitState;
}
should be
public var activeState:Void->Void;
public function new(?InitState:Void->Void):Void
{
activeState = InitState;
}
Don't know if you guys already knew about these issues but just wanted to point them out. Anyway, great tutorial!
here
Question is, how exactly?
I feel like the list should be split into a few pages:
I'm not sure about the numbering order yet, as things change quite quickly around here.
Now, maybe you prefer the list to stay outside of the documents, or have a different structure for entries, or anything at all, I just want to make sure I'm sending the list in the best possible way.
There should be an image on this section, but the current link is broken.
http://haxeflixel.com/images/targets/neko-logo.jpg
The Tutorial Chapter 12 Sound and Music mentions a function called setupGame
.
we're going to make it start playing outside of our states when we setup our game. In the setupGame function, after our volume-setting code, add:
This function is not mentioned anywhere else in the Tutorial and I dont find it in the HaxeFlixel code either. I believe it was a helper function that was possibly used in a previous version of the Tutorial, but is no longer needed. Chapter 13 edits this same area of the code (see Step 4 there) and does not talk about a setupGame
function there.
The logo in the upper left is normally clickable and redirects to the frontpage.
system.input.touch
there's a FlxTouchButton
class which should not existFlxVirtualPad
, which should be in flixel.ui
, not flixel.system.input.touch
Also, for @:generic
functions and classes, different versions seem ot be generated, which looks quite ugly in the overview and might lead to confusion.
pitch
Pitch prop was added with HaxeFlixel/flixel#2564 .
Info like that found in HaxeFlixel/flixel#524 would be useful on the cheat sheet, given that googling "haxeflixel play sound" returns the cheat sheet as the top result currently. I.e. that for music, you need OGGs for everything but Flash, and MP3s of a very specific kind only on Flash (and you'll need a compiler directive); and that for sound effects you should use WAV for everything (although I thought I had read in an openfl thread recently, that even WAV isn't universally supported...I think in HTML5 renderers, or something...)
Also that you needn't name each sound asset in your project.xml just like you needn't name every image asset, that's helpful to know, but between the cheat sheet, HaxeFlixel's project.xml and the original openfl project.xml page, you would get the idea that sounds are somehow special and each one requires a line in your project.xml, unlike images, which can be automatically included all with one line.
Depending on your target platform and what sound format you first try, the above combination of factors can make for quite a hurdle for someone trying to get set up to play sounds in their game. (And while the demos are a good place to look--although I think it should be legit to google something as a starting point--they're also inconsistent. E.g. NeonVector has mp3's in its sounds assets directory...)
Currently the page: http://api.haxeflixel.com/flixel/system/frontEnds/VCRFrontEnd.html has only a couple of variables and methods described while there are clearly more of them in the source code: https://github.com/HaxeFlixel/flixel/blob/master/flixel/system/frontEnds/VCRFrontEnd.hx
Just a thought: may it be related to having other parts of API under FLX_RECORD
define?
Hi,
Following the tutorial with no access to a Windows machine, step 5 is blocking as it requires learner to create an Ogmo map to be loaded in the game. Yet Ogmo editor is a Windows only application.
It would be great to add link to a sample file for non-Windows users to be able to go through the complete tutorial.
Here is a link to part 5 of the tutorial for reference.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.