Seite 293 von 342 ErsteErste ... 193 243 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 ... LetzteLetzte
Zeige Ergebnis 8.761 bis 8.790 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; Thanks man! How could i have forgotten this :Argh::Argh:...

  
  1. #8761
    QJ Gamer Bronze
    Points: 5.092, Level: 45
    Level completed: 72%, Points required for next Level: 58
    Overall activity: 0%

    Registriert seit
    Aug 2006
    Beiträge
    169
    Points
    5.092
    Level
    45
    Downloads
    0
    Uploads
    0

    Standard

    Thanks man! How could i have forgotten this :Argh::Argh:



  2. #8762
    Raining
    Points: 7.355, Level: 57
    Level completed: 3%, Points required for next Level: 195
    Overall activity: 0%

    Registriert seit
    Jun 2005
    Ort
    In The Fog...
    Beiträge
    545
    Points
    7.355
    Level
    57
    My Mood
    Relaxed
    Downloads
    0
    Uploads
    0

    Standard

    I have a very simple question and hopefully it has a very simple answer: How do I know when music will stutter? Basically, I keep making things with music and sometimes the music works really well, like in a Pong game it runs super smoothly, but other times (mostly in menus) the music stutters and/or plays very slowly. I have made two different types of menus and both times this happens. One is where you press left and right and a different option will appear on screen and the other is the more standard one where all options are on screen and you just move a selector to the preferred choice. In both though, I always use something like

    Code:
    if pad:down () then
    selector.y = selector.y + 38
    end
    or

    Code:
    selection = 0
    
    function selector ()
    if pad:left () and selection < 5 then
    selection = selection + 1
    end
    For some reason I think that is the problem but I am not an experience doer so I may be completely off. An small example of a menu with music playing would be nice otherwise I would jsut like to know how to fix my menus and programs in general so that the music doesn't stutter all the time.

    Thank you very much,
    Daniel Chan

  3. #8763
    QJ Gamer Silver
    Points: 12.501, Level: 73
    Level completed: 13%, Points required for next Level: 349
    Overall activity: 62,0%

    Registriert seit
    Sep 2007
    Ort
    AUS
    Beiträge
    284
    Points
    12.501
    Level
    73
    Downloads
    0
    Uploads
    0

    Standard

    Hey Daniel Chan,
    What you could do use the System.setcpuspeed(300) or use the System.autoCpu().
    BTW what type of music, mp3 ogg aac??

    Homemister
    Wyvern. That is all

  4. #8764
    Lua guy
    Points: 11.690, Level: 71
    Level completed: 10%, Points required for next Level: 360
    Overall activity: 0%

    Registriert seit
    Jan 2008
    Ort
    Wales, cardiff
    Beiträge
    1.442
    Points
    11.690
    Level
    71
    My Mood
    Blah
    Downloads
    0
    Uploads
    0

    Standard

    Or you could just find the y position you need instead of adding
    e.g
    Code:
    if pad:down() then
    selected = selected + 1 
    end
    then have a IF for selected
    Code:
     
    if selected == 1 then
    y = 36
    end
    This is a smother way then just add the play function for your music

  5. #8765
    Lua guy
    Points: 11.690, Level: 71
    Level completed: 10%, Points required for next Level: 360
    Overall activity: 0%

    Registriert seit
    Jan 2008
    Ort
    Wales, cardiff
    Beiträge
    1.442
    Points
    11.690
    Level
    71
    My Mood
    Blah
    Downloads
    0
    Uploads
    0

    Standard

    Or you could just find the y position you need instead of adding
    e.g
    Code:
    if pad:down() then
    selected = selected + 1 
    end
    then have a IF for selected
    Code:
     
    if selected == 1 then
    y = 36
    end
    This is a smother way then just add the play function for your music

  6. #8766
    QJ Gamer Bronze
    Points: 5.381, Level: 47
    Level completed: 16%, Points required for next Level: 169
    Overall activity: 0%

    Registriert seit
    Jul 2006
    Beiträge
    550
    Points
    5.381
    Level
    47
    Downloads
    1
    Uploads
    0

    Standard

    The only reason music should be stuttering is due to the lack of resources. For some reason your "simple menu" is consuming a ton a CPU power, indicating there is probably something inherently wrong with your code/coding style/logic/understanding of your program's flow. Post your entire menu code.

    P.S. @dan369: That would result in a huge amount of needless if statements, which is bad coding practise. Use tables:
    Code:
    selectionsY = {36,0,0,0,} --etc
    y = selectionsY[selected]
    A better way would be to create a neat little menu class. OO FTW.

  7. #8767
    Raining
    Points: 7.355, Level: 57
    Level completed: 3%, Points required for next Level: 195
    Overall activity: 0%

    Registriert seit
    Jun 2005
    Ort
    In The Fog...
    Beiträge
    545
    Points
    7.355
    Level
    57
    My Mood
    Relaxed
    Downloads
    0
    Uploads
    0

    Standard

    My music file type is .xm mostly(I took the EvilMana.com Tutorials seriously when they said LuaPlayer can't play MP3's so can it?) and maybe a few .mod files.

    Okay, here is my whole menu code. I removed the music because it got very annoying when I tried playing it:

    Code:
    white = Color.new (255,255,255)
    black = Color.new (0,0,0)
    lime = Color.new (153,204,0)
    plum = Color.new (153,51,102)
    red = Color.new (255,0,0)
    blue = Color.new (0,0,255)
    orange = Color.new (255,102,0)
    
    fontponglogo = Font.load ("Fonts/billo.ttf")
    fonttagline = Font.load ("Fonts/BRADHITC.ttf")
    fontpong = Font.load ("Fonts/billo.ttf")
    fontluvtakes2 = Font.load ("Fonts/Complete in Him.ttf")
    fontfrantic = Font.load ("Fonts/V5PRD.ttf")
    fontmanic = Font.load ("Fonts/OCRAEXT.ttf")
    fontdinosaur = Font.load ("Fonts/mizufalp.ttf")
    
    fontponglogo:setPixelSizes (48,48)
    fonttagline:setPixelSizes (20,20)
    fontpong:setPixelSizes (0,36)
    fontluvtakes2:setPixelSizes (0,36)
    fontfrantic:setPixelSizes (0,36)
    fontmanic:setPixelSizes (0,36)
    fontdinosaur:setPixelSizes (0,30)
    
    introbar = Image.createEmpty (480,55)
    introbar:clear (plum)
    
    selector = {y = 63,img = Image.createEmpty (480,38)}
    selector.img:clear (plum)
    
    background = Image.createEmpty (480,272)
    background:clear (white)
    
    number = 0
    
    gamestate = "intro"
    
    oldpad = Controls.read ()
    
    function selection ()
    if pad:cross () and selector.y == 63 then
    dofile "pong.lua"
    Music.stop ()
    end
    
    if pad:cross () and selector.y == 139 then
    dofile "luvtakes2.lua"
    Music.stop ()
    end
    
    if pad:cross () and selector.y == 177 then
    dofile "frantic.lua"
    Music.stop ()
    end
    
    if pad:cross () and selector.y == 215 then
    dofile "manic.lua"
    Music.stop ()
    end
    
    if pad:cross () and selector.y == 253 then
    dofile "pongdinosaur.lua"
    Music.stop ()
    end
    
    if pad:down () and selector.y < 215 then
    selector.y = selector.y + 38
    end
    
    if pad:up () and selector.y > 63 then
    selector.y = selector.y - 38
    end
    end 
    
    function drawSelector ()
    screen:blit (0,selector.y,selector.img)
    end
    
    function drawIntro ()
    screen:blit (0,0,background)
    screen:blit (0,180,introbar)
    screen:fontPrint (fontponglogo,100,120,"pong.MODERN",black)
    screen:fontPrint (fonttagline,8,150,"a step up from pong.CAVEMAN and pong.DINOSAUR",lime)
    screen:fontPrint (fontmanic,120,220,"Press START",white)
    
    if pad:start () then
    gamestate = "menu"
    end
    end 
    
    function drawMenu ()
    screen:fontPrint (fontpong,190,90,"pong?",lime)
    screen:fontPrint (fontluvtakes2,165,130,"l*v takes 2",red)
    screen:fontPrint (fontfrantic,160,170,"frantic",blue)
    screen:fontPrint (fontmanic,180,210,"manic",orange)
    screen:fontPrint (fontdinosaur,110,240,"pong.DINOSAUR",black)
    end
    
    while true do
    pad = Controls.read ()
    
    screen:clear ()
    
    if gamestate == "intro" then
    drawIntro ()
    end
    
    if gamestate == "menu" then
    selection ()
    screen:blit (0,0,background)
    drawSelector ()
    drawMenu ()
    end
    
    screen.waitVblankStart ()
    screen.flip ()
    
    if pad:select () then
    break
    end
    
    oldpad = pad
    end
    What is funny is that I left in the Music.stop () commands even though I already took out the music. Anything wrong with this? Originally I did it the second way that dan369 suggested as per the menu example at Evilmana.com's Music & Sound tutorial but then I reverted back to the 'adding' method.

  8. #8768
    Points: 2.680, Level: 31
    Level completed: 54%, Points required for next Level: 70
    Overall activity: 0%

    Registriert seit
    Feb 2008
    Beiträge
    5
    Points
    2.680
    Level
    31
    Downloads
    0
    Uploads
    0

    Standard

    Hey, guys. I hope this thread is still being read, because I'm completely stumped on what the issue might be with porting my game to 3.XX using LuaPlayerHM7.

    I've put in a good 6 hours at least trying to figure this out. Honestly, it doesn't make any sense.

    For some reason, my line of code for loading WAV sound effects work perfectly fine in 150 but not on 3.XX.

    Here it is:
    Code:
    Move = Sound.load("Sounds/Move.wav", false)
    Whenever it gets to that line, it gives me "error loading sound" and halts the program. So I downloaded a game I knew worked in 3.XX to check out what it did for sounds...

    This is what it does:
    Code:
    kill5 = Sound.load("Data/Audio/DEDMAN5.WAV")
    Why would this code work and not mine? I've tried taking out the ", false" parameter at the end, didn't work. I've tried using lowercase for the variable, caps for the files name and changing the directory... Nothing works. I've looked at his WAV sample, and it's the same exact bitrate and format as mine (352KB/s 22050Hz Mono).

    I just don't get it. Everything else works fine. Images load and display, XM music plays, controls work fine.

    If anyone knows what up, or if there's a different LuaPlayer/MOD that works on 3.XX, please let me know.

  9. #8769
    NetGameOrb Maker
    Points: 6.138, Level: 50
    Level completed: 94%, Points required for next Level: 12
    Overall activity: 0%

    Registriert seit
    Jan 2008
    Ort
    New York
    Beiträge
    683
    Points
    6.138
    Level
    50
    My Mood
    Cheerful
    Downloads
    2
    Uploads
    0

    Standard

    Zitat Zitat von DimensionT Beitrag anzeigen
    Hey, guys. I hope this thread is still being read, because I'm completely stumped on what the issue might be with porting my game to 3.XX using LuaPlayerHM7.

    I've put in a good 6 hours at least trying to figure this out. Honestly, it doesn't make any sense.

    For some reason, my line of code for loading WAV sound effects work perfectly fine in 150 but not on 3.XX.

    Here it is:
    Code:
    Move = Sound.load("Sounds/Move.wav", false)
    Whenever it gets to that line, it gives me "error loading sound" and halts the program. So I downloaded a game I knew worked in 3.XX to check out what it did for sounds...

    This is what it does:
    Code:
    kill5 = Sound.load("Data/Audio/DEDMAN5.WAV")
    Why would this code work and not mine? I've tried taking out the ", false" parameter at the end, didn't work. I've tried using lowercase for the variable, caps for the files name and changing the directory... Nothing works. I've looked at his WAV sample, and it's the same exact bitrate and format as mine (352KB/s 22050Hz Mono).

    I just don't get it. Everything else works fine. Images load and display, XM music plays, controls work fine.

    If anyone knows what up, or if there's a different LuaPlayer/MOD that works on 3.XX, please let me know.
    try and check if your directory exist with that same letters

    and also check that your wav isn't to big as well
    GameLive name changed to NetGameOrb, Project is now online in Beta stage. Everyone encourage to register so they get news about the project and ability to play the games with NetGameOrb Support online. More info on site.

    Stats Blog:http://netgameorb.blogspot.com/
    Website:http://www.netgameorb.com/

  10. #8770
    Points: 2.680, Level: 31
    Level completed: 54%, Points required for next Level: 70
    Overall activity: 0%

    Registriert seit
    Feb 2008
    Beiträge
    5
    Points
    2.680
    Level
    31
    Downloads
    0
    Uploads
    0

    Standard

    The directory is fine. It's copied over from the Game150 version, which works perfectly... And the sound is only 7KB, so there's no problem there.

    I set up a new project with nothing but loading the sound and pressing X to play it. There's no problem with memory (as it's the only thing being loaded), and there's no conflict with anything else going on (as it's the only thing being processed)... But still, it gives me the same error everytime.

  11. #8771
    QJ Gamer Silver
    Points: 12.501, Level: 73
    Level completed: 13%, Points required for next Level: 349
    Overall activity: 62,0%

    Registriert seit
    Sep 2007
    Ort
    AUS
    Beiträge
    284
    Points
    12.501
    Level
    73
    Downloads
    0
    Uploads
    0

    Standard

    I have added new wav loading functions for the next release to Fix the issue. Also it will alow for better paning and volume management of the wav.
    Regards
    Homemister
    Wyvern. That is all

  12. #8772
    Points: 2.680, Level: 31
    Level completed: 54%, Points required for next Level: 70
    Overall activity: 0%

    Registriert seit
    Feb 2008
    Beiträge
    5
    Points
    2.680
    Level
    31
    Downloads
    0
    Uploads
    0

    Standard

    Holy crap... Good to know it's not my fault. It's been eating at me all day, lol.

    Are you able to tell me how soon it will be released? It's not a pressing issue, I can keep working on 150 until then. Just curious :P.

  13. #8773
    QJ Gamer Bronze
    Points: 7.637, Level: 58
    Level completed: 44%, Points required for next Level: 113
    Overall activity: 23,0%

    Registriert seit
    Mar 2007
    Beiträge
    547
    Points
    7.637
    Level
    58
    Downloads
    0
    Uploads
    0

    Standard

    anyone know how to fill in a shape will color ...(not a rectangle) or shapes like triangles and stars.. but not just outlines filled in aswell? point me to a tutorial or show me please and thanks :P
    http://img489.imageshack.us/img489/5841/99862310tg8.jpg
    Zitat Zitat von qwerty6523
    tobias what do you mean by a hump and run
    plz explain what that is
    Zitat Zitat von jaymes
    hump and run.. =] thats called a one night stand

  14. #8774
    QJ Gamer Silver
    Points: 12.501, Level: 73
    Level completed: 13%, Points required for next Level: 349
    Overall activity: 62,0%

    Registriert seit
    Sep 2007
    Ort
    AUS
    Beiträge
    284
    Points
    12.501
    Level
    73
    Downloads
    0
    Uploads
    0

    Standard

    I should relese it with in the next week.
    I have to finish some other things first.
    Check the news on my site for what is already included in the next player
    Wyvern. That is all

  15. #8775
    QJ Gamer Bronze
    Points: 5.381, Level: 47
    Level completed: 16%, Points required for next Level: 169
    Overall activity: 0%

    Registriert seit
    Jul 2006
    Beiträge
    550
    Points
    5.381
    Level
    47
    Downloads
    1
    Uploads
    0

    Standard

    Zitat Zitat von wicked_fable Beitrag anzeigen
    My music file type is .xm mostly(I took the EvilMana.com Tutorials seriously when they said LuaPlayer can't play MP3's so can it?) and maybe a few .mod files.

    Okay, here is my whole menu code. I removed the music because it got very annoying when I tried playing it:

    <SNIP>

    What is funny is that I left in the Music.stop () commands even though I already took out the music. Anything wrong with this? Originally I did it the second way that dan369 suggested as per the menu example at Evilmana.com's Music & Sound tutorial but then I reverted back to the 'adding' method.
    The problem is that fontprints are ridiculously CPU-intensive (rendering a font every frame is not a good idea). Fontprint to images first, or use bitmap fonts.

    Also, your code is not very good. Aside from the obvious lack of indenting (learn to indent, else you will never cope with more complex code) You do know you can have if-statements within if-statements right? (MUCH neater)
    Also, Elseifs
    e.g:
    Code:
    if pad:cross() then
    	if selector.y == 63 then
    		dofile("pong.lua")
    		Music.stop ()
    	elseif selector.y == 139 then
    		dofile("luvtakes2.lua")
    		Music.stop ()
    	elseif selector.y == 177 then
    		dofile("frantic.lua")
    		Music.stop ()
    	elseif selector.y == 215 then
    		dofile("manic.lua")
    		Music.stop ()
    	elseif selector.y == 253 then
    		dofile("pongdinosaur.lua")
    		Music.stop ()
    	end
    end
    Also, use a selector value indicating which option is to be selected, and use a table like mentioned previously. You use too many magic numbers.

  16. #8776
    Lua guy
    Points: 11.690, Level: 71
    Level completed: 10%, Points required for next Level: 360
    Overall activity: 0%

    Registriert seit
    Jan 2008
    Ort
    Wales, cardiff
    Beiträge
    1.442
    Points
    11.690
    Level
    71
    My Mood
    Blah
    Downloads
    0
    Uploads
    0

    Standard

    Could someone explain math.mod() and math.asin()

  17. #8777
    Local Tech
    Points: 9.044, Level: 63
    Level completed: 98%, Points required for next Level: 6
    Overall activity: 27,0%

    Registriert seit
    Oct 2007
    Ort
    home
    Beiträge
    1.821
    Points
    9.044
    Level
    63
    Downloads
    1
    Uploads
    0

    Standard

    HELP!!!
    is loadiing the background "background = image.load(*/background.png)" ?

    and whatever text i print after that will go over the background right?

  18. #8778
    Lua guy
    Points: 11.690, Level: 71
    Level completed: 10%, Points required for next Level: 360
    Overall activity: 0%

    Registriert seit
    Jan 2008
    Ort
    Wales, cardiff
    Beiträge
    1.442
    Points
    11.690
    Level
    71
    My Mood
    Blah
    Downloads
    0
    Uploads
    0

    Standard

    loading a image
    Code:
    file = Image.load("lok.png")
    
    screen:blit(0,0,file)
    after you've blitted the image print watever text u want :)

  19. #8779
    QJ Gamer Bronze
    Points: 7.637, Level: 58
    Level completed: 44%, Points required for next Level: 113
    Overall activity: 23,0%

    Registriert seit
    Mar 2007
    Beiträge
    547
    Points
    7.637
    Level
    58
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von dan369 Beitrag anzeigen
    loading a image
    Code:
    file = Image.load("lok.png")
    
    screen:blit(0,0,file)
    after you've blitted the image print watever text u want :)
    ^^^ and also if u want to print text to the image in the case above you would write:
    Code:
    file:print(10,10,"some text",Color.new(255,255,255))
    http://img489.imageshack.us/img489/5841/99862310tg8.jpg
    Zitat Zitat von qwerty6523
    tobias what do you mean by a hump and run
    plz explain what that is
    Zitat Zitat von jaymes
    hump and run.. =] thats called a one night stand

  20. #8780
    QJ Gamer Bronze
    Points: 5.381, Level: 47
    Level completed: 16%, Points required for next Level: 169
    Overall activity: 0%

    Registriert seit
    Jul 2006
    Beiträge
    550
    Points
    5.381
    Level
    47
    Downloads
    1
    Uploads
    0

    Standard

    Zitat Zitat von dan369 Beitrag anzeigen
    Could someone explain math.mod() and math.asin()
    asin: inverse sine (or arcsine) (sin ^ -1)
    mod: returns modulus (remainder). Deprecated, so use the "modulo" operator instead: "%"
    e.g: 20 % 3
    = 2

    more info:
    http://www.lua.org/manual/5.1/manual.html#2.5.1
    http://en.wikipedia.org/wiki/Modulo_operation
    http://en.wikipedia.org/wiki/Inverse...etric_function
    http://lua-users.org/wiki/MathLibraryTutorial
    Geändert von Nielkie (07-03-2008 um 04:15 PM Uhr)

  21. #8781
    Local Tech
    Points: 9.044, Level: 63
    Level completed: 98%, Points required for next Level: 6
    Overall activity: 27,0%

    Registriert seit
    Oct 2007
    Ort
    home
    Beiträge
    1.821
    Points
    9.044
    Level
    63
    Downloads
    1
    Uploads
    0

    Standard

    okay thanks

    after i loaded it how can i make it appear on the screen?

  22. #8782
    Raining
    Points: 7.355, Level: 57
    Level completed: 3%, Points required for next Level: 195
    Overall activity: 0%

    Registriert seit
    Jun 2005
    Ort
    In The Fog...
    Beiträge
    545
    Points
    7.355
    Level
    57
    My Mood
    Relaxed
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von Nielkie Beitrag anzeigen
    The problem is that fontprints are ridiculously CPU-intensive (rendering a font every frame is not a good idea). Fontprint to images first, or use bitmap fonts.

    Also, your code is not very good. Aside from the obvious lack of indenting (learn to indent, else you will never cope with more complex code) You do know you can have if-statements within if-statements right? (MUCH neater)
    Also, Elseifs
    e.g:
    Code:
    if pad:cross() then
    	if selector.y == 63 then
    		dofile("pong.lua")
    		Music.stop ()
    	elseif selector.y == 139 then
    		dofile("luvtakes2.lua")
    		Music.stop ()
    	elseif selector.y == 177 then
    		dofile("frantic.lua")
    		Music.stop ()
    	elseif selector.y == 215 then
    		dofile("manic.lua")
    		Music.stop ()
    	elseif selector.y == 253 then
    		dofile("pongdinosaur.lua")
    		Music.stop ()
    	end
    end
    Also, use a selector value indicating which option is to be selected, and use a table like mentioned previously. You use too many magic numbers.
    Thanks for the help! It isn't, though, that I don't know how to indent but I was never taught too. I have just been using Devsgen.com and Evilamana.com tutorials so far and I have yet to see any lessons on proper code organization. Also, that code was redone numerous times in order to figure out what was wrong so I am sorry for my lack of certain obvious things like using "elsifs"'s and such.

    When you say fontprint to images first do you mean open up some sort of program like paint and write the font on there then save it? If so that would seem like a lot of work though.

  23. #8783
    Local Tech
    Points: 9.044, Level: 63
    Level completed: 98%, Points required for next Level: 6
    Overall activity: 27,0%

    Registriert seit
    Oct 2007
    Ort
    home
    Beiträge
    1.821
    Points
    9.044
    Level
    63
    Downloads
    1
    Uploads
    0

    Standard

    oh NVM i found out how to get it to the screen...

    but the problem is

    once i do screen:clear() that means the background leaves for ever too!
    how can i make the background stay no matter what?

  24. #8784
    QJ Gamer Bronze
    Points: 7.637, Level: 58
    Level completed: 44%, Points required for next Level: 113
    Overall activity: 23,0%

    Registriert seit
    Mar 2007
    Beiträge
    547
    Points
    7.637
    Level
    58
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von joseph10444 Beitrag anzeigen
    oh NVM i found out how to get it to the screen...

    but the problem is

    once i do screen:clear() that means the background leaves for ever too!
    how can i make the background stay no matter what?
    Code:
    bg = Image.load("pic.png")
    
    while true do
    screen:clear()
    
    screen:blit(0,0,bg)
    
    screen.waitVblankStart()
    screen.flip()
    end
    that will get u an image on the screen :P
    http://img489.imageshack.us/img489/5841/99862310tg8.jpg
    Zitat Zitat von qwerty6523
    tobias what do you mean by a hump and run
    plz explain what that is
    Zitat Zitat von jaymes
    hump and run.. =] thats called a one night stand

  25. #8785
    Local Tech
    Points: 9.044, Level: 63
    Level completed: 98%, Points required for next Level: 6
    Overall activity: 27,0%

    Registriert seit
    Oct 2007
    Ort
    home
    Beiträge
    1.821
    Points
    9.044
    Level
    63
    Downloads
    1
    Uploads
    0

    Standard

    yeah thanks
    i found out its blit

    but is there any way to keep the bg image even though i do

    Code:
    screen:clear()

  26. #8786
    QJ Gamer Bronze
    Points: 7.637, Level: 58
    Level completed: 44%, Points required for next Level: 113
    Overall activity: 23,0%

    Registriert seit
    Mar 2007
    Beiträge
    547
    Points
    7.637
    Level
    58
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von joseph10444 Beitrag anzeigen
    yeah thanks
    i found out its blit

    but is there any way to keep the bg image even though i do

    Code:
    screen:clear()
    yeah write it just like i wrote above ur last post and it will stay there
    http://img489.imageshack.us/img489/5841/99862310tg8.jpg
    Zitat Zitat von qwerty6523
    tobias what do you mean by a hump and run
    plz explain what that is
    Zitat Zitat von jaymes
    hump and run.. =] thats called a one night stand

  27. #8787
    Local Tech
    Points: 9.044, Level: 63
    Level completed: 98%, Points required for next Level: 6
    Overall activity: 27,0%

    Registriert seit
    Oct 2007
    Ort
    home
    Beiträge
    1.821
    Points
    9.044
    Level
    63
    Downloads
    1
    Uploads
    0

    Standard

    OH YEAH right... i missed the while true do...
    thanks so much

    btw to everyone...
    is this a good idea?? (my very first homebrew EVER - no past coding experience)

    a tax calculator
    calculates tax on the go by inputting amount and setting % multiplied and finally adding both for final price

    for "on the go" situations like the one i had today at Winners.

    please dont steal my idea and make an app like this just because you are better than me in lua/c

    i really wanna try this
    and noone made one yet :)

  28. #8788
    QJ Gamer Blue
    Points: 7.014, Level: 55
    Level completed: 32%, Points required for next Level: 136
    Overall activity: 0%

    Registriert seit
    Jan 2007
    Ort
    U.S.
    Beiträge
    405
    Points
    7.014
    Level
    55
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von joseph10444 Beitrag anzeigen
    OH YEAH right... i missed the while true do...
    thanks so much

    btw to everyone...
    is this a good idea?? (my very first homebrew EVER - no past coding experience)

    a tax calculator
    calculates tax on the go by inputting amount and setting % multiplied and finally adding both for final price

    for "on the go" situations like the one i had today at Winners.

    please dont steal my idea and make an app like this just because you are better than me in lua/c

    i really wanna try this
    and noone made one yet :)
    Yep sounds good. Good luck with it :).

  29. #8789
    Local Tech
    Points: 9.044, Level: 63
    Level completed: 98%, Points required for next Level: 6
    Overall activity: 27,0%

    Registriert seit
    Oct 2007
    Ort
    home
    Beiträge
    1.821
    Points
    9.044
    Level
    63
    Downloads
    1
    Uploads
    0

    Standard

    cool thanks! :)
    my first words of encouragement LOL

    btw
    im having some trouble at the very beginning..
    impossible
    but still
    Code:
    green = Color.new(0, 255, 0)
    white = Color.new(255, 255, 255)
    black = Color.new(0, 0, 0)
    
    
    background = Image.load("images/background.jpg")
    
    while true do
    screen:clear()
    
    screen:blit(0,0,background)
    
    screen.waitVblankStart()
    screen.flip()
    
    screen:print(144, 74, "Welcome to Tax Calculator", black)
    screen.flip()
    
    while true do
    screen.waitVblankStart()
    end
    my error shows up (in luaplayer.exe for pc)


    Code:
    error: script.lua:22: `end' expected (to close `while' at line 8) near `<eof>'
    btw ive been always wondering whats eof?

  30. #8790
    QJ Gamer Blue
    Points: 4.872, Level: 44
    Level completed: 61%, Points required for next Level: 78
    Overall activity: 0%

    Registriert seit
    Dec 2006
    Beiträge
    251
    Points
    4.872
    Level
    44
    Downloads
    0
    Uploads
    0

    Standard

    Alright, so I'm just making a simple game in Lua but my PNG images don't display correctly. They are supposed to fill the screen, but they only fill a portion of it and they are all green, when in reality the image is mostly black and white.

    Any help?

    I'm not sure what I'm doing wrong as this is all the code I used for the image:

    Code:
    screen:blit(0,0,startImg)
    screen.flip()
    It's not just one image that's doing it either.

    I'm using the HM Mod. Could this be the problem? 3.90 M33


 

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 07:53 AM Uhr.

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