haxe - HaxeFlixel Puyo Puyo -


i've been wanting make block type game while have never understood how make one. have googled forever , there not , there comes stipulation not wanting bother (gpl license, entire code base, , license in project, bleh). took forums problem. did not know it, trying make puyo puyo type game. blocks dropping ceiling , clearing if there's match of 3 or more. had no idea on how matching. wanted know. nice, charming, , intelligent fellow provided me this:

http://hastebin.com/ziyejejoxu.js

granted, that's quite lot, way managed code allowed me grasp it. however, there single infuriating problem. one, one, line of code not compile , breaks. asked him if email him , said okay. haven't go response yet may not getting 1 i'm taking here. here how using code far. there 2 parts, play state, , puzzle piece:

http://pastebin.com/svmr9mmb

the program breaks in playstate, giving error:

source/playstate.hx:291: characters 33-52 : array access not allowed on x : int -> int

what have tried:

i had assumed not allowed because puzzle piece x float, , of course, can't push float int array. did in puzzle piece first, convert the float int. did not work. in state, switched float int. did not work. exercise, attempted convert flixel game haxeflixel see if learn anything. did wrong , did not.

so question is: why line not compile , need make compile or achieve it's intended purpose?

the syntax wrong. push function, , function calls use (). [] array access (hence error message).

this should work:

if (this_piece_is_in_a_match) matched_pieces.push(_i); 

Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

Rendering JButton to get the JCheckBox behavior in a JTable by using images does not update my table -