Seite 195 von 342 ErsteErste ... 95 145 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 245 295 ... LetzteLetzte
Zeige Ergebnis 5.821 bis 5.850 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; Is this kind of like what you are looking for, pspaquaforce? Spoiler for function : Code: if meatwad.x > shake.x ...

  
  1. #5821
    QJ Gamer Blue
    Points: 4.241, Level: 41
    Level completed: 46%, Points required for next Level: 109
    Overall activity: 0%

    Registriert seit
    Jul 2006
    Ort
    Alabama
    Beiträge
    142
    Points
    4.241
    Level
    41
    Downloads
    0
    Uploads
    0

    Standard

    Is this kind of like what you are looking for, pspaquaforce?

    Spoiler for function:
    Code:
    if meatwad.x > shake.x then
    shake.x=shake.x+1
    end
    if meatwad.x < shake.x then
    shake.x=shake.x-1
    end
    As a function:

    Code:
    function move(player,enemy)
    if player.x > enemy.x then
    enemy.x=enemy.x+1
    end
    if player.x < enemy.x then
    enemy.x=enemy.x-1
    end
    end
    Called as, in this case:

    Code:
    move(meatwad,shake)



    Zitat Zitat von %chrono trigger%
    i only have one while and thats at the first while true do loop
    and i just checked every if function they alll have ends
    Use trial and error (or post your code).

    EDIT: To below:
    Zitat Zitat von Anti-QJ
    Dude, It you cant edit the template i gave you, You shouldnt be coding, Unless your copying and pasting?
    That'd be silly.


    Geändert von Aphonia (02-25-2007 um 07:47 PM Uhr)

  2. #5822
    lol
    Points: 20.859, Level: 91
    Level completed: 2%, Points required for next Level: 491
    Overall activity: 0%

    Registriert seit
    Aug 2006
    Ort
    Whittier, CA
    Beiträge
    5.791
    Points
    20.859
    Level
    91
    Downloads
    0
    Uploads
    0

    Standard

    Dude, It you cant edit the template i gave you, You shouldnt be coding, Unless your copying and pasting?

  3. #5823
    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 Anti-QJ
    Dude, It you cant edit the template i gave you, You shouldnt be coding, Unless your copying and pasting?
    Give me a coder who came after evil-mana was created and doesnt do that, and I will give you a dollar.
    牧来栠摩琠敨映汩獥
    PSN: youresam
    From Earth the Frozen Ipaqs shall rise and be silenced and all will live free.
    --Mike Hollingsworth

  4. #5824
    QJ Gamer Blue
    Points: 4.241, Level: 41
    Level completed: 46%, Points required for next Level: 109
    Overall activity: 0%

    Registriert seit
    Jul 2006
    Ort
    Alabama
    Beiträge
    142
    Points
    4.241
    Level
    41
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von youresam
    Give me a coder who doesn't do that and came after evil-mana and I will give you a dollar.
    A good coder?

  5. #5825
    lol
    Points: 20.859, Level: 91
    Level completed: 2%, Points required for next Level: 491
    Overall activity: 0%

    Registriert seit
    Aug 2006
    Ort
    Whittier, CA
    Beiträge
    5.791
    Points
    20.859
    Level
    91
    Downloads
    0
    Uploads
    0

    Standard

    Tactical Pinguin.
    I will be waiting for my dollar :)

  6. #5826
    QJ Gamer Silver
    Points: 7.278, Level: 56
    Level completed: 64%, Points required for next Level: 72
    Overall activity: 0%

    Registriert seit
    Oct 2006
    Ort
    Pimp'en in the US F#
    Beiträge
    1.254
    Points
    7.278
    Level
    56
    Downloads
    0
    Uploads
    0

    Standard

    Damn it, Anti beat me to the punch
    The Wentire Worls in two Sectors....
    When did I get dev statz?
    Spoiler for my PSP homebrewReleases:
    Ace of Space V1|PvP Pong Online|PvP Pong v3 | 3.03 BlackShark Custom Firmware
    (PvP Pong DL'ed well over 2403 times combined! get yours now!)
    Spoiler for Great Quotes:

    "No Snowflake in an Avalanche ever feels responsible....." - Fortune Cookie.

  7. #5827
    lol
    Points: 20.859, Level: 91
    Level completed: 2%, Points required for next Level: 491
    Overall activity: 0%

    Registriert seit
    Aug 2006
    Ort
    Whittier, CA
    Beiträge
    5.791
    Points
    20.859
    Level
    91
    Downloads
    0
    Uploads
    0

    Standard

    NVM, I forgot about his Chase the penguin game.
    Geändert von Anti-QJ (02-25-2007 um 09:30 PM Uhr)

  8. #5828
    QJ Gamer Silver
    Points: 7.278, Level: 56
    Level completed: 64%, Points required for next Level: 72
    Overall activity: 0%

    Registriert seit
    Oct 2006
    Ort
    Pimp'en in the US F#
    Beiträge
    1.254
    Points
    7.278
    Level
    56
    Downloads
    0
    Uploads
    0

    Standard

    mmm I didn't copy and paste any thing with PvP Pong, but then again, its only Pong.....yup, hard to find one :S
    The Wentire Worls in two Sectors....
    When did I get dev statz?
    Spoiler for my PSP homebrewReleases:
    Ace of Space V1|PvP Pong Online|PvP Pong v3 | 3.03 BlackShark Custom Firmware
    (PvP Pong DL'ed well over 2403 times combined! get yours now!)
    Spoiler for Great Quotes:

    "No Snowflake in an Avalanche ever feels responsible....." - Fortune Cookie.

  9. #5829
    lol
    Points: 20.859, Level: 91
    Level completed: 2%, Points required for next Level: 491
    Overall activity: 0%

    Registriert seit
    Aug 2006
    Ort
    Whittier, CA
    Beiträge
    5.791
    Points
    20.859
    Level
    91
    Downloads
    0
    Uploads
    0

    Standard

    Sorry, You cant count :9
    But your an awesome coder!

  10. #5830
    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

    Hey anti, I guess that chance at getting rid of the sig limit just left. FFS I was a noob back then, look what I've made/am making now.

  11. #5831
    lol
    Points: 20.859, Level: 91
    Level completed: 2%, Points required for next Level: 491
    Overall activity: 0%

    Registriert seit
    Aug 2006
    Ort
    Whittier, CA
    Beiträge
    5.791
    Points
    20.859
    Level
    91
    Downloads
    0
    Uploads
    0

    Standard

    But you dint arrive AFTER evilmana.com
    Come on, Just put the sig limit to 150, Thats BS

  12. #5832
    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

    Yea I did.

  13. #5833
    QJ Gamer Blue
    Points: 5.034, Level: 45
    Level completed: 43%, Points required for next Level: 116
    Overall activity: 0%

    Registriert seit
    Nov 2005
    Beiträge
    243
    Points
    5.034
    Level
    45
    Downloads
    0
    Uploads
    0

    Standard

    how do you find the point where 2 lines intercept?

  14. #5834
    I'm Baaaack!
    Points: 17.067, Level: 83
    Level completed: 44%, Points required for next Level: 283
    Overall activity: 52,0%

    Registriert seit
    May 2006
    Ort
    Nowhere
    Beiträge
    2.186
    Points
    17.067
    Level
    83
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von eyece
    how do you find the point where 2 lines intercept?
    That's basic math. You have to know the endpoints. Then you find the equations and set them equal to each other. Quick sample.

    Code:
    Endpoints:
    (0,300),(300,0) - (1,1),(401,201)
    
    Slope Forumula(Find slope of lines):
    y2-y1
    _____
    x2-x1
    
    0-300
    _____  slope = -1
    300-0  
    
    201-1
    _____  slope = 1/2
    401-1
    
    Point Slope Forumlua:
    y - y1 = m(x - x1)
    
    y - 300 = -1(x - 0)
    y = -x + 300
    
    y - 1 = (1/2)(x - 1)
    y = .5x + .5
    
    Now set them equal to each other.
    
    -x + 300 = .5x + .5
    299.5 = 1.5x
    199.666 = x
    
    Now substitute that in for x to get the y coordinate:
    y = .5(199.666) + .5
    y = 100.333
    
    Point where they cross:
    (199.666,100.333)
    There might be an easier way, I don't know. This really isn't that hard. It just looks like a lot of work.

  15. #5835
    QJ Gamer Blue
    Points: 5.034, Level: 45
    Level completed: 43%, Points required for next Level: 116
    Overall activity: 0%

    Registriert seit
    Nov 2005
    Beiträge
    243
    Points
    5.034
    Level
    45
    Downloads
    0
    Uploads
    0

    Standard

    ... you killed my brain.

  16. #5836
    I'm Baaaack!
    Points: 17.067, Level: 83
    Level completed: 44%, Points required for next Level: 283
    Overall activity: 52,0%

    Registriert seit
    May 2006
    Ort
    Nowhere
    Beiträge
    2.186
    Points
    17.067
    Level
    83
    Downloads
    0
    Uploads
    0

    Standard

    How old are you? Because this is like 7th grade stuff.

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

    Zitat Zitat von eyece
    ... you killed my brain.
    you dont understand that?

    wow, i really dont think you're ready for programming yet.

    wait till 8th grade atlest. learn algebra.
    --------------------------------------------------------------------------------------

  18. #5838
    Look at my user title :p
    Points: 14.103, Level: 77
    Level completed: 14%, Points required for next Level: 347
    Overall activity: 0%

    Registriert seit
    Feb 2006
    Ort
    Texas
    Beiträge
    1.183
    Points
    14.103
    Level
    77
    Downloads
    0
    Uploads
    0

    Standard

    lol anyway is there a tut or do you guys have an example of how to load a file if my player collidies with an image?

  19. #5839
    I'm Baaaack!
    Points: 17.067, Level: 83
    Level completed: 44%, Points required for next Level: 283
    Overall activity: 52,0%

    Registriert seit
    May 2006
    Ort
    Nowhere
    Beiträge
    2.186
    Points
    17.067
    Level
    83
    Downloads
    0
    Uploads
    0

    Standard

    Code:
    if (player collides) then
         file = io.open("myfile.txt","r")
         text = file:read()
         file:close()
    end

  20. #5840
    Look at my user title :p
    Points: 14.103, Level: 77
    Level completed: 14%, Points required for next Level: 347
    Overall activity: 0%

    Registriert seit
    Feb 2006
    Ort
    Texas
    Beiträge
    1.183
    Points
    14.103
    Level
    77
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von Access_Denied
    Code:
    if (player collides) then
         file = io.open("myfile.txt","r") <-----
         text = file:read()
         file:close()
    end
    ok can you tell me what the lines of code with the arrows mean?
    and what would I put in here -----> (player collides)? the 2 images?

  21. #5841
    lol
    Points: 20.859, Level: 91
    Level completed: 2%, Points required for next Level: 491
    Overall activity: 0%

    Registriert seit
    Aug 2006
    Ort
    Whittier, CA
    Beiträge
    5.791
    Points
    20.859
    Level
    91
    Downloads
    0
    Uploads
    0

    Standard

    You have to edit this part
    Code:
    ("myfile.txt","r")
    myfile.txt - name of file
    r - r means it will read the file

    Code:
    *n - reads a number and returns it. ex: file.read("*n")
    *a - reads the entire file from the current position. ex: file.read("*a")
    *l - (default) - reads the next line, returns nil on End of File (EOF). ex: file.read("*l")
    number - returns a string with up to that many characters in it, or nil on EOF. ex: file.read(5)
    Heres a quick copy and paste from evilmana.com
    http://evilmana.com/tutorials/lua_tutorial_09.php

  22. #5842
    Look at my user title :p
    Points: 14.103, Level: 77
    Level completed: 14%, Points required for next Level: 347
    Overall activity: 0%

    Registriert seit
    Feb 2006
    Ort
    Texas
    Beiträge
    1.183
    Points
    14.103
    Level
    77
    Downloads
    0
    Uploads
    0

    Standard

    i used that but it said a ')' was neaded near 'collides'
    that really doesnt make sense?

  23. #5843
    I'm Baaaack!
    Points: 17.067, Level: 83
    Level completed: 44%, Points required for next Level: 283
    Overall activity: 52,0%

    Registriert seit
    May 2006
    Ort
    Nowhere
    Beiträge
    2.186
    Points
    17.067
    Level
    83
    Downloads
    0
    Uploads
    0

    Standard

    You should honestly read some lua tuts before starting. Not knowing collision or file io tells me you either didn't read them, or only read to printing text. :/

  24. #5844
    Look at my user title :p
    Points: 14.103, Level: 77
    Level completed: 14%, Points required for next Level: 347
    Overall activity: 0%

    Registriert seit
    Feb 2006
    Ort
    Texas
    Beiträge
    1.183
    Points
    14.103
    Level
    77
    Downloads
    0
    Uploads
    0

    Standard

    what do you mean? i read all the evilmana tuts, but just had questions because they werent very in depth. Besides
    i have a fully functional game with 2 images and one player the guy jumps over the 2 mines and if he touches them he returns to the beggining. i get collision i just asked for a tut on how to open a file when a collsion occurs.
    forget i asked this isnt helping, but thanks to everyone foor helping me

  25. #5845
    I'm Baaaack!
    Points: 17.067, Level: 83
    Level completed: 44%, Points required for next Level: 283
    Overall activity: 52,0%

    Registriert seit
    May 2006
    Ort
    Nowhere
    Beiträge
    2.186
    Points
    17.067
    Level
    83
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von %chrono trigger%
    what do you mean? i read all the evilmana tuts, but just had questions because they werent very in depth. Besides
    i have a fully functional game with 2 images and one player the guy jumps over the 2 mines and if he touches them he returns to the beggining. i get collision i just asked for a tut on how to open a file when a collsion occurs.
    forget i asked this isnt helping, but thanks to everyone foor helping me
    Well, if you read the evilmana tut on collisions, then you shouldn't have had the need to ask this question.

    Zitat Zitat von %chrono trigger%
    ok can you tell me what the lines of code with the arrows mean?
    and what would I put in here -----> (player collides)? the 2 images?

  26. #5846
    Look at my user title :p
    Points: 14.103, Level: 77
    Level completed: 14%, Points required for next Level: 347
    Overall activity: 0%

    Registriert seit
    Feb 2006
    Ort
    Texas
    Beiträge
    1.183
    Points
    14.103
    Level
    77
    Downloads
    0
    Uploads
    0

    Standard

    it says nothing about the function to open a file from a collision
    i was assuming it was this part: (object,object2) but wasnt sure so i asked to be sure before i add my own code to my game

  27. #5847
    lol
    Points: 20.859, Level: 91
    Level completed: 2%, Points required for next Level: 491
    Overall activity: 0%

    Registriert seit
    Aug 2006
    Ort
    Whittier, CA
    Beiträge
    5.791
    Points
    20.859
    Level
    91
    Downloads
    0
    Uploads
    0

    Standard

    You cant expect it to show you, You just have to put 2 and 2 together.

  28. #5848
    QJ Gamer Blue
    Points: 4.241, Level: 41
    Level completed: 46%, Points required for next Level: 109
    Overall activity: 0%

    Registriert seit
    Jul 2006
    Ort
    Alabama
    Beiträge
    142
    Points
    4.241
    Level
    41
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von %chrono trigger%
    but wasnt sure so i asked to be sure before i add my own code to my game
    The best way to learn (and really understand) is to experiment. Look at the apps that come with luaplayer for reference (Snake is really good). Ask for help when you've exhausted every idea you've had and mulled over your problem for a while.
    My advice, anyway.

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

    yes, expirementing is the best way to understand!

  30. #5850
    Points: 3.531, Level: 37
    Level completed: 21%, Points required for next Level: 119
    Overall activity: 0%

    Registriert seit
    Feb 2007
    Beiträge
    43
    Points
    3.531
    Level
    37
    Downloads
    0
    Uploads
    0

    Standard

    :ROFL: my game is shizy and pointless:ROFL:
    hey Aphonia how long did it take you to be a decent coder?
    Geändert von pspaquaforce (02-27-2007 um 12:10 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 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 .