- Jun 6, 2020
- 11,559
- 4,422
برای دیدن تصاویر باید ثبت نام کنید
The main challenge here is the performance. All particles are updated if needed and redrawn every cycle.
The Particles array stores the state of all "game pixels". A value of 0 means that the pixel is empty. Other values mean that there is a particle on that pixel.
Sand particles move down or diagonally if they can.
The RowsState array tracks the rows that are considered dirty. Non-dirty rows are skipped.
Single dimension arrays of bytes can be accessed in an optimized way in B4i with Bit.FastArrayGet / Set methods (
برای دیدن لینک ها باید ثبت نام کنید
). I used these methods in some of the cases.All the important code is implemented in the Game class, which is of course shared between the three projects. No sprites are used in this game. The drawings are done in the MoveParticles sub.
As in the
برای دیدن لینک ها باید ثبت نام کنید
the layout is managed with the designer script.You need to...
برای دیدن لینک ها باید ثبت نام کنید
برای دیدن لینک ها باید ثبت نام کنید