Hundreds of features to explore
Games made in Construct
Your questions answered
Trusted by schools and universities worldwide
Free education resources to use in the classroom
Students do not need accounts with us
What we believe
We are in this together
World class complete documentation
Official and community submitted guides
Learn and share with other game developers
Upload and play games from the Construct community
Game development stories & opinions
I have data in array scattered but I want them something like this.
How can I get this
can you explain it How its working?
btw y axis also need to sort, On y1 there is no data So shift data of y2 to y1
Develop games in your browser. Powerful, performant & highly capable.
Well. English is not my main language. But i'll try to explain. I performed a two step process. First step (the one i posted earlier) is just using built-in sort function. This function only works one dimensional. So you need a loop for every row (or column if you prefer). Sort function only work from small to large. So an extra reverse is needed. Second step is shifting. With a help of a loop, first i found empty rows (i named it starting row). And with another loop i found filled rows (i named it target row). I copied target row to starting row. And then i give 0 to target row