+ 8
What does this code look like on android?
On my ipad particles fall on green water, where they slow down or even bounce. On the iphone, I see no water or deceleration. What does it do on android? I would be grateful for feedback as I cannot see it. On the pc i cannot tap. How can I make it look the same everywhere? https://code.sololearn.com/WLckKJThtQ2V/?ref=app
29 Respostas
+ 7
Feedback on android,
Deceleration on water good ✅
Weight simulation good (Big particle goes first) ✅
Particle bounce at bottom ✅
Particle left the trace behind ✅
I think its perfect in android sir!,
I wish I could be pro as you, I'm a new starter and I wanna be a good Front End Developer 😁
+ 3
Its stay forever on the screen sir, I provide you with the screenshot from my phone, here:
https://www.sololearn.com/post/459885/?ref=app
+ 3
Mirielle [INACTIVE] the particles should not fall straight because there is random wind. (Fast small ones should bounce against the water). Could the angle be explained by the wind? I will check my normalisation, as wrong water resistance in the x component could cause this. The coefficient to avoid division by zero might be inappropriate. Thanks for the feedback! (Would you know why the water is not green nor viscous on the iphone?)
+ 3
Mirielle [INACTIVE] Your version looks right on my phone too! So you put al the JS inside an onload {} . Is that always the right practice? Or was having two addEventListeners on the window? or was the window the wrong element to hang them to? I tried many things to get the screentouch to trigger instantiation before anything worked.
This has been really useful feedback, thank you!
+ 3
And the water / sky ratio makes sense now: before the area was too small for the number 0.65
+ 3
Bagus Arif Wicaksono I think you’re right. I use it on an android phone, a laptop, and 2 iPads and I think it’s all good.
+ 2
Bagus Arif Wicaksono Thank you so much, this is very helpful, gravity should act equally on all particles (after Galileo's experiment) but there is a randomly directed wind, which may lift more light particles when it goes upwards. Do the traces fade and disappear (as in ipad) or stay forever as on iphone (I wish I knew how ro make them go)?
+ 1
Code Crasher , Mirielle [INACTIVE] Thank you both. To make it work on a browser I should couple generation of particles to some other event, I only just found out how to use touch (so happy!). I commented my call to the wind-force method on line 127 and now particles plunge dead, no angle. It may be the residual direction with divisor approaching zero, but a slight angle is more alive. I will definitely look into brownian motion: I have some random acceleration in the code, to make slow particles look a bit hesitant (aim is to start from physics but make particles look alive) but it is turned off in this code.
Thank you for input about how to stop particles from going offscreen (trying it now), I have a strange effect I did not understand. I reset acceleration to zero adter each update so I thought I had solved it. When two particles collide, only one survives, can it be this?
+ 1
Mirielle [INACTIVE] thanks for the picture! Would that not be the right physics? Particles hit the water with an angle from the windf, friction depends on squared velocity, which is much higher along gravity y than tiny wind x. Thus, the angle should increase? If the magnitude is wrong, I must have been too coarse fudging the normalisation to avoid zero division.
+ 1
Code Crasher thank you! It really is fun to pull at the strings. You should have a look at the book of Daniel Shiffman I got the ideas from: The Nature of code, it is free and easy to follow because one can choose ar every point how much complexity to include. Besides, maths and physics are kept really simple.
+ 1
ManUnitedMVM thank you, it is good now thanks to all the feedback and help in this thread to make the code cross platform. Thank you also for your valuable confirmation.
+ 1
Little tip: If you have a computer, you can install an Android emulator and test it for yourself.
Anyway to answer your question, everything looks good to me.
+ 1
ReimarPB Thank you for checking! How can I run it on my computer when the code is started by touching the screen? Is the access from mouse equivalent to the touch?
+ 1
bell Yes, on Android emulators you can click the mouse and it will touch the screen there. You can also swipe by dragging your mouse.
+ 1
It's extremely beautiful on Android
When tapped a ball of random colors appears and disappears gradually when at the bottom.
The ball ie water ball leaves traces of water colours
I love your program it's of fun!!!
Happy coding😘
+ 1
Very creative
+ 1
By the way, I have noticed that you are using ES6. Some older Android devices do not support that and on them, there will only be a white screen. Nothing you should worry too much about though.
0
Mosunmola Alagbada thank you! it looks well on every platform now thanks to feedback and help!
0
ReimarPB thank you! I will check out how old that would be.
0
How to prepare for make a android developer please suggest me