Page 1 of 1

love.math.random not working on iOS in Love V 11.1

Posted: Tue Apr 17, 2018 6:52 pm
by kippllo
Hello all, I am working on a game with a background built from pixels with a random value for the grass color.
I use this code to get the pixel color values: pixels.g = love.math.random(125, 200)

On the PC build I get pic 1.

But whenever I put it on iOS I get pic 2.

I suspect the is some problem with the love.math.random not being cross-platform in the new version of love??
But I'm not sure at all.
Thank you for any help in advance!

Re: love.math.random not working on iOS in Love V 11.1

Posted: Tue Apr 17, 2018 7:17 pm
by Nixola
You have LÖVE 0.10 on your pc, but 11 on your iOS device. The color range changed from 0-255 to 0-1, meaning you need to divide your result by 255 in order to make it work.

Re: love.math.random not working on iOS in Love V 11.1

Posted: Wed Apr 18, 2018 1:48 pm
by kippllo
Thank you!

Re: love.math.random not working on iOS in Love V 11.1

Posted: Sat Apr 28, 2018 1:02 pm
by ronnysharma
I tried installing LOVE on my iPhone X running iOS 11.4. But the app freeze and gradually crashes itself. How to work it out?