Quick Links: Download Gideros Studio | Gideros Documentation | Gideros community chat | DONATE
Random values not working — Gideros Forum

Random values not working

ZizanymanZizanyman Member
edited November 2014 in General questions
In my game, a flat wall is (supposed to be) generated randomly on app start. I got the flat wall part figured out #:-S but it generates the same coordinates every time. :-? The code I used to generate the random coordinates is:

realx = math.random (0, screenW)
realy = math.random (0, screenH)

I call the function to create the wall in the scene:init function, and that is the same function where I create the random values realx and realy. The code for calling my function that creates the wall (scene:wall) is below:

self:wall(realx,realy)

My complete project is attached if there is any code you need to look at that I didn't show in my question. Thanks! :D

Comments

Sign In or Register to comment.