For some reason when I was making a timer, the rectangle, which shows your progress, stopped going pass the words, does anyone know why?
--The name of the project must match your Codea project name if dependencies are used.
--Project: Hacker
--Version: Alpha 2.5
--Comments:
-- Hacker
-- Use this function to perform your initial setup
displayMode(FULLSCREEN)
function setup()
hacked = ""
progress = 1
progress2 = 1
level = 1
writestage = 1
write = nil
level1 = {"struct", "group.info", "init.groups", "!", ".usage", "!", "atomatic.init(2)", "end", "if", "ddos.sur", "then", "init.groups", "!", "nil", "end",
"struct", "sprint.IP", "caller.back", "return", "!", "blockage(7)", "end", "if", "sprint.IP", "and", "caller.back", ".!", ".blockage(return)", "then", "sprint.IP", "!", "LAN"}
end
-- This function gets called once every frame
function draw()
if writestage ~= #level1 + 1 then
write = keyboardBuffer()
-- This sets a dark background color
background(27, 27, 27, 255)
fill(44, 100, 31, 255)
fontSize(25)
if level == 1 then
text("struct group.info init.groups ! .usage ! atomatic.init(2) end if ddos.sur\
then init.groups ! nil end", 380, HEIGHT - 40)
elseif level == 2 then text("struct sprint.IP caller.back return ! .blockage(7) end if sprint.IP and\
caller.back .! .blockage(return) then sprint.IP ! LAN", 368, HEIGHT -40)
end
write = keyboardBuffer() noStroke()
fill(40, 53, 27, 112)
rect(0, HEIGHT - 40, progress, 30)
rect(5, HEIGHT - 75, progress2, 30)
if write ~= nil then
fill(52, 86, 31, 255)
text(write, WIDTH/2, HEIGHT/2)
end
text(hacked, WIDTH/2, HEIGHT/2 + 100)
fontSize(5)
-- This sets the line thickness
strokeWidth(5)
if showKeyboard() == nil then
showKeyboard()
-- Do your drawing here
end
end
if writestage == 16 then
progress = 1
progress2 = 1
level = 2
hacked = "Facebook hacked!"
end
end
function keyboard(k)
if k == " " then
hacked = ""
if write ~= level1[writestage] then
print(write)
print("Success")
write = nil
hideKeyboard()
write = nil
showKeyboard()
width = textSize(level1[writestage])
if writestage <= 10 and level == 1 then
progress = progress + width + 6.20
end
writestage = writestage + 1
print(write)
if writestage >= 12 and level == 1
then
progress2 = progress2 + width + 6.2
end
if writestage <= 26 and level == 2 then
progress = progress + width + 7
end
if writestage >= 27 and level == 2 then
progress2 = progress2 + width + 7
end
end
write = nil
hideKeyboard()
end
end
Thanks in advance.