"+" and "-"
#1
"+" is not defined, currently (I believe). It can be used to add with ease, Instead of typing Vec2D:add or <variable>:add, they can use "+". It can also be used in math to make adding easier... AKA, save some time typing.
e.g.

[lua]while true do
eg = game.Environment
eg.Time = eg.Time + 1
wait(0.3)
end[/lua]


[lua]eg = game.World.TelePad2
function onTouched(hit)
if hit == "Body" then
hit.Position = eg.Position + 0.25
end[/lua]

Same thing for "-", will make subtraction easier.
All my mods are available here.
Reply
#2
hit.Position = Vec2D(eg.Position.x, eg.Position.y + 0.25)

Do this instead.
Reply
#3
(07-09-2011, 11:35 AM)AK-47 Wrote: hit.Position = Vec2D(eg.Position.x, eg.Position.y + 0.25)

Do this instead.

I didn't realize I made a mistake, lol. This was at like 2:00 AM, though. xD
All my mods are available here.
Reply
#4
Operator overloading would be useful...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)