Seite 57 von 342 ErsteErste ... 7 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 107 157 ... LetzteLetzte
Zeige Ergebnis 1.681 bis 1.710 von 10238

Lua Programming Help Thread

This is a discussion on Lua Programming Help Thread within the PSP Development Forum forums, part of the PSP Development, Hacks, and Homebrew category; It's ok now, I've got it working like this... PHP-Code: --  Defining colors  -- green  =  Color .new( 0 , 255 ...

  
  1. #1681
    Points: 4.172, Level: 41
    Level completed: 11%, Points required for next Level: 178
    Overall activity: 0%

    Registriert seit
    Jan 2006
    Beiträge
    7
    Points
    4.172
    Level
    41
    Downloads
    0
    Uploads
    0

    Standard

    It's ok now, I've got it working like this...

    PHP-Code:
    -- Defining colors --
    green Color.new(0,255,0)
    ball1 Image.load("ball1.png")
    ball2 Image.load("ball2.png")
    ball3 Image.load("ball3.png")

    -- 
    Math --
    pi 4*math.atan(1)

    -- 
    Defining tables --
    ball = {}
    ball[1] = {ball ball12020speed 5000angle pi/8}
    ball[2] = {ball ball24060speed 5000angle pi/8}
    ball[3] = {ball ball360100speed 5000angle pi/8}

    -- 
    Functions --
    function 
    move()
      for 
    k in pairs(ball) do
        
    screen:blit(ball[k].xball[k].yball[k].balltrue)
        
    ball[k].ball[k].ball[k].speed
        ball
    [k].ball[k].ball[k].speed
      end
    end

    function moving()
    for 
    k in pairs(ball) do
      
    ball[k].speed 500
      
    if >= 0 then
        
    if ball[k].<= or ball[k].>= 460 then
          ball
    [k].angle pi ball[k].angle
        end
        
    if ball[k].<= or ball[k].>= 252 then
          ball
    [k].angle ball[k].angle * (-1)
        
    end
        ball
    [k].ball[k].math.cos(ball[k].angle) * a
        ball
    [k].ball[k].math.sin(ball[k].angle) * a
        ball
    [k].speed ball[k].speed 10
      end
      screen
    :blit(ball[k].x,ball[k].y,ball[k].ball,true)
    end
    end

    while true do
      
    screen:clear()
      
    moving()
      
      
    screen.waitVblankStart()
      
    screen.flip()
    end 
    Thanks...



  2. #1682
    QJ Gamer Green
    Points: 5.559, Level: 48
    Level completed: 5%, Points required for next Level: 191
    Overall activity: 0%

    Registriert seit
    Jan 2006
    Beiträge
    506
    Points
    5.559
    Level
    48
    Downloads
    0
    Uploads
    0

    Standard

    well i didn't do that much hehe but you're welcome!
    LUA manual:
    [url]http://www.lua.org/manual/5.0/manual.html[/url]

    LUA Wiki:
    [url]http://wiki.ps2dev.org/psp:lua_player[/url]

  3. #1683
    Developer
    Points: 7.499, Level: 57
    Level completed: 75%, Points required for next Level: 51
    Overall activity: 0%

    Registriert seit
    Mar 2006
    Ort
    Guadalajara
    Beiträge
    958
    Points
    7.499
    Level
    57
    Downloads
    0
    Uploads
    0

    Standard

    can I play 2 sounds at the same time?? if there is a way post it please!!!

    Current projects:
    • pspshootoutsv0.4
    • PSPIRATESv6 :D
    • Kindom Hearths: Sora´s Adventure V0.2
    • PSPirates Alarm Clock v0.3
    • Changos!: fall of the army-ITS ALIVE AND WORKING (coming soon)

    PSPMEX DevTeam.

  4. #1684
    11th Squad Captain
    Points: 26.490, Level: 97
    Level completed: 14%, Points required for next Level: 860
    Overall activity: 0%

    Registriert seit
    Jun 2005
    Ort
    You are here -----> 名前: アダム | 飲むコー&#1
    Beiträge
    2.562
    Points
    26.490
    Level
    97
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von MEXICANSNAKE
    can I play 2 sounds at the same time?? if there is a way post it please!!!
    Yes, You Can.
    FAVORITE GAME! - BEER & ANIME! - SO EXICTING!

    開発者, 携帯用プログラマー 日本サポータおよび恋人 本名のアダムの鍛冶屋
    Currently Working On: - Flashmod V2.50 - Flashmod V2.60
    Currently Drinking: Coffee! - 私はコーヒーを飲む
    Chao Garden: DEMO v0.6
    Chao Garden V0.5b Review!

  5. #1685
    Jesus loves me more.
    Points: 11.452, Level: 70
    Level completed: 51%, Points required for next Level: 198
    Overall activity: 0%

    Registriert seit
    Mar 2006
    Ort
    Illegal Abric Sites
    Beiträge
    1.551
    Points
    11.452
    Level
    70
    Downloads
    0
    Uploads
    0

    Standard

    How would i get it to sellect somthing in a list randomly? and if i have it load a txt would it see the info in hte txt as whats in it ex.: Viat(is the first line in the txt) i have it load Viat.txt and the value for tthe Viat.txt would be Viat?


  6. #1686
    Your Fate is Grim...
    Points: 11.640, Level: 70
    Level completed: 98%, Points required for next Level: 10
    Overall activity: 0%

    Registriert seit
    Oct 2005
    Beiträge
    2.269
    Points
    11.640
    Level
    70
    Downloads
    0
    Uploads
    0

    Standard

    can anyone help me pls??
    --------------------------------------------------------------------------------------

  7. #1687
    is not posting very often
    Points: 33.152, Level: 100
    Level completed: 0%, Points required for next Level: 0
    Overall activity: 99,6%

    Registriert seit
    Feb 2006
    Ort
    omnipresent
    Beiträge
    5.162
    Points
    33.152
    Level
    100
    Downloads
    0
    Uploads
    0

    Standard

    whats ur question grimfate?
    What did we think the world would look like in 2015?

    Zitat Zitat von Abe
    Either way, if you don't know, don't guess. Stick to answering questions about stuff you're qualified to answer, like Pokemon questions or something along those lines.
    http://forums.qj.net/501501-post26.html

  8. #1688
    Points: 24.247, Level: 94
    Level completed: 90%, Points required for next Level: 103
    Overall activity: 0%

    Registriert seit
    Jul 2005
    Ort
    texas
    Beiträge
    2.803
    Points
    24.247
    Level
    94
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von Grimfate126
    my code:

    Code:
    pad = Controls.read()
    dx = pad:analogX()
    dy = pad:analogY()
    
            if math.abs(dx) > 32 then
    		cursorx = cursorx + dx / 64
                              height = height +1
    	end
    	if math.abs(dy) > 32 then
    		cursory = cursory + dy / 64
            end

    how can i make it so that if the analog stik goes down, height decreases by 1?right now, if you go up or down, the height increases.
    Code:
    pad = Controls.read()
    dx = pad:analogX()
    dy = pad:analogY()
    
            if math.abs(dx) > 32 then
    		cursorx = cursorx + dx / 64
                              height = height + math.ceil(1/dx)
    	end
    	if math.abs(dy) > 32 then
    		cursory = cursory + dy / 64
            end
    The math.ceil function will make it return either 1 or -1 based on if dx is positive or negative.
    牧来栠摩琠敨映汩獥
    PSN: youresam
    From Earth the Frozen Ipaqs shall rise and be silenced and all will live free.
    --Mike Hollingsworth

  9. #1689
    Points: 4.621, Level: 43
    Level completed: 36%, Points required for next Level: 129
    Overall activity: 0%

    Registriert seit
    Aug 2005
    Beiträge
    28
    Points
    4.621
    Level
    43
    Downloads
    0
    Uploads
    0

    Standard

    I am having trouble with some random numbers. I have my code set up perfectly the way I want it and it works except that I get the same random numbers for different variables at times, which is not what I want. I have tried to counteract this by setting up kind of a checker system to detect like numbers in different variables and change them accordingly, however my efforts haven't succeded as of yet. I have an example of the type of code I am using and if anyone has any suggestions or now exactly whats up with it I will appreciate the advice/help.
    Code:
    function randomnumbers()
    	var1 = math.random(1,4)
    	var2 = math.random(1,4)
    	var3 = math.random(1,4)
    	var4 = math.random(1,4)
    
    	if var2 == var1 then
    		var2 = math.random(1,4)
    	end
    	if var2 == var3 then
    		var2 = math.random(1,4)
    	end
    	if var2 == var4 then
    		var2 = math.random(1,4)
    	end
    	if var3 == var1 then
    		var3 = math.random(1,4)
    	end
    	if var3 == var2 then
    		var3 = math.random(1,4)
    	end
    	if var3 == var4 then
    		var3 = math.random(1,4)
    	end
    	if var4 == var1 then
    		var4 = math.random(1,4)
    	end
    	if var4 == var2 then
    		var4 = math.random(1,4)
    	end
    	if var4 == var3 then
    		var4 = math.random(1,4)
    	end
    end

  10. #1690
    QJ Gamer Green
    Points: 5.559, Level: 48
    Level completed: 5%, Points required for next Level: 191
    Overall activity: 0%

    Registriert seit
    Jan 2006
    Beiträge
    506
    Points
    5.559
    Level
    48
    Downloads
    0
    Uploads
    0

    Standard

    Have you used "random.seed(os.time( ))"? Thats makes the random "truly" random.
    LUA manual:
    [url]http://www.lua.org/manual/5.0/manual.html[/url]

    LUA Wiki:
    [url]http://wiki.ps2dev.org/psp:lua_player[/url]

  11. #1691
    QJ Gamer Silver
    Points: 9.678, Level: 66
    Level completed: 7%, Points required for next Level: 372
    Overall activity: 0%

    Registriert seit
    Jun 2005
    Ort
    The Migrant Fleet
    Beiträge
    908
    Points
    9.678
    Level
    66
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von Grimfate126
    my code:

    Code:
    pad = Controls.read()
    dx = pad:analogX()
    dy = pad:analogY()
    
            if math.abs(dx) > 32 then
    		cursorx = cursorx + dx / 64
                              height = height +1
    	end
    	if math.abs(dy) > 32 then
    		cursory = cursory + dy / 64----- add height = height - 1
            height = height - 1
    end

    how can i make it so that if the analog stik goes down, height decreases by 1?right now, if you go up or down, the height increases.
    I think that's what your talking about

  12. #1692
    Simon Champion!
    Points: 11.489, Level: 70
    Level completed: 60%, Points required for next Level: 161
    Overall activity: 99,0%

    Registriert seit
    Mar 2006
    Ort
    Calgary, Alberta, Ca
    Beiträge
    537
    Points
    11.489
    Level
    70
    Downloads
    0
    Uploads
    0

    Standard

    okay, what is wrong with this?
    Code:
    yellow = Color.new(255, 255, 0)
    
    math.randomseed(os.time() )
    
    while true do
    number = math.random(1,4)
    if number == 1 then
    screen:print(0, 0, "Poo", yellow)
    end
    if number == 2 then
    screen:print(0, 0, "Monger", yellow)
    end
    if number == 3 then
    screen:print(0, 0, "Turd", yellow)
    end
    if number == 4 then
    screen:print(0, 0, "Face", yellow)
    end
    end
    I dont know how to make the randomization start...
    Games I Made:
    Stick Dance
    Stick Dance V2
    50% Done "Smile Quartet"


    MY XBOX.COM GAMER SPOTLIGHT!

  13. #1693
    QJ Gamer Blue
    Points: 5.631, Level: 48
    Level completed: 41%, Points required for next Level: 119
    Overall activity: 0%

    Registriert seit
    Jun 2005
    Beiträge
    375
    Points
    5.631
    Level
    48
    Downloads
    0
    Uploads
    0

    Standard

    the random should be fine

  14. #1694
    QJ Gamer Blue
    Points: 5.631, Level: 48
    Level completed: 41%, Points required for next Level: 119
    Overall activity: 0%

    Registriert seit
    Jun 2005
    Beiträge
    375
    Points
    5.631
    Level
    48
    Downloads
    0
    Uploads
    0

    Standard

    i just tested it and it does work

    forgot to hit edit.sorry for double post
    Geändert von soadnation (04-18-2006 um 07:00 PM Uhr)

  15. #1695
    Points: 4.621, Level: 43
    Level completed: 36%, Points required for next Level: 129
    Overall activity: 0%

    Registriert seit
    Aug 2005
    Beiträge
    28
    Points
    4.621
    Level
    43
    Downloads
    0
    Uploads
    0

    Standard

    I assume that the two previous posts were directed toward my question. Assuming so, that's not what I"m trying to do. I'm printing 4 random variables to the screen at one time and I don't want any of them to be the same as another. An example would be if you put each variable as equaling math.random(1,4) for all 4 variables to print to the screen it would print a random variable for each one put there is a chance you would get two 1's or two 2's or three 1's. I am trying to develop a system that would check if any of the variables are the same and repeat randomizing numbers until one is found that isn't already used.

  16. #1696
    QJ Gamer Green
    Points: 5.559, Level: 48
    Level completed: 5%, Points required for next Level: 191
    Overall activity: 0%

    Registriert seit
    Jan 2006
    Beiträge
    506
    Points
    5.559
    Level
    48
    Downloads
    0
    Uploads
    0

    Standard

    function randomnumbers()
    while true do
    var1 = math.random(1,4)
    var2 = math.random(1,4)
    var3 = math.random(1,4)
    var4 = math.random(1,4)

    if var2 == var1 then
    var2 = math.random(1,4)
    end
    if var2 == var3 then
    var2 = math.random(1,4)
    end
    if var2 == var4 then
    var2 = math.random(1,4)
    end
    if var3 == var1 then
    var3 = math.random(1,4)
    end
    if var3 == var4 then
    var3 = math.random(1,4)
    end
    if var4 == var1 then
    var4 = math.random(1,4)
    end

    if var1~=var2 and var2~=3 and var1~=var3 and var1~=var4 and var2~=4 and var3~=var4 then
    break
    end
    end
    LUA manual:
    [url]http://www.lua.org/manual/5.0/manual.html[/url]

    LUA Wiki:
    [url]http://wiki.ps2dev.org/psp:lua_player[/url]

  17. #1697
    Points: 4.133, Level: 40
    Level completed: 92%, Points required for next Level: 17
    Overall activity: 0%

    Registriert seit
    Apr 2006
    Ort
    Bay Area, California
    Beiträge
    26
    Points
    4.133
    Level
    40
    Downloads
    0
    Uploads
    0

    Standard

    I need help. I can get everything to work but the dPad.

    Code:
    --Basic Variables
    white = Color.new(255,255,255)
    titlePlay = Image.load("titlePlay.png")
    titleInfo = Image.load("titleInfo.png")
    titleExit = Image.load("titleExit.png")
    titleNumber = 1
    dPad = Controls.read()
    --Main Menu
    function mainMenu(titleNumber)
    	if titleNumber == 1 then
    		screen:blit(0,0,titlePlay)
    		screen:flip()
    	end
    	if titleNumber == 2 then
    		screen:blit(0,0,titleInfo)
    		screen:flip()
    	end
    	if titleNumber == 3 then
    		screen:blit(0,0,titleExit)
    		screen:flip()
    	end
    	if titleNumber < 1 or titleNumber > 3 then
    		screen:print(0,0,"error in titleNumber", white)
    		screen:flip()
    	end
    end
    
    --Main Menu D-Pad Controls
    if dPad:right then
    titleNumber = titleNumber + 1
    mainMenu(titleNumber)
    end
    
    --I Dont Know
    while true do
    screen.waitVblankStart()
    end

  18. #1698
    Points: 4.621, Level: 43
    Level completed: 36%, Points required for next Level: 129
    Overall activity: 0%

    Registriert seit
    Aug 2005
    Beiträge
    28
    Points
    4.621
    Level
    43
    Downloads
    0
    Uploads
    0

    Standard

    Disregaurd my question. I figured it out myself :icon_bigg .

  19. #1699
    QJ Gamer Green
    Points: 6.721, Level: 53
    Level completed: 86%, Points required for next Level: 29
    Overall activity: 0%

    Registriert seit
    Oct 2005
    Beiträge
    543
    Points
    6.721
    Level
    53
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von siqq
    I need help. I can get everything to work but the dPad.

    Code:
    --Basic Variables
    white = Color.new(255,255,255)
    titlePlay = Image.load("titlePlay.png")
    titleInfo = Image.load("titleInfo.png")
    titleExit = Image.load("titleExit.png")
    titleNumber = 1
    dPad = Controls.read()
    --Main Menu
    function mainMenu(titleNumber)
    	if titleNumber == 1 then
    		screen:blit(0,0,titlePlay)
    		screen:flip()
    	end
    	if titleNumber == 2 then
    		screen:blit(0,0,titleInfo)
    		screen:flip()
    	end
    	if titleNumber == 3 then
    		screen:blit(0,0,titleExit)
    		screen:flip()
    	end
    	if titleNumber < 1 or titleNumber > 3 then
    		screen:print(0,0,"error in titleNumber", white)
    		screen:flip()
    	end
    end
    
    --Main Menu D-Pad Controls
    if dPad:right then
    titleNumber = titleNumber + 1
    mainMenu(titleNumber)
    end
    
    --I Dont Know
    while true do
    screen.waitVblankStart()
    end
    Put everyting but the variable defines in the while true loop. Don't forget screen:clear()
    HELP ME HAIRY LEG!!!!

    I have a 1.5 (downgraded) US PSP
    [code]
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
    / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \
    ( P | S | P | - | P | r | o | g | r | a | m | m | i | n | g )
    \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/
    _ _ _ _ _
    / \ / \ / \ / \ / \
    ( A | d | m | i | n )
    \_/ \_/ \_/ \_/ \_/ [/code]

  20. #1700
    Points: 4.133, Level: 40
    Level completed: 92%, Points required for next Level: 17
    Overall activity: 0%

    Registriert seit
    Apr 2006
    Ort
    Bay Area, California
    Beiträge
    26
    Points
    4.133
    Level
    40
    Downloads
    0
    Uploads
    0

    Standard

    testing...

    [edit] It didnt work my code looks like this now.

    Code:
    --Basic Variables
    white = Color.new(255,255,255)
    titlePlay = Image.load("titlePlay.png")
    titleInfo = Image.load("titleInfo.png")
    titleExit = Image.load("titleExit.png")
    titleNumber = 1
    pad = Controls.read()
    
    while true do
    --Main Menu
    function mainMenu(titleNumber)
    	if titleNumber == 1 then
    		screen:clear()
    		screen:blit(0,0,titlePlay)
    		screen:flip()
    	end
    	if titleNumber == 2 then
    		screen:clear()
    		screen:blit(0,0,titleInfo)
    		screen:flip()
    	end
    	if titleNumber == 3 then
    		screen:clear()
    		screen:blit(0,0,titleExit)
    		screen:flip()
    	end
    	if titleNumber < 1 or titleNumber > 3 then
    		screen:clear()
    		screen:print(0,0,"error in titleNumber", white)
    		screen:flip()
    	end
    end
    
    --Main Menu D-Pad Controls
    if pad:right() and titleNumber < 3 then
    titleNumber = titleNumber + 1
    mainMenu(titleNumber)
    end
    if pad:left() and titleNumber > 1 then
    titleNumber = titleNumber - 1
    mainMenu(titleNumber)
    end
    end
    Geändert von siqq (04-19-2006 um 12:51 PM Uhr)

  21. #1701
    QJ Gamer Green
    Points: 6.721, Level: 53
    Level completed: 86%, Points required for next Level: 29
    Overall activity: 0%

    Registriert seit
    Oct 2005
    Beiträge
    543
    Points
    6.721
    Level
    53
    Downloads
    0
    Uploads
    0

    Standard

    whats the error?
    HELP ME HAIRY LEG!!!!

    I have a 1.5 (downgraded) US PSP
    [code]
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
    / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \
    ( P | S | P | - | P | r | o | g | r | a | m | m | i | n | g )
    \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/
    _ _ _ _ _
    / \ / \ / \ / \ / \
    ( A | d | m | i | n )
    \_/ \_/ \_/ \_/ \_/ [/code]

  22. #1702
    Points: 5.745, Level: 48
    Level completed: 98%, Points required for next Level: 5
    Overall activity: 0%

    Registriert seit
    Jul 2005
    Beiträge
    404
    Points
    5.745
    Level
    48
    Downloads
    0
    Uploads
    0

    Standard

    Hi guys. i just stared messing up with lua yesturday night
    and i m starting to love this

    I have a question though

    Code:
    blue = Color.new(0 , 153, 255)
    
    screen.waitVblankStart(50)
    screen:print(200, 100, "Hello!", blue)
    screen.flip(0)
    screen.waitVblankStart(50)
    screen.flip(0)
    screen.waitVblankStart(50)
    screen.flip(0)
    screen.waitVblankStart(50)
    screen.flip(0)
    screen.waitVblankStart(50)
    screen.flip(0)
    screen.waitVblankStart(50)
    screen.flip(0)
    screen.waitVblankStart(50)
    screen.flip(0)
    
    while true do
    screen.waitVblankStart()
    end
    To make the word blink again and again nonstop i have to copy screen.waitVblankStart(50 )
    screen.flip(0)
    and make a long list ?? or is there is a code to make it repeat blinking for ever?

    I also have some questions
    there is a site that i got here from sam that have codes like this for an example but cant figure out
    http://wiki.ps2dev.org/psp:lua_player:functions is the site
    Code:
    Font Font:setCharSize(number width, number height, number dpiX, number dpiY)
    Code:
    image:clear([color = transparent-black])
    where do i put the numbers ? please post an example with the numbers filled in so i can learn

    Thanks!
    Geändert von natan333 (04-19-2006 um 01:09 PM Uhr)
    Bequiet!!!
    I'm learning cc©cc

  23. #1703
    QJ Gamer Green
    Points: 6.721, Level: 53
    Level completed: 86%, Points required for next Level: 29
    Overall activity: 0%

    Registriert seit
    Oct 2005
    Beiträge
    543
    Points
    6.721
    Level
    53
    Downloads
    0
    Uploads
    0

    Standard

    Code:
    blue=Color.new(0,153,225)
    while true do
    screen:clear()
    for i=1,50 do
    	if i=1 and blit=false then
    		blit=true
    	end
    	if i=1 and blit=true then
    		blit=false
    	end
    	if blit then		  
    		screen:print(200, 100, "Hello!", blue)
    	end
    end
    screen.flip()
    screen.waitVblankStart()
    end
    That should work.
    HELP ME HAIRY LEG!!!!

    I have a 1.5 (downgraded) US PSP
    [code]
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
    / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \
    ( P | S | P | - | P | r | o | g | r | a | m | m | i | n | g )
    \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/
    _ _ _ _ _
    / \ / \ / \ / \ / \
    ( A | d | m | i | n )
    \_/ \_/ \_/ \_/ \_/ [/code]

  24. #1704
    Points: 5.745, Level: 48
    Level completed: 98%, Points required for next Level: 5
    Overall activity: 0%

    Registriert seit
    Jul 2005
    Beiträge
    404
    Points
    5.745
    Level
    48
    Downloads
    0
    Uploads
    0

    Standard

    hmm the end and the spaces confuse me becuase i just started this
    and the site that i put below explain what the codes do but i think it dosent have all the codes for me to learn
    i will try to understand
    Geändert von natan333 (04-19-2006 um 01:14 PM Uhr)
    Bequiet!!!
    I'm learning cc©cc

  25. #1705
    QJ Gamer Blue
    Points: 5.631, Level: 48
    Level completed: 41%, Points required for next Level: 119
    Overall activity: 0%

    Registriert seit
    Jun 2005
    Beiträge
    375
    Points
    5.631
    Level
    48
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von siqq
    testing...

    [edit] It didnt work my code looks like this now.

    Code:
    --Basic Variables
    white = Color.new(255,255,255)
    titlePlay = Image.load("titlePlay.png")
    titleInfo = Image.load("titleInfo.png")
    titleExit = Image.load("titleExit.png")
    titleNumber = 1
    pad = Controls.read()
    
    while true do
    --Main Menu
    function mainMenu(titleNumber)
    	if titleNumber == 1 then
    		screen:clear()
    		screen:blit(0,0,titlePlay)
    		screen:flip()
    	end
    	if titleNumber == 2 then
    		screen:clear()
    		screen:blit(0,0,titleInfo)
    		screen:flip()
    	end
    	if titleNumber == 3 then
    		screen:clear()
    		screen:blit(0,0,titleExit)
    		screen:flip()
    	end
    	if titleNumber < 1 or titleNumber > 3 then
    		screen:clear()
    		screen:print(0,0,"error in titleNumber", white)
    		screen:flip()
    	end
    end
    
    --Main Menu D-Pad Controls
    if pad:right() and titleNumber < 3 then
    titleNumber = titleNumber + 1
    mainMenu(titleNumber)
    end
    if pad:left() and titleNumber > 1 then
    titleNumber = titleNumber - 1
    mainMenu(titleNumber)
    end
    end
    im not exactly sure what your error was but after messing with it for a minute or two i got it to display the images when u move the dpad. im not sure if this is what u want however. Also I changed some of the picture names(the ones it loads not the variables) because i didnt have your pictures. I also have a background image added which is just a white picture

    Code:
    --Basic Variables
    white = Color.new(255,255,255)
    titlePlay = Image.load("Ball.png")
    titleInfo = Image.load("PlayerRight.png")
    titleExit = Image.load("PlayerLeft.png")
    titleNumber = 1
    background = Image.load("background.PNG")
    
    function mainMenu()
    	if titleNumber == 1 then
    		screen:blit(0,0,titlePlay  )
    	end
    	if titleNumber == 2 then
    		screen:blit(0,0,titleInfo  )
    	end
    	if titleNumber == 3 then
    		screen:blit(0,0,titleExit  )
    	end
    	if titleNumber < 1 or titleNumber > 3 then
    		screen:print(0,0,"error in titleNumber", white)
    
    	end
    end
    while true do
    screen:clear()
    screen:blit(0, 0, background,  false)
    pad = Controls.read()
    
    if pad:start() then
    	break
    end
    --Main Menu D-Pad Controls
    if pad:right() and titleNumber < 3 then
    titleNumber = titleNumber + 1
    mainMenu()
    end
    if pad:left() and titleNumber > 1 then
    titleNumber = titleNumber - 1
    mainMenu()
    end
    screen.flip()
    end

  26. #1706
    Points: 4.133, Level: 40
    Level completed: 92%, Points required for next Level: 17
    Overall activity: 0%

    Registriert seit
    Apr 2006
    Ort
    Bay Area, California
    Beiträge
    26
    Points
    4.133
    Level
    40
    Downloads
    0
    Uploads
    0

    Standard

    testing...

    [edit]I think it will work BUT...

    in lua player for windows how do you move the d pad? ive tried all arrows and pressed like every button but it does nothing. i thought it was the arrows but i guess not.[/edit]
    Geändert von siqq (04-19-2006 um 01:19 PM Uhr)

  27. #1707
    Points: 5.745, Level: 48
    Level completed: 98%, Points required for next Level: 5
    Overall activity: 0%

    Registriert seit
    Jul 2005
    Beiträge
    404
    Points
    5.745
    Level
    48
    Downloads
    0
    Uploads
    0

    Standard

    nathan42100 i tryed the code , dint work . the window shuts down after 0.5 seconds
    Bequiet!!!
    I'm learning cc©cc

  28. #1708
    QJ Gamer Blue
    Points: 5.631, Level: 48
    Level completed: 41%, Points required for next Level: 119
    Overall activity: 0%

    Registriert seit
    Jun 2005
    Beiträge
    375
    Points
    5.631
    Level
    48
    Downloads
    0
    Uploads
    0

    Standard

    i havent used lua player windows in a while but im pretty sure its the arrow keys. also the images will flash real7y quick

  29. #1709
    Points: 5.745, Level: 48
    Level completed: 98%, Points required for next Level: 5
    Overall activity: 0%

    Registriert seit
    Jul 2005
    Beiträge
    404
    Points
    5.745
    Level
    48
    Downloads
    0
    Uploads
    0

    Standard

    Code:
    for i=1,50 do
    if i=1 and blit=false then blit=true end
    if i=1 and blit=true then blit=false end if blit then
    What does this code mean ?
    i think this is not correct becuase i deleted the spaces to no make me crazy
    Bequiet!!!
    I'm learning cc©cc

  30. #1710
    Points: 4.133, Level: 40
    Level completed: 92%, Points required for next Level: 17
    Overall activity: 0%

    Registriert seit
    Apr 2006
    Ort
    Bay Area, California
    Beiträge
    26
    Points
    4.133
    Level
    40
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von soadnation
    i havent used lua player windows in a while but im pretty sure its the arrow keys. also the images will flash real7y quick
    why wont they stay?

    [edit]and i dont think its working at all cause when i press start to break the program it does nothing as well[/edit]
    Geändert von siqq (04-19-2006 um 01:45 PM Uhr)


 

Tags for this Thread

Forumregeln

  • Es ist Ihnen nicht erlaubt, neue Themen zu verfassen.
  • Es ist Ihnen nicht erlaubt, auf Beiträge zu antworten.
  • Es ist Ihnen nicht erlaubt, Anhänge hochzuladen.
  • Es ist Ihnen nicht erlaubt, Ihre Beiträge zu bearbeiten.
  •  





Alle Zeitangaben in WEZ -8. Es ist jetzt 08:59 PM Uhr.

Use of this Web site constitutes acceptance of the TERMS & CONDITIONS and PRIVACY POLICY
Copyright © , Caputo Media, LLC. All Rights Reserved. Cluster .