Git Product home page Git Product logo

flixel-docs's People

Contributors

01010111 avatar al-arz avatar andreiregiani avatar banach-tarski avatar bardic avatar bneutral avatar brettchalupa avatar doppp avatar fabtjar avatar gama11 avatar gamedevsam avatar geokureli avatar greenlightning avatar hasufel avatar impaler avatar jefepapaya avatar kevinresol avatar kosnire avatar larsiusprime avatar mrcdk avatar nbumgardner avatar ninjamuffin99 avatar notboring avatar nqnstudios avatar riverheart avatar seifertim avatar sergiob avatar sruloart avatar starry-abyss avatar sunflat avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

flixel-docs's Issues

Animation requires better explanation

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.

Various issues

Note: these are about the tutorial pages in the documentation.

  • Underscores are appearing as <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.
  • In part IX, 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.

chxdoc

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.

Two things on coding style

  1. 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.

  2. When is it okay to omit parentheses in if-statements?

Install Flixel - Typo and further info could be added

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).

Tutorial Part 11: Missing assets referenced in OptionsState class

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.

AssetPaths documentation

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.

  • How to add api docs? Edit a template file ?
  • Then how to add such changes to api.haxeflixel.com ?

flixel.FlxSprite:scale and flixel.FlxSprite:setGraphicsSize() vague descriptions

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.

please stop stealing focus

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?! :-(

Tutorial pt. 7 references missing arguments

Following the TurnBasedRPG tutorial, part 7 references width and height arguments that aren't yet provided by the template code:

here

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.

API docs target dropdown

Currently we only have flash there, would be nice to have the remaining targets as well (html5, cpp, neko, android, ios...)

Tutorial Pt. 4 contains sprite animation error

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();
}

Tutorial Chapter 12: Enemy has no variable "_halfWidth"

Description

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

Analysis

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.

Tutorial missing information

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.

Tutorial Pt. 3 "Groundwork" needs small clarification

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.

Install section improvement

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.

Reference to inexistent code in HaxeFlixel Tutorial

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

  1. The first thing we want to do is stop our CombatHUD from stopping once the player has been defeated. So in doneResultsIn(), remove the if (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.

Missing instruction and typos in tutorial Part VIII

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!

Adding the external-resources list to flixel-docs

here
Question is, how exactly?
I feel like the list should be split into a few pages:


  • native-extensions.md will be replaced with all the native entries, and maybe someday, the explanations that I intended to add about how to make and use them.
  • There will be a new external-services.md that will hold the services entries.
  • There will be a new games-sources.md that will hold the games-sources entries.
  • There will be a new flixel-extensions.md that will hold the non-formal Flixel libraries entries.

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.

Tutorial Chapter 12 mentions setupGame function

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.

API docs are partly innaccurate

  • in system.input.touch there's a FlxTouchButton class which should not exist
  • FlxVirtualPad, 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.

Better sound doc on cheat sheet

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...)

[Enhancement] Add a Ogmo editor sample file to tutorial

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.