Need Help with a Game
Moderators: Shine, Insert_witty_name
Need Help with a Game
Hey, I am making an Asteriods clone, incase you don't know what that is, here http://www.getfrosty.com/Games/asteroids/asteroids.htm , and I am fairly new at lua. I am wondering how do I make the asteriods go across the screen at random times in random places and still going towards the middle of the screen to the player. I have the rest of the coding pretty much done and this will help me a ton, thanks!
look in the wiki for os.randomseed
math.random(number) for random entry points
manage all the rocks in a drawing function,
i did that and it works good.
so you spawn new rocks in a certain amount of time.
(math.mod(gametimer,refreshtime)==0 then bla)
only blit them if they are onscreen (x,y)
if X>playerX x=x-speed etc. for Y the same
resources:
http://www.lua.org/pil/21.2.html
http://www.evilmana.com/tutorials/lua_tutorial_list.php
http://psplua.com
cheers
math.random(number) for random entry points
manage all the rocks in a drawing function,
i did that and it works good.
so you spawn new rocks in a certain amount of time.
(math.mod(gametimer,refreshtime)==0 then bla)
only blit them if they are onscreen (x,y)
if X>playerX x=x-speed etc. for Y the same
resources:
http://www.lua.org/pil/21.2.html
http://www.evilmana.com/tutorials/lua_tutorial_list.php
http://psplua.com
cheers