-
here i rewrote your code,,
some problems you had were, white was actually black, and you mixed up the up/down, and left/right posistios,,
i didnt fix the positions, so its cluttered a bit,, ill let you fix that
Code:
green = Color.new(0, 255, 0)
black = Color.new(0, 0, 0)
red = Color.new(255, 0, 0)
blue = Color.new(0, 0, 255)
white = Color.new(255, 255, 255)
-- Questions 1
questionOne = "Who hit the most homeruns ever?"
--answers 1
answerOne = "down = Babe Ruth"
answerTwo = "right = Hank Aaron"
answerThree = "left = Barry Bond"
answerFour = "up = Sammy Sosa"
--****Main Loop****
while true do
screen:clear()
pad = Controls.read()
screen:print(100, 100, questionOne, blue)
screen:print(150, 250, answerOne, white)
screen:print(150, 255, answerTwo, white)
screen:print(150, 260, answerThree, white)
screen:print(150, 265, answerFour, white)
if pad:down() then
screen:print(150, 100, "sorry, incorrect.", red)
end
if pad:right() then
screen:print(150, 100, "Your Correct!", green)
end
if pad:left() then
screen:print(150, 100, "sorry, incorrect.", red)
end
if pad:up() then
screen:print(150, 100, "sorry, incorrect.", red)
end
screen.flip()
screen.waitVblankStart()
end
-
thanks! i appreciate ur help! and with notepad++ how do u find out wat each color means that it highlights?
-
you go to language > style configerator(the last one) > then in language choose lua, and you will see what each colour means
-
ok :D, i know u have helped me a lot! but do u know how to stop it show u only get one try to answer it then u move on to the next question (once i have a new question, lol)!btw i appreciate all ur help!
-
can someone show me a code to move words pls? like there is a word Hello in the black screen and if i press Circle it will move right
it will really help
-
@bronxbomber92, im not sure how to do that,, at least not easily
@natan333 make some new varibles
letterPos = {}
letterPos.x = (starting point, x posistion)
letterPos.y = (starting point, y position)
then when you screen:print you do this,,
screen:print(letterPos.x, letterPos.y, "blaa", white)
then you do this
if pad:circle() then letterPos.x = letterPos.x + 2 end
if you wanted it to move left, change + to -,,
and if you wanted to move it up/down you subtract/add letterPos.y
-
d*m*, does any1 else know how to give only one chance to answer a question and either restart the game if they get it wrong or go on to the next question if they get it correct?
-
Code:
while true do
blue=Color.new(0,200,350)
screen:clear()
letterPos = {}
letterPosx = 200, 250
letterPosy = 100, 150
screen:print(letterPosx, letterPosy, "HELLO", blue)
pad = Controls.read()
if pad:circle() then letterPosx = letterPosx + 2 end
if pad:select() then
break
end
screen.flip()
screen.waitVblankStart()
end
whats wrong with this code? It dosent give no error but Circle dosent make it move =/
-
Get rid of the array and you should be set. and have only 1 value per variable
-
what do u mean by array ? and the 1 per variable you mean letterPosx + 2 to be + 1 or letterPosx = 200, 1 ?