Lua Player WiKi
Moderators: Shine, Insert_witty_name
Lua Player WiKi
I've created an entry in the ps2dev Wiki for Lua Player (follow the Lua Player link) :
http://wiki.ps2dev.org/
Everybody can edit it, after registering at the Wiki system. Maybe this is useful for not to forget important things in a stream of forum posts and to collect other important information about Lua Player, game projects etc.
http://wiki.ps2dev.org/
Everybody can edit it, after registering at the Wiki system. Maybe this is useful for not to forget important things in a stream of forum posts and to collect other important information about Lua Player, game projects etc.
here is an tutorial how to edit wiki
-
- Posts: 17
- Joined: Mon Oct 03, 2005 5:00 am
over the years i have made lots of scripts for game dev. i ported over one of the most useful functions ever. here it is, i hope someone could put it in the wiki (i cant be bothered to learn how)
by the way, what is the square root function in lua?
Code: Select all
-- you need to set pi as a global variable = to pi
function point_direction(x1,y1,x2,y2)
_x = x2 - x1
_y = y1 - y2
if _x == 0 then
if _y == 0 then
return 0
end
if _y > 0 then
return 90
end
if _y < 0 then
return 270
end
end
_i = math.abs(_x) + math.abs(_y)
_x = _x / _i
_y = _y / _i
rd = math.atan(_y/_x)
if _x <0 then
rd = rd + pi
end
if _x > 0 and _y < 0 then
rd = 2*pi + rd
end
return rd * 180 / pi
end
Last edited by jimjamjahaa on Fri Oct 07, 2005 6:14 am, edited 2 times in total.
google says what i expected it to say... math.sqrt()
-
- Posts: 17
- Joined: Mon Oct 03, 2005 5:00 am
http://lua-users.org/wiki/MathLibraryTutorialjimjamjahaa wrote:where do you find documentation on the math library. on the official lua site it didnt go over it in any detail
If you goodle the site, use the following and you'll find what you want.
site:http://lua-users.org/wiki/ math
or use any other searching word(s) you want in the place of "math".
site:http://lua-users.org/wiki/ math
or use any other searching word(s) you want in the place of "math".
Geo Massar
Retired Engineer
Retired Engineer
I've added the tutorial to the Wiki, feel free to enhance it like you want, I think it needs some more explanations for example for the Pac Man game and maybe you want to fix my grammar, spelling and bad English erros, which I'm sure are in the text. I've deleted JoshDB's code, because it was nearly the same as the sample in the tutorial for the analog pad. And don't forget to use the nice
Code: Select all
feature for syntax highlighting Lua code :-)