Update 'mid'
17
mid.md
17
mid.md
@@ -13,23 +13,14 @@ L'ultim valor a comparar.
|
||||
### Exemple
|
||||
```
|
||||
function init()
|
||||
setmode(2)
|
||||
x,y=10,7
|
||||
color(COLOR_YELLOW, COLOR_BLUE)
|
||||
setmode(1)
|
||||
end
|
||||
|
||||
function update()
|
||||
cls()
|
||||
if btn(KEY_UP) then
|
||||
y = max(0, y-1)
|
||||
elseif btn(KEY_DOWN) then
|
||||
y = min(y+1, 14)
|
||||
end
|
||||
if btn(KEY_LEFT) then
|
||||
x = max(0, x-1)
|
||||
elseif btn(KEY_RIGHT) then
|
||||
x = min(x+1, 19)
|
||||
end
|
||||
local x = mid(0,mousex(),39)
|
||||
local y = mid(0,mousey(),29)
|
||||
print(x..","..y, 0, 0)
|
||||
print("\224",x,y)
|
||||
end
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user