Seite 226 von 342 ErsteErste ... 126 176 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 276 326 ... LetzteLetzte
Zeige Ergebnis 6.751 bis 6.780 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; Zitat von moncristo_da_dev im just making a simple jump function Ok, please say what the aim of your code is ...

  
  1. #6751
    QJ Gamer Green
    Points: 6.520, Level: 52
    Level completed: 85%, Points required for next Level: 30
    Overall activity: 0%

    Registriert seit
    Nov 2005
    Ort
    Sweden
    Beiträge
    460
    Points
    6.520
    Level
    52
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von moncristo_da_dev
    im just making a simple jump function
    Ok, please say what the aim of your code is next time.
    Here is a jump tutorial: http://www.evilmana.com/tutorials/lu...et_jumping.php


    [CENTER]Some of my homebrew Applications/Games:
    [URL=http://forums.qj.net/showthread.php?t=47294&page=1&pp=10]Planet Fighter[/URL] | [URL=http://forums.qj.net/showthread.php?p=641672#post641672]Graphic Creator (V2.0)[/URL] | [URL=http://forums.qj.net/showthread.php?p=512717]Fire Pong[/URL] | [B][URL="http://forums.qj.net/f-psp-development-forum-11/t-release-brushes-v20-99207.html#post1430891"][COLOR="Red"][SIZE="3"]Brushes v2.0[/COLOR][/SIZE][/B][/URL] [URL="http://forums.qj.net/f-psp-development-forum-11/t-release-brushes-v20-99207.html"][B][SIZE="2"][COLOR="Black"]Released![/COLOR][/SIZE][/B][/URL]
    [URL="http://haxxblaster.2u.se/"][COLOR="black"][FONT="Arial Black"]www.HaxxBlaster.com[/FONT][/COLOR][/URL]

    [URL="http://forums.qj.net/f-psp-development-forum-11/t-release-brushes-v20-99207.html"][IMG]http://img19.imageshack.us/img19/1346/brushesbannerqz3.png[/IMG][/URL][/CENTER]

  2. #6752
    QJ Gamer Blue
    Points: 3.689, Level: 38
    Level completed: 26%, Points required for next Level: 111
    Overall activity: 0%

    Registriert seit
    Apr 2007
    Beiträge
    168
    Points
    3.689
    Level
    38
    Downloads
    0
    Uploads
    0

    Standard

    ya, but that one sucks, mine is simple and to the point

  3. #6753
    QJ Gamer Green
    Points: 11.800, Level: 71
    Level completed: 38%, Points required for next Level: 250
    Overall activity: 0%

    Registriert seit
    Jul 2006
    Ort
    Middle Europe
    Beiträge
    1.281
    Points
    11.800
    Level
    71
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von myschoo
    i have a text file like this:

    Code:
    code1 = 0
    code2 = 0
    code3 = 0
    code4 = 0
    code5 = 0
    and now i need with file io save new value to code3, how would i do that??
    anyone??

  4. #6754
    QJ Gamer Silver
    Points: 10.263, Level: 67
    Level completed: 54%, Points required for next Level: 187
    Overall activity: 0%

    Registriert seit
    Jun 2006
    Ort
    UK
    Beiträge
    2.326
    Points
    10.263
    Level
    67
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von moncristo_da_dev
    ya, but that one sucks, mine is simple and to the point
    Problem. Goes up, doesn't come back down. Also, it is prone to double/triple/etc jumping.

  5. #6755
    QJ Gamer Blue
    Points: 4.561, Level: 43
    Level completed: 6%, Points required for next Level: 189
    Overall activity: 0%

    Registriert seit
    May 2006
    Beiträge
    224
    Points
    4.561
    Level
    43
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von moncristo_da_dev
    ya, but that one sucks, mine is simple and to the point
    no, yours is unnecissary and flawed

  6. #6756
    QJ Gamer Gold
    Points: 12.189, Level: 72
    Level completed: 35%, Points required for next Level: 261
    Overall activity: 0%

    Registriert seit
    Aug 2006
    Ort
    Under Your Bed
    Beiträge
    3.083
    Points
    12.189
    Level
    72
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von myschoo
    i have a text file like this:

    Code:
    code1 = 0
    code2 = 0
    code3 = 0
    code4 = 0
    code5 = 0
    and now i need with file io save new value to code3, how would i do that??
    check this out here and see if it help would, write up the code but kind of busy

    http://evilmana.com/tutorials/lua_tutorial_09.php

  7. #6757
    QJ Gamer Gold
    Points: 11.942, Level: 71
    Level completed: 73%, Points required for next Level: 108
    Overall activity: 0%

    Registriert seit
    Nov 2006
    Ort
    ...
    Beiträge
    2.080
    Points
    11.942
    Level
    71
    Downloads
    0
    Uploads
    0

    Standard

    how come this doesnt work?


    Code:
    if collision(Player,Stick) then
    menu1()
    end

  8. #6758
    Developer
    Points: 4.205, Level: 41
    Level completed: 28%, Points required for next Level: 145
    Overall activity: 0%

    Registriert seit
    Oct 2006
    Ort
    San Diego
    Beiträge
    177
    Points
    4.205
    Level
    41
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von Urameshi
    how come this doesnt work?


    Code:
    if collision(Player,Stick) then
    menu1()
    end
    as long as your collision function returns either true or false and menu1() is a valid function then it should. Have to see those 2 functions for better insight.

  9. #6759
    QJ Gamer Gold
    Points: 11.942, Level: 71
    Level completed: 73%, Points required for next Level: 108
    Overall activity: 0%

    Registriert seit
    Nov 2006
    Ort
    ...
    Beiträge
    2.080
    Points
    11.942
    Level
    71
    Downloads
    0
    Uploads
    0

    Standard

    nvm i fixed it, but i still dont know why it wouldnt load the menu tho

  10. #6760
    QJ Gamer Gold
    Points: 12.189, Level: 72
    Level completed: 35%, Points required for next Level: 261
    Overall activity: 0%

    Registriert seit
    Aug 2006
    Ort
    Under Your Bed
    Beiträge
    3.083
    Points
    12.189
    Level
    72
    Downloads
    0
    Uploads
    0

    Standard

    It may be becuase you have menu1 as a function try changing it to
    menu1 = Image.load("whatever")

    or make sure you have something like

    function menu1()
    -- your code here
    end

  11. #6761
    QJ Gamer Gold
    Points: 11.942, Level: 71
    Level completed: 73%, Points required for next Level: 108
    Overall activity: 0%

    Registriert seit
    Nov 2006
    Ort
    ...
    Beiträge
    2.080
    Points
    11.942
    Level
    71
    Downloads
    0
    Uploads
    0

    Standard

    the code was right, but i dont know why that didnt work, but i found another way to start the script over

  12. #6762
    QJ Gamer Blue
    Points: 3.689, Level: 38
    Level completed: 26%, Points required for next Level: 111
    Overall activity: 0%

    Registriert seit
    Apr 2007
    Beiträge
    168
    Points
    3.689
    Level
    38
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von emericaska8r
    no, yours is unnecissary and flawed
    ya, well if the jumping codes were actually interpretable, then i would use them in my code.

  13. #6763
    QJ Gamer Silver
    Points: 10.263, Level: 67
    Level completed: 54%, Points required for next Level: 187
    Overall activity: 0%

    Registriert seit
    Jun 2006
    Ort
    UK
    Beiträge
    2.326
    Points
    10.263
    Level
    67
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von moncristo_da_dev
    ya, well if the jumping codes were actually interpretable, then i would use them in my code.
    Done: http://forums.qj.net/f-psp-developme...ack-79712.html

    Look at the last one in the list of four.

  14. #6764
    Banned for LIFE
    Points: 18.744, Level: 86
    Level completed: 79%, Points required for next Level: 106
    Overall activity: 0%

    Registriert seit
    Oct 2006
    Ort
    East London, England
    Beiträge
    2
    Points
    18.744
    Level
    86
    Downloads
    0
    Uploads
    0

    Standard

    hi guys. Im back and think i have stumbled pon some very good advice. Would this work if i managed to incorporate it into my code


    From El Xando :

    What you need to do is tan-1 times (b/a). So a is how far he's gone along and b is how far he's gone up. you divide how far he's gone up by how far hes gone along, then times it by tan-1. So either tan-1 x (b/a) or b/a x tan-1, the second one is probably easiest because it doesnt use brackets, and if you are online now please come on MSN.

  15. #6765
    Developer
    Points: 4.318, Level: 41
    Level completed: 84%, Points required for next Level: 32
    Overall activity: 0%

    Registriert seit
    Jul 2006
    Beiträge
    205
    Points
    4.318
    Level
    41
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von eldiablov
    From El Xando :

    What you need to do is tan-1 times (b/a). So a is how far he's gone along and b is how far he's gone up. you divide how far he's gone up by how far hes gone along, then times it by tan-1. So either tan-1 x (b/a) or b/a x tan-1, the second one is probably easiest because it doesnt use brackets, and if you are online now please come on MSN.
    Uh, this doesn't make sense at all. If I had to guess, I'd say it looks like he's trying to explain calculating the angle at which something is moving, but he doesn't understand it himself. Here's a simple explanation (scroll down to the second box):

    http://hyperphysics.phy-astr.gsu.edu/hbase/ttrig.html

  16. #6766
    QJ Gamer Gold
    Points: 14.678, Level: 78
    Level completed: 57%, Points required for next Level: 172
    Overall activity: 0%

    Registriert seit
    Nov 2006
    Beiträge
    1.523
    Points
    14.678
    Level
    78
    Downloads
    0
    Uploads
    0

    Standard

    Who actually ported LUA to Psp and When?

  17. #6767
    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 Mr305
    Who actually ported LUA to Psp and When?
    Shine, 2005.
    牧来栠摩琠敨映汩獥
    PSN: youresam
    From Earth the Frozen Ipaqs shall rise and be silenced and all will live free.
    --Mike Hollingsworth

  18. #6768
    Banned for LIFE
    Points: 18.744, Level: 86
    Level completed: 79%, Points required for next Level: 106
    Overall activity: 0%

    Registriert seit
    Oct 2006
    Ort
    East London, England
    Beiträge
    2
    Points
    18.744
    Level
    86
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von LMelior
    Uh, this doesn't make sense at all. If I had to guess, I'd say it looks like he's trying to explain calculating the angle at which something is moving, but he doesn't understand it himself. Here's a simple explanation (scroll down to the second box):

    http://hyperphysics.phy-astr.gsu.edu/hbase/ttrig.html
    our definitions of simple are quite different :)

  19. #6769
    QJ Gamer Gold
    Points: 12.189, Level: 72
    Level completed: 35%, Points required for next Level: 261
    Overall activity: 0%

    Registriert seit
    Aug 2006
    Ort
    Under Your Bed
    Beiträge
    3.083
    Points
    12.189
    Level
    72
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von LMelior
    Uh, this doesn't make sense at all. If I had to guess, I'd say it looks like he's trying to explain calculating the angle at which something is moving, but he doesn't understand it himself. Here's a simple explanation (scroll down to the second box):

    http://hyperphysics.phy-astr.gsu.edu/hbase/ttrig.html
    That's simple :Cry:

  20. #6770
    QJ Gamer Blue
    Points: 3.768, Level: 38
    Level completed: 79%, Points required for next Level: 32
    Overall activity: 0%

    Registriert seit
    Apr 2007
    Beiträge
    70
    Points
    3.768
    Level
    38
    Downloads
    0
    Uploads
    0

    Standard

    hiii therreeee here i got some questions about gu gum... im having problems when tray to draw a 3d model... some faces that must be in bottom draw over the faces that must be in front, i have tested changing the place of the faces in the matrix but still having that problem,,, so that makes me think that my error is in the way i setup the:

    Gum.matrixMode() can some body give an explanation of the parameters it got, how, when
    to use and what they do
    or mybe on the :

    Gum.drawArray(Gu.TRIANGLE S, Gu.TEXTURE_32BITF+Gu.COLO R_8888+Gu.VERTEX_32BITF+G u.TRANSFORM_3D, yourtable)

    im folowing the 3d basic tutorial from tactical penguin and got not problems drawingplanes and texturing them, but whit a more complex model.

    .... sorry about my english, im from mexico.. and still ned some practice. lol... hope here not racist people. hehehe :P tnxs...
    Geändert von ahrimanes (04-13-2007 um 07:58 AM Uhr)

  21. #6771
    Developer
    Points: 4.205, Level: 41
    Level completed: 28%, Points required for next Level: 145
    Overall activity: 0%

    Registriert seit
    Oct 2006
    Ort
    San Diego
    Beiträge
    177
    Points
    4.205
    Level
    41
    Downloads
    0
    Uploads
    0

    Standard

    Maybe your drawing your tri's incorrectly. Any facing you should have their coordinates plotted clockwise, and those facing opposite should be drawn counter-clockwise.

  22. #6772
    QJ Gamer Blue
    Points: 3.768, Level: 38
    Level completed: 79%, Points required for next Level: 32
    Overall activity: 0%

    Registriert seit
    Apr 2007
    Beiträge
    70
    Points
    3.768
    Level
    38
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von KleptoOne
    Maybe your drawing your tri's incorrectly. Any facing you should have their coordinates plotted clockwise, and those facing opposite should be drawn counter-clockwise.
    could you explain alitle more... i dont get it..:Cry:

    i think my triangles are in good order cos i have no back facing,,, i just have some triangles drawing on top when they must be on bottom.... whyyyyyy ??? mybe i shoul post an screen shot.... i will do when be in home..
    Geändert von ahrimanes (04-13-2007 um 10:14 AM Uhr)

  23. #6773
    Developer
    Points: 4.318, Level: 41
    Level completed: 84%, Points required for next Level: 32
    Overall activity: 0%

    Registriert seit
    Jul 2006
    Beiträge
    205
    Points
    4.318
    Level
    41
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von eldiablov
    our definitions of simple are quite different :)
    Zitat Zitat von xpack
    That's simple :Cry:
    Well it was the simplest one that I could find in my one minute of searching. I could have sent you to the Wolfram MathWorld page for inverse tangent instead, but I'm not that sadistic. Like I said, just look at the picture and the equation in the second box of that first page I linked to, don't even worry about the text.

    Using the same variable names as that explanation, the function you're looking for is math.atan(b/a). If you'd like, though, the text describes the problems with using that function, which is the reason we also have math.atan2(b,a) - notice the number of arguments. Of course, all of this is assuming that you actually want the angle of something, which I haven't seen proof that you actually do in the first place.

  24. #6774
    QJ Gamer Blue
    Points: 4.561, Level: 43
    Level completed: 6%, Points required for next Level: 189
    Overall activity: 0%

    Registriert seit
    May 2006
    Beiträge
    224
    Points
    4.561
    Level
    43
    Downloads
    0
    Uploads
    0

    Standard

    i understood it, it refreshed my memory on trigs

  25. #6775
    QJ Gamer Blue
    Points: 5.344, Level: 46
    Level completed: 97%, Points required for next Level: 6
    Overall activity: 0%

    Registriert seit
    May 2006
    Beiträge
    347
    Points
    5.344
    Level
    46
    Downloads
    0
    Uploads
    0

    Standard

    Hey guys i am making a game in lua to help me learn. I was wondereing if i could use a table for enmies then have a number of enemies then when they all are died it will go to the next level. I know you can make the table but i am not sure how to make it check how many enemies are left.

    Sorry if this is a stupid question.

    Thanks Bob Hoil

  26. #6776
    QJ Gamer Blue
    Points: 4.369, Level: 42
    Level completed: 10%, Points required for next Level: 181
    Overall activity: 0%

    Registriert seit
    Feb 2007
    Beiträge
    246
    Points
    4.369
    Level
    42
    Downloads
    0
    Uploads
    0

    Standard

    use a counter in your table, when an enemy dies -1 from the counter

  27. #6777
    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 Bob Hoil
    Hey guys i am making a game in lua to help me learn. I was wondereing if i could use a table for enmies then have a number of enemies then when they all are died it will go to the next level. I know you can make the table but i am not sure how to make it check how many enemies are left.

    Sorry if this is a stupid question.

    Thanks Bob Hoil
    Hey Bob,

    table.getn(enemies)

    Thanks, Sam
    牧来栠摩琠敨映汩獥
    PSN: youresam
    From Earth the Frozen Ipaqs shall rise and be silenced and all will live free.
    --Mike Hollingsworth

  28. #6778
    QJ Gamer Gold
    Points: 11.629, Level: 70
    Level completed: 95%, Points required for next Level: 21
    Overall activity: 0%

    Registriert seit
    Aug 2006
    Beiträge
    1.633
    Points
    11.629
    Level
    70
    Downloads
    0
    Uploads
    0

    Standard

    Lol that's about all you need to figure the rest out. numberofenemies = table.getn(enemies)
    if *enemy is killed* then table.remove(enemies,1) end

  29. #6779
    QJ Gamer Blue
    Points: 5.344, Level: 46
    Level completed: 97%, Points required for next Level: 6
    Overall activity: 0%

    Registriert seit
    May 2006
    Beiträge
    347
    Points
    5.344
    Level
    46
    Downloads
    0
    Uploads
    0

    Standard

    Thanks guys and by the way tactical i finally got the shooting to work i didn't use your shooting method though.
    -= Double Post =-
    One more question. Ok i have a collision code but want to know how to make it destroy and object when it hits it. Right now it just restarts the game.

    Thanks Bob Hoil
    Geändert von Bob Hoil (04-14-2007 um 11:02 AM Uhr) Grund: Automerged Doublepost

  30. #6780
    words are stones in my <3
    Points: 35.274, Level: 100
    Level completed: 0%, Points required for next Level: 0
    Overall activity: 0%

    Registriert seit
    Jul 2005
    Ort
    Spokane
    Beiträge
    5.008
    Points
    35.274
    Level
    100
    My Mood
    Lonely
    Downloads
    1
    Uploads
    0

    Standard

    Bob Hoil -
    Code:
    explosion_frame = 0
    explosion = {}
    
    for i=1,NUM_FRAMES_IN_EXPLOSION do
         explosion[i] = Image.load("explosion_frame" .. i .. ".png")
    end
    
    -- in infinite loop
    
    if collision(bullet,object) then
         object.dead = true
    end
    
    if object.dead == true then
         explosion_frame=explosion_frame+1
         screen:blit(object.x,object.y,explosion[explosion_frame])
         if explosion_frame >= NUM_FRAMES_IN_EXPLOSION then
              explosion_frame = 0
              object.dead = false
              -- your 'restart' code or w/e you said...
         end
    end
    Thats very very very basic.... Youd have to incorporate a timer to increase the current frame in the explosion so its not every loop it increases, adapt it to your code, etc.

    ...at what speed must I live.. to be able to see you again?...

    Projects

    You can support my Open World 3D RPG for PSP by voting for it here



 

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

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