Endless Paradigm

Full Version: im a lier
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
you don't have to help me... Smokingg

but if you would that would be awesome Aha

I need some help with my code here:

Code:
--learn japanese
white = Color.new(255,255,255)

menu = Image.load("images/menu.png")
lesson1menu = Image.load("images/lesson1menu.png")
page1 = Image.load("images/lesson1/page1.png")
page2 = Image.load("images/lesson1/page2.png")
page3 = Image.load("images/lesson1/page3.png")
page4 = Image.load("images/lesson1/page4.png")
page5 = Image.load("images/lesson1/page5.png")
page6 = Image.load("images/lesson1/page6.png")
page7 = Image.load("images/lesson1/page7.png")
page8 = Image.load("images/lesson1/page8.png")
page9 = Image.load("images/lesson1/page9.png")
page10 = Image.load("images/lesson1/page10.png")
lessoncomplete = Image.load("images/lessoncompletedefault.png ")

menuon = true
page1 = false
page2 = false
page3 = false
page4 = false
page5 = false
page6 = false
page7 = false
page8 = false
page9 = false
page10 = false
lessondone = false

while true do
screen:clear(white)
pad = Controls.read()

if pad:cross() and menuon = true then
screen:clear(white)
page1 = true
end

--page1
if pad:r() and page1 = true then
screen:clear(white)
page1 = false
page2 = true
end

if pad:l() and page1 = true then
screen:clear(white)
page1 = true
page2 = false
end
--images
if page1 = true then
screen:blit(0,0,page1)
end

if page2 = true then
screen:blit(0,0,page2)
end

if pad:cross() and lessondone = "true" then dofile quiz1.lua() end
if pad:circle() and lessondone = "true" then dofile menu.lua() end

screen:blit(0,0,menu)
screen:blit(183,88,lesson 1menu)

screen.waitVblankStart()
screen.flip()
end


i keep getting the error line 35: 'then' expected near '=' help?

what my code says is, im at the menu, and if "X" is pressed show me page 1, and while im on page one if "R" is press show me page 2 but if "L" is pressed then send me back to page 1

haha, someone 'borrow' it, you don't know japanese!!! Ahaa j/k

This LUA or something?  Has some VB look-alike things...

Line 35:

Code:
if pad:cross() and menuon = true then

is that it?

Regardless, the message is saying a syntax error, so you might want to double check that your syntax is right.


---
Scanning over a LUA tutorial, it seems that it uses C style comparison operators - in other words, change the line to

Code:
if pad:cross() and menuon == true then

or

Code:
if pad:cross() and menuon then

Reference URL's