Note that there are some explanatory texts on larger screens.

plurals
  1. POStyle sheet is not working as supposed to
    primarykey
    data
    text
    <p>I`m new to Flixel , so please forgive me if my question is too simple. </p> <p>My question is: i made four very simple images(stand, move, side stand, side move) using Photoshop then passed it to Texture Packer(A style sheet maker) it produced me an image(it`s extremely simple) plus a JSON file, here it is:<br> <a href="http://i.stack.imgur.com/UTi4G.png" rel="nofollow">http://i.stack.imgur.com/UTi4G.png</a><br> So i wanted to use them with Flixel as a character that is standing(first one) and when i call the animation move it will use the last image but it did not work as expected. basically it shows all of the four images at once.<br> here's the code:<br> Character.as: </p> <pre><code>package { import org.flixel.FlxSprite; public class Character extends FlxSprite { [Embed (source="character.png")] private var CharacterGraphic:Class; public function Character(X:Number=0, Y:Number=0) { super(X, Y); loadGraphic(CharacterGraphic, true, false, 53, 54); velocity.y = 100; addAnimation('move_forward', [0, 3], 30, false); } } } </code></pre> <p>PlayState class(Where I create an instance of this class)</p> <pre><code> override public function create():void{ character = new Character(100, 200); add(character); } override public function update():void{ //for debugging if(character.y == 600){ character.play('move_forward'); } super.update(); } </code></pre> <p>So i expected:<br> the first image to be popped(and keep going down)when the velocity.y is 600(Just for testing) the move_forward animation starts(looping through first and last image)</p> <p>And the output is:<br> All of the four images popped up, and when the velocity.y == 60 nothing happens. </p> <p>I really think I'm missing something, since I`m very new to Actionscript 3 and Flixel(Also game development!). </p> <p>Almost the same steps worked for online tutorial only difference is that he created a couple of animations(enemies) instead of one, check it here <a href="http://gotoandlearn.com/play.php?id=139" rel="nofollow">http://gotoandlearn.com/play.php?id=139</a><br> For the JSON file, I never found a use for it(I tried asking in IRC channels but nobody mention it), also in forums/tutorials.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload