Seite 51 von 342 ErsteErste ... 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 101 151 ... LetzteLetzte
Zeige Ergebnis 1.501 bis 1.530 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; so basically you want to make a random number once as a function in a while true do loop... you ...

  
  1. #1501
    QJ Gamer Blue
    Points: 4.390, Level: 42
    Level completed: 20%, Points required for next Level: 160
    Overall activity: 0%

    Registriert seit
    Apr 2006
    Ort
    secret underground lair
    Beiträge
    72
    Points
    4.390
    Level
    42
    Downloads
    0
    Uploads
    0

    Standard

    so basically you want to make a random number once as a function in a while true do loop...

    you cant. only way to do this would be to gen a random number when the program starts in use for this function... only way to do it to use the same number every time...

    or...

    function whiletruestart()
    blah = math.random(1,30)
    whiletrue(loop)
    use blah somehow
    end
    end


    Geändert von RanDom_ErrOr (04-12-2006 um 11:16 PM Uhr)

  2. #1502
    QJ Gamer Blue
    Points: 4.390, Level: 42
    Level completed: 20%, Points required for next Level: 160
    Overall activity: 0%

    Registriert seit
    Apr 2006
    Ort
    secret underground lair
    Beiträge
    72
    Points
    4.390
    Level
    42
    Downloads
    0
    Uploads
    0

    Standard

    I've made a UFA or... i should say, im learning lua through coding what i dont understand so i can learn how to use it... >>; but i've kinda run into an interesting ... bug?

    When using Lua Player for Windows, everytime i run this code, the same colors and positions are used when the program starts... its kinda weird... even when using the math.random() function to generate "random" numbers...

    is there a reliable random number function that doesnt seem to generate the same exact results each time... /cry

    Code:
    -- Demonstration No-User-App
    -- Author: RanDom_ErrOr
    -- Copyright 2006
    -- No liscense with this product what so ever. Use at your own risk. I will accept no liability or responsibility if you **** something up.
    color1 = Color.new(113, 113, 113 )
    color2 = Color.new(61, 115, 169 )
    color3 = Color.new(39, 75, 112)
    color4 = Color.new(96,120,238)
    color5 = Color.new(192,218,250)
    color6 = Color.new(224,227,254)
    screenwidth = 480
    screenheight = 272
    letter = "o"
    organism = { }
    organism[1] = { posx = math.random(1,480), posy = math.random(1,272) }
    organism[2] = { posx = math.random(1,480), posy = math.random(1,272) }
    organism[3] = { posx = math.random(1,480), posy = math.random(1,272) }
    organism[4] = { posx = math.random(1,480), posy = math.random(1,272) }
    organism[5] = { posx = math.random(1,480), posy = math.random(1,272) }
    organism[6] = { posx = math.random(1,480), posy = math.random(1,272) }
    screen:print(100,240," User Free Application Demo_Author:RanDom_ErrOr", color3)
    
    while true do
    
    	x1 = organism[1].posx
    	y1 = organism[1].posy
    	screen:print(x1 , y1 , letter, color1)
    	organism[1].posx = organism[1].posx + math.random(-3,3)
    	organism[1].posy = organism[1].posy + math.random(-3,3)
    	
    	if organism[1].posx >= screenwidth  or organism[1].posx <= 0 then
    			organism[1].posx = math.random(1,480)
    	end
    
    	if organism[1].posy >= screenheight or organism[1].posy <= 0 then
    			organism[1].posy = math.random(1,272)
    	end
    	x2 = organism[2].posx
    	y2 = organism[2].posy
    	color = organism[1].color
    	screen:print(x2 , y2 , letter, color2)
    	organism[2].posx = organism[2].posx + math.random(-3,3)
    	organism[2].posy = organism[2].posy + math.random(-3,3)
    
    	if organism[2].posx >= screenwidth or organism[2].posx <= 0 then
    			organism[2].posx = math.random(1,480)
    	end
    
    	if organism[2].posy >= screenheight or organism[2].posy <= 0 then
    			organism[2].posy = math.random(1,272)
    	end
    
    	x3 = organism[3].posx
    	y3 = organism[3].posy
    	color = organism[3].color
    	screen:print(x3 , y3 , letter, color3)
    	organism[3].posx = organism[3].posx + math.random(-3,3)
    	organism[3].posy = organism[3].posy + math.random(-3,3)
    
    	if organism[3].posx >= screenwidth or organism[3].posx <= 0 then
    			organism[3].posx = math.random(1,480)
    	end
    
    	if organism[3].posy >= screenheight or organism[3].posy <= 0 then
    			organism[3].posy = math.random(1,272)
    	end
    
    	x4 = organism[4].posx
    	y4 = organism[4].posy
    	screen:print(x4 , y4 , letter, color4)
    	organism[4].posx = organism[4].posx + math.random(-3,3)
    	organism[4].posy = organism[4].posy + math.random(-3,3)
    
    	if organism[4].posx >= screenwidth or organism[4].posx <= 0 then
    			organism[4].posx = math.random(1,480)
    	end
    
    	if organism[4].posy >= screenheight or organism[4].posy <= 0 then
    			organism[4].posy = math.random(1,272)
    	end
    	x5 = organism[5].posx
    	y5 = organism[5].posy
    	color = organism[4].color
    	screen:print(x5 , y5 , letter, color5)
    	organism[5].posx = organism[5].posx + math.random(-3,3)
    	organism[5].posy = organism[5].posy + math.random(-3,3)
    
    	if organism[5].posx >= screenwidth or organism[5].posx <= 0 then
    			organism[5].posx = math.random(1,480)
    	end
    
    	if organism[5].posy >= screenheight or organism[5].posy <= 0 then
    			organism[5].posy = math.random(1,272)
    	end
    
    	x6 = organism[6].posx
    	y6 = organism[6].posy
    	color = organism[6].color
    	screen:print(x6 , y6 , letter, color6)
    	organism[6].posx = organism[6].posx + math.random(-3,3)
    	organism[6].posy = organism[6].posy + math.random(-3,3)
    
    	if organism[6].posx >= screenwidth or organism[6].posx <= 0 then
    			organism[6].posx = math.random(1,480)
    	end
    
    	if organism[6].posy >= screenheight or organism[6].posy <= 0 then
    			organism[6].posy = math.random(1,272)
    	end
    	screen.flip()
    
    end
    while true do
    
    screen.waitVblankStart()
    end
    also... unfortunately for the life of me i cant figure out how to compress this code down to a few lines in lua... if this was php i could do this like... real quick...

    on tables is there anyway to dynamically create tables from the program? like using a variable inside on an array instead of just a number or text... is there a special delimiter used when doing this?

    im guessing instead that you actually have to use a tableconstructor to use variables like i want to... great... or does that even work? i guess i'll have to try it and see if it will...

    also is there a way to do a foreach table[?] do something like table[1]-[5] etc with less code than i've used...

    whats funny is that this is the first program i've programmed in Lua, and its kind of restrained, not being able to easily (php is so easy with tables like blah[$vari] = { $blah2 = $blah, etc = $1234, $huh = $great}
    )
    basically i want code to easily increase the number of dudes >>; course, i could use the buttons, but i'd need an easy way to make new tables... (buttons and crap i can do, its just how to make the tables easier (with variables or with functions... w/e) )

    thanks in advance... ^^

    EDIT: optimized code a little, but still ugly and bloated... ><
    Geändert von RanDom_ErrOr (04-13-2006 um 12:34 AM Uhr)

  3. #1503
    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

    Ok thats a lot so im just answering in parts and edit i guess lol.

    Ok for a different "random" number each time you should make a seed. I dont know the exact command unfortunately, but its something like this: random.seed(ostime("%c"))

    Ok sorry i have to do java programming for my study. One last thing:
    Code:
    organism = { }
    organism[1] = { posx = math.random(1,480), posy = math.random(1,272) }
    organism[2] = { posx = math.random(1,480), posy = math.random(1,272) }
    organism[3] = { posx = math.random(1,480), posy = math.random(1,272) }
    organism[4] = { posx = math.random(1,480), posy = math.random(1,272) }
    organism[5] = { posx = math.random(1,480), posy = math.random(1,272) }
    organism[6] = { posx = math.random(1,480), posy = math.random(1,272) }
    could be shorter by using this:
    Code:
    organism = { }
    for i=1,9 do
    organism[i] = { posx = math.random(1,480), posy = math.random(1,272) }
    end
    Waaaaay shorter
    Later!
    LUA manual:
    [url]http://www.lua.org/manual/5.0/manual.html[/url]

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

  4. #1504
    QJ Gamer Silver
    Points: 8.993, Level: 63
    Level completed: 81%, Points required for next Level: 57
    Overall activity: 0%

    Registriert seit
    Feb 2006
    Ort
    England
    Beiträge
    1.038
    Points
    8.993
    Level
    63
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von Altair
    @ct-boy

    If it stops at 90% it means there is something wrong between 90% and 100%. Just so you know for the future. I think people forget that, maybe im wrong. So anyway, Lua cant handle GIF's (yet), so change that in your code.
    thanks alot man! know I got my game to work fully but am not yet gonna release it!

    am soo happy :humped: :humped: :Punk: :icon_smil
    I own a Playstation 3,PSP and a Wii add me on psn: azazin,

    Zitat Zitat von TheMasterChef
    Who gives a rat's ass about the size anyway?? It is not like you carry it around every day.

  5. #1505
    QJ Gamer Silver
    Points: 7.109, Level: 55
    Level completed: 80%, Points required for next Level: 41
    Overall activity: 0%

    Registriert seit
    Jun 2005
    Ort
    Puerto Rico
    Beiträge
    310
    Points
    7.109
    Level
    55
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von kozine
    --Load images
    pica = Image.load("Path to image")
    picb = Image.load("Path to image")

    --Begin the main loop
    while true do
    pad = Controls.read()

    screen:blit(0, 0, pica)

    if pad:cross() then
    screen:clear()
    screen:blit(0, 0, picb)
    end

    screen.flip()
    end
    Ok now it's half done (pica) disappears when (picb) appears but then (picb) stays printed on the screen.

  6. #1506
    QJ Gamer Blue
    Points: 4.390, Level: 42
    Level completed: 20%, Points required for next Level: 160
    Overall activity: 0%

    Registriert seit
    Apr 2006
    Ort
    secret underground lair
    Beiträge
    72
    Points
    4.390
    Level
    42
    Downloads
    0
    Uploads
    0

    Standard

    unfortunately man when trying to do organism[i] it makes it so i is the key / index... so it doesnt work... im actually looking for a way to use a variable(which will be a number) as an index... (so i dont have to hard code all this crap for each organism )

  7. #1507
    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 shadow-evillink
    Ok now it's half done (pica) disappears when (picb) appears but then (picb) stays printed on the screen.
    Once again this works:
    Code:
    --Load images
    bg = Image.load("bg.png")
    pic = {}
    pic[1] = Image.load("flapperleft1.png")
    pic[2] = Image.load("flapperleft2.png")
    imgpic=pic[1]
    
    --Begin the main loop
    while true do
    screen:blit(0, 0, bg)
    pad = Controls.read()
    
    if pad:cross() then
    imgpic=pic[2]
    else
    imgpic=pic[1]
    end
    
    screen:blit(0, 0, imgpic)
    screen.flip()
    end
    you just need a background know .
    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!

  8. #1508
    Rock Star
    Points: 70.899, Level: 100
    Level completed: 0%, Points required for next Level: 0
    Overall activity: 0%

    Registriert seit
    Aug 2005
    Ort
    CT| FW: 4.01 M33-2
    Beiträge
    11.844
    Points
    70.899
    Level
    100
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von ct-boy
    thanks alot man! know I got my game to work fully but am not yet gonna release it!

    am soo happy :humped: :humped: :Punk: :icon_smil
    Care to state what your game is?


  9. #1509
    QJ Gamer Silver
    Points: 8.993, Level: 63
    Level completed: 81%, Points required for next Level: 57
    Overall activity: 0%

    Registriert seit
    Feb 2006
    Ort
    England
    Beiträge
    1.038
    Points
    8.993
    Level
    63
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von TeamOverload
    Care to state what your game is?
    nope sry lol.

    :Punk: :icon_smil ;) but I still need a little help from anyone my msn is ct-trav[email protected]
    I own a Playstation 3,PSP and a Wii add me on psn: azazin,

    Zitat Zitat von TheMasterChef
    Who gives a rat's ass about the size anyway?? It is not like you carry it around every day.

  10. #1510
    Rock Star
    Points: 70.899, Level: 100
    Level completed: 0%, Points required for next Level: 0
    Overall activity: 0%

    Registriert seit
    Aug 2005
    Ort
    CT| FW: 4.01 M33-2
    Beiträge
    11.844
    Points
    70.899
    Level
    100
    Downloads
    0
    Uploads
    0

    Standard

    Alright thats cool....ill be anxious to see it when it is released


  11. #1511
    Developer
    Points: 6.074, Level: 50
    Level completed: 62%, Points required for next Level: 76
    Overall activity: 0%

    Registriert seit
    Sep 2005
    Beiträge
    270
    Points
    6.074
    Level
    50
    Downloads
    0
    Uploads
    0

    Standard

    Ok, let's say a = math.random(1, 20). Then i say, print (0,0, a), it prints every number 1, 2, 3, 4, 5, etc... through 20. I just want it to print a single random number

  12. #1512
    Quality Haxing Since 1991
    Points: 29.255, Level: 99
    Level completed: 55%, Points required for next Level: 745
    Overall activity: 0%

    Registriert seit
    Oct 2005
    Ort
    Pennsylvania, USA Fi
    Beiträge
    6.206
    Points
    29.255
    Level
    99
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von ro0kie42
    Ok, let's say a = math.random(1, 20). Then i say, print (0,0, a), it prints every number 1, 2, 3, 4, 5, etc... through 20. I just want it to print a single random number
    It looks like you have a = math.random(1, 20). in your loop. Put it before the loop, then it will only generate one number.
    Zitat Zitat von Noriko
    I would call you gay but I love you.


    Wait ...huh.



  13. #1513
    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 PSPHax0r9
    It looks like you have a = math.random(1, 20). in your loop. Put it before the loop, then it will only generate one number.
    TIP:
    Always put
    math.randomseed(os.time() )
    before a loop and a "math.random()" function!
    This will stop you from gtting the same resualt
    on startup of your code.
    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!

  14. #1514
    Quality Haxing Since 1991
    Points: 29.255, Level: 99
    Level completed: 55%, Points required for next Level: 745
    Overall activity: 0%

    Registriert seit
    Oct 2005
    Ort
    Pennsylvania, USA Fi
    Beiträge
    6.206
    Points
    29.255
    Level
    99
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von c5cha7
    TIP:
    Always put
    math.randomseed(os.time() )
    before a loop and a "math.random()" function!
    This will stop you from gtting the same resualt
    on startup of your code.
    Oh yea, I forgot to say all that. Thanks. That should help rookie.
    Zitat Zitat von Noriko
    I would call you gay but I love you.


    Wait ...huh.



  15. #1515
    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

    yea, thats something improtant to know, i am going to use a random seed in BPPE
    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

  16. #1516
    Developer
    Points: 6.074, Level: 50
    Level completed: 62%, Points required for next Level: 76
    Overall activity: 0%

    Registriert seit
    Sep 2005
    Beiträge
    270
    Points
    6.074
    Level
    50
    Downloads
    0
    Uploads
    0

    Standard

    The math.random() part is outside the loop. The print part is inside the loop. If I put the print part outside the loop, it doesn't print. If i put the print part inside the loop, it prints all the numbers.
    Geändert von ro0kie42 (04-13-2006 um 01:18 PM Uhr)

  17. #1517
    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

    is there a way to end a SPECIFIC sound? rather than using voice:stop()?
    Games I Made:
    Stick Dance
    Stick Dance V2
    50% Done "Smile Quartet"


    MY XBOX.COM GAMER SPOTLIGHT!

  18. #1518
    Quality Haxing Since 1991
    Points: 29.255, Level: 99
    Level completed: 55%, Points required for next Level: 745
    Overall activity: 0%

    Registriert seit
    Oct 2005
    Ort
    Pennsylvania, USA Fi
    Beiträge
    6.206
    Points
    29.255
    Level
    99
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von Greenskull
    is there a way to end a SPECIFIC sound? rather than using voice:stop()?
    yes....voice is a variable. So give each sound a different name and say voice1:stop...voice2:stop ...etc.
    Zitat Zitat von Noriko
    I would call you gay but I love you.


    Wait ...huh.



  19. #1519
    sceKernelExitGame();
    Points: 19.955, Level: 89
    Level completed: 21%, Points required for next Level: 395
    Overall activity: 0%

    Registriert seit
    Jan 2006
    Ort
    New York
    Beiträge
    3.126
    Points
    19.955
    Level
    89
    Downloads
    0
    Uploads
    0

    Standard

    help!!!!!!! i am a new developer and i am using the tuts by pspmillionare and when i try to test my apps/games on my psp it always says error: no script file found.
    does any1 know wat to do?
    BTW- i am using luaplayer .16 on a 2.00 psp

  20. #1520
    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

    Zitat Zitat von PSPHax0r9
    yes....voice is a variable. So give each sound a different name and say voice1:stop...voice2:stop ...etc.
    hmm I tried that but it said that "loop in gettable" thing....
    Games I Made:
    Stick Dance
    Stick Dance V2
    50% Done "Smile Quartet"


    MY XBOX.COM GAMER SPOTLIGHT!

  21. #1521
    QJ Gamer Gold
    Points: 20.183, Level: 89
    Level completed: 67%, Points required for next Level: 167
    Overall activity: 0%

    Registriert seit
    Jul 2005
    Ort
    Chicago
    Beiträge
    4.443
    Points
    20.183
    Level
    89
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von bronxbomber92
    help!!!!!!! i am a new developer and i am using the tuts by pspmillionare and when i try to test my apps/games on my psp it always says error: no script file found.
    does any1 know wat to do?
    BTW- i am using luaplayer .16 on a 2.00 psp
    I get the same exact error, but im using the windows lua player

  22. #1522
    sceKernelExitGame();
    Points: 19.955, Level: 89
    Level completed: 21%, Points required for next Level: 395
    Overall activity: 0%

    Registriert seit
    Jan 2006
    Ort
    New York
    Beiträge
    3.126
    Points
    19.955
    Level
    89
    Downloads
    0
    Uploads
    0

    Standard

    i cant test on my computer becuase i have a mac

  23. #1523
    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

    wait, the sound loops so is that what the error means?
    Games I Made:
    Stick Dance
    Stick Dance V2
    50% Done "Smile Quartet"


    MY XBOX.COM GAMER SPOTLIGHT!

  24. #1524
    Rock Star
    Points: 70.899, Level: 100
    Level completed: 0%, Points required for next Level: 0
    Overall activity: 0%

    Registriert seit
    Aug 2005
    Ort
    CT| FW: 4.01 M33-2
    Beiträge
    11.844
    Points
    70.899
    Level
    100
    Downloads
    0
    Uploads
    0

    Standard

    What are all the sound formats supported, and are there any size limits?


  25. #1525
    sceKernelExitGame();
    Points: 19.955, Level: 89
    Level completed: 21%, Points required for next Level: 395
    Overall activity: 0%

    Registriert seit
    Jan 2006
    Ort
    New York
    Beiträge
    3.126
    Points
    19.955
    Level
    89
    Downloads
    0
    Uploads
    0

    Standard

    can any1 help me get my small app running on my psp?

  26. #1526
    Rock Star
    Points: 70.899, Level: 100
    Level completed: 0%, Points required for next Level: 0
    Overall activity: 0%

    Registriert seit
    Aug 2005
    Ort
    CT| FW: 4.01 M33-2
    Beiträge
    11.844
    Points
    70.899
    Level
    100
    Downloads
    0
    Uploads
    0

    Standard

    Post the code and we will try and help you out


  27. #1527
    sceKernelExitGame();
    Points: 19.955, Level: 89
    Level completed: 21%, Points required for next Level: 395
    Overall activity: 0%

    Registriert seit
    Jan 2006
    Ort
    New York
    Beiträge
    3.126
    Points
    19.955
    Level
    89
    Downloads
    0
    Uploads
    0

    Standard

    ok heres the code

    green = Color.new (0, 255, 0)
    Enemy = { }
    Enemy[1] = { type = "gargoyle", health = 100 }
    Enemy[2] = { type = "vampire", health = 100 }
    Enemy[3] = { type = "goomba", health = 100 }
    Enemy[4] = { type = "ghost", health = 100 }
    Enemy[5] = { type = "zombie", health = 100 }
    Player = { }
    Player[1] = { weapon = "sword", health = 100 }
    Player[2] = { weapon = "knife", health = 100 }
    while true do
    pad = Controls.read()
    screen.clear()
    screenrint(5, 10, "Player 1 Health: ".. Player[1].health,green)
    screenrint(5, 20, "Player 1 Weapon: ".. Player[1].weapon,green)
    screenrint(250,10,"Enemy Health: " .. Enemy[1].health,green)
    screenrint(250,20,"Enemy Type: " .. Enemy[1].type,green)
    if pad:cross() then
    Enemy[1].health = Enemy[1].health - 5
    end
    screen.waitVblankStart()
    screen.flip()
    end

    BTW- the smilies where placed in by the forum becuz but remember its really screenrint
    Geändert von Bronx (04-13-2006 um 06:15 PM Uhr)

  28. #1528
    sceKernelExitGame();
    Points: 19.955, Level: 89
    Level completed: 21%, Points required for next Level: 395
    Overall activity: 0%

    Registriert seit
    Jan 2006
    Ort
    New York
    Beiträge
    3.126
    Points
    19.955
    Level
    89
    Downloads
    0
    Uploads
    0

    Standard

    oh, and now i get the error of index.lua:1: unexpected symbol near (sumtin, i cant type it on a keyboard)

    sry for double post!!!

  29. #1529
    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

    is this???: screen"print(5, 20, "Player 1 Weapon: ".. Player[1].weapon,green)

    try: screenprint(5, 20, "Player 1 Weapon: ".. Player[1].weapon,green)

  30. #1530
    sceKernelExitGame();
    Points: 19.955, Level: 89
    Level completed: 21%, Points required for next Level: 395
    Overall activity: 0%

    Registriert seit
    Jan 2006
    Ort
    New York
    Beiträge
    3.126
    Points
    19.955
    Level
    89
    Downloads
    0
    Uploads
    0

    Standard

    omg, i cant believe i missed that! thanks! but know i get error: index.lua:1: unexpected symbol near (little backward slash) { (little forward slash).
    sry i dont now if i can type those symbols i was describing...


 

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:58 PM Uhr.

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