- Jun 6, 2020
- 11,559
- 4,422
Hi,
I'm trying out a few things on the Falling Sand Game @ the below link & cannot figure out how to change the Gravity. @Erel had updated the code with a switch to change the gravity, but I would like to change the gravity according to the output from the TYPE_ACCELEROMETER phone sensor so it will move the objects. Is there a way of changing the gravity incrementally?
I've already got the readings from the accelerometer to get the right direction details, I just need the gravity to change accordingly & it is baffling me.
Any help at all will be well received. Cheers.
[H3]
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...
Gravity:
I'm trying out a few things on the Falling Sand Game @ the below link & cannot figure out how to change the Gravity. @Erel had updated the code with a switch to change the gravity, but I would like to change the gravity according to the output from the TYPE_ACCELEROMETER phone sensor so it will move the objects. Is there a way of changing the gravity incrementally?
I've already got the readings from the accelerometer to get the right direction details, I just need the gravity to change accordingly & it is baffling me.
Any help at all will be well received. Cheers.
[H3]
برای دیدن لینک ها باید ثبت نام کنید
[/H3]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...
برای دیدن تصاویر باید ثبت نام کنید
برای دیدن لینک ها باید ثبت نام کنید
Gravity:
کد:
محتوای بلوک کدها در دسترس شما نیست. برای مشاهده بلوک کدها، وارد انجمن شوید یاثبت نام کنید
برای دیدن لینک ها باید ثبت نام کنید
برای دیدن لینک ها باید ثبت نام کنید