Seite 49 von 342 ErsteErste ... 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 99 149 ... LetzteLetzte
Zeige Ergebnis 1.441 bis 1.470 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 Gutya What if your not loading it in Lowser? What if its with an eboot? And also i ...

  
  1. #1441
    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 Gutya
    What if your not loading it in Lowser? What if its with an eboot?

    And also i tried that, but it doesnt seem to work in a function.
    I will checkup on that...I think I saw some code somehwere for that involving 'break".


    Zitat Zitat von Noriko
    I would call you gay but I love you.


    Wait ...huh.



  2. #1442
    Gutya
    Points: 15.093, Level: 79
    Level completed: 49%, Points required for next Level: 257
    Overall activity: 0%

    Registriert seit
    Feb 2006
    Beiträge
    2.398
    Points
    15.093
    Level
    79
    Downloads
    0
    Uploads
    0

    Standard

    Ok cheers.
    D:

  3. #1443
    QJ Gamer Blue
    Points: 6.990, Level: 55
    Level completed: 20%, Points required for next Level: 160
    Overall activity: 0%

    Registriert seit
    Jun 2005
    Beiträge
    359
    Points
    6.990
    Level
    55
    Downloads
    0
    Uploads
    0

    Standard

    break just quits a loop. The way to exit a file is to have all the code ran as far as I know.

  4. #1444
    Gutya
    Points: 15.093, Level: 79
    Level completed: 49%, Points required for next Level: 257
    Overall activity: 0%

    Registriert seit
    Feb 2006
    Beiträge
    2.398
    Points
    15.093
    Level
    79
    Downloads
    0
    Uploads
    0

    Standard

    It works if i put it in the main loop, but it won't allow me to put it in a function.
    D:

  5. #1445
    Is in your zone.
    Points: 24.342, Level: 94
    Level completed: 99%, Points required for next Level: 8
    Overall activity: 0%

    Registriert seit
    Oct 2005
    Ort
    Jacksonville, FL
    Beiträge
    3.429
    Points
    24.342
    Level
    94
    Downloads
    0
    Uploads
    0

    Standard

    Code:
    screen:blit(stick.x, stick.y, stick)
    --Loop in gettable. Help?

    --XBL Gamertag: PhenoM904--

  6. #1446
    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

    ok what is wrong with this? everything flickers....
    Code:
    if pad:cross()and status == 0 then
    
    x = math.sin(pi * 2 / 360 * time) * 150 + 192.5
    	screen:blit(0, 0, s11)
    	time = time + 1
    
    	if time >= 180 then
    	screen:blit(0, 0, s12)
    	end
    
    	if time >= 360 then
    		time = 0
    	end
     
    	screen.waitVblankStart()
    	screen.flip()
    
    end
    and two, how do I make it so you only have to press X once for the animation to keep going, not hold it down?


    EDIT: I just realized that this is not the kind of code that I want. I want the animation to stay stationary. I am very confused.....
    Geändert von Greenskull (04-09-2006 um 04:04 PM Uhr)
    Games I Made:
    Stick Dance
    Stick Dance V2
    50% Done "Smile Quartet"


    MY XBOX.COM GAMER SPOTLIGHT!

  7. #1447
    noob

    Points: 11.654, Level: 71
    Level completed: 1%, Points required for next Level: 396
    Overall activity: 99,0%

    Registriert seit
    Jun 2005
    Beiträge
    220
    Points
    11.654
    Level
    71
    Downloads
    0
    Uploads
    0

    Standard

    So.. where can I learn about simple collision? In my game I'm not going to have any action or shooting or such, just need it to do something when I walk up to someone and press X.

  8. #1448
    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

    ok i have a stationary animation code but it is not workign the way i want it to. I want it to last longer and it also, when it switches, doesnt go as far over as i want it. how do i do that?

    Code:
    if pad:cross()and status == 0 then
    
    -- current player position
    playerX = 10
    playerY = 10
    
    -- blit current player animation image
    	screen:blit((playerX - 1) * 16 - 4, (playerY - 1) * 16 - 4, s1pic, 1 + 25 * 
    
    animation, 1, 156, 80)
    
    -- calculate next animation image
    	animationSlowDown = animationSlowDown + 1
    	if animationSlowDown == 2 then
    		animationSlowDown = 0
    		animation = animation + animationDirection
    		if animation == 2 then
    			animationDirection = -1
    		elseif animation == 0 then
    			animationDirection = 1
    		end
    end
    Games I Made:
    Stick Dance
    Stick Dance V2
    50% Done "Smile Quartet"


    MY XBOX.COM GAMER SPOTLIGHT!

  9. #1449
    TheMarioKarters
    Guest

    Standard

    Im having some trouble with my game...it's not displaying the right sprite. Please PM me if you can help.

  10. #1450
    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 TheMarioKarters
    Im having some trouble with my game...it's not displaying the right sprite. Please PM me if you can help.
    Check AIM man, I fixed it already!
    Zitat Zitat von Noriko
    I would call you gay but I love you.


    Wait ...huh.



  11. #1451
    Gutya
    Points: 15.093, Level: 79
    Level completed: 49%, Points required for next Level: 257
    Overall activity: 0%

    Registriert seit
    Feb 2006
    Beiträge
    2.398
    Points
    15.093
    Level
    79
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von Spiritbeast
    So.. where can I learn about simple collision? In my game I'm not going to have any action or shooting or such, just need it to do something when I walk up to someone and press X.
    I have not seen a tutorial about simple collision yet...

    I might make one...
    D:

  12. #1452
    Developer
    Points: 12.360, Level: 72
    Level completed: 78%, Points required for next Level: 90
    Overall activity: 0%

    Registriert seit
    Mar 2006
    Ort
    Isle of Wight
    Beiträge
    491
    Points
    12.360
    Level
    72
    Downloads
    0
    Uploads
    0

    Standard

    Yea please do. I need to learn collision.


    PM me for a sig like this!

    http://dspspforums.com/forums/index.php SIGN UP NOW!

  13. #1453
    <img src="images/smilies/psp.gif" border="0" alt="" title="" cl***="inlineimg" /> <img src="images/smilies/Punk.gif" border="0" alt="" title="" cl***=&
    Points: 11.105, Level: 69
    Level completed: 64%, Points required for next Level: 145
    Overall activity: 0%

    Registriert seit
    Jun 2005
    Ort
    Canada
    Beiträge
    1.944
    Points
    11.105
    Level
    69
    Downloads
    0
    Uploads
    0

    Standard

    i would appreciate a collision guide too,,
    i think i have some idea how its done, but theres probably an easier way then what im thinking,,
    so it would help out

  14. #1454
    Gutya
    Points: 15.093, Level: 79
    Level completed: 49%, Points required for next Level: 257
    Overall activity: 0%

    Registriert seit
    Feb 2006
    Beiträge
    2.398
    Points
    15.093
    Level
    79
    Downloads
    0
    Uploads
    0

    Standard

    If i get a bit of time tommorow ill look into it.
    D:

  15. #1455
    Is in your zone.
    Points: 24.342, Level: 94
    Level completed: 99%, Points required for next Level: 8
    Overall activity: 0%

    Registriert seit
    Oct 2005
    Ort
    Jacksonville, FL
    Beiträge
    3.429
    Points
    24.342
    Level
    94
    Downloads
    0
    Uploads
    0

    Standard

    i was thinking it might work like (well for my game)
    Code:
    if stick.x == spike.x then
    screen:clear()
    screen:blit(0,0,death,false)

    --XBL Gamertag: PhenoM904--

  16. #1456
    <img src="images/smilies/psp.gif" border="0" alt="" title="" cl***="inlineimg" /> <img src="images/smilies/Punk.gif" border="0" alt="" title="" cl***=&
    Points: 11.105, Level: 69
    Level completed: 64%, Points required for next Level: 145
    Overall activity: 0%

    Registriert seit
    Jun 2005
    Ort
    Canada
    Beiträge
    1.944
    Points
    11.105
    Level
    69
    Downloads
    0
    Uploads
    0

    Standard

    when ever i try to put a timer function i ALWAYS get this error
    attempt to index global 'Timer' (a nil value)

    on that line i have this
    timer = Timer.new()

    what am i missing?

    EDIT nvm,, it seems the eboot i was using didnt allow that function
    Geändert von Sousanator (04-10-2006 um 06:02 PM Uhr)

  17. #1457
    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 Sousanator
    i would appreciate a collision guide too,,
    i think i have some idea how its done, but theres probably an easier way then what im thinking,,
    so it would help out
    that would be nice
    Games I Made:
    Stick Dance
    Stick Dance V2
    50% Done "Smile Quartet"


    MY XBOX.COM GAMER SPOTLIGHT!

  18. #1458
    Think, Do, Gloat.
    Points: 12.687, Level: 73
    Level completed: 60%, Points required for next Level: 163
    Overall activity: 0%

    Registriert seit
    Nov 2005
    Ort
    England, Norwich
    Beiträge
    1.422
    Points
    12.687
    Level
    73
    Downloads
    0
    Uploads
    0

    Standard

    For collision, as long as you specify the part of the thing which is colliding, and with what other object, it should be ok.
    So if you specify an area of a character, then tell it if something lands in the same place, make it do the thing you want.
    Don't know if it helps, it probably doesn't...

  19. #1459
    Gutya
    Points: 15.093, Level: 79
    Level completed: 49%, Points required for next Level: 257
    Overall activity: 0%

    Registriert seit
    Feb 2006
    Beiträge
    2.398
    Points
    15.093
    Level
    79
    Downloads
    0
    Uploads
    0

    Standard

    I added a screenrint with a font and now i get no script file found...
    D:

  20. #1460
    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 Gutya
    I added a screenrint with a font and now i get no script file found...
    Sned me a PM to remind me (I often forget) and I will sned you an example of how to print fonts and load them correctly with mono spacing and everyhting. I have a good one.
    Zitat Zitat von Noriko
    I would call you gay but I love you.


    Wait ...huh.



  21. #1461
    Gutya
    Points: 15.093, Level: 79
    Level completed: 49%, Points required for next Level: 257
    Overall activity: 0%

    Registriert seit
    Feb 2006
    Beiträge
    2.398
    Points
    15.093
    Level
    79
    Downloads
    0
    Uploads
    0

    Standard

    Ok. Done.
    D:

  22. #1462
    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

    I need a code:

    pic A, pic B

    pic A is loaded on the screen, when I press X pic A disappears and pic B appears. As long as I have the x button pressed pic B shows not pic A. When I let go of X pic B disappears and pic A appears again.

    It sounds easy but I cant get it working.Thanks in advance and sorry for a stupid request.

  23. #1463
    Developer
    Points: 12.360, Level: 72
    Level completed: 78%, Points required for next Level: 90
    Overall activity: 0%

    Registriert seit
    Mar 2006
    Ort
    Isle of Wight
    Beiträge
    491
    Points
    12.360
    Level
    72
    Downloads
    0
    Uploads
    0

    Standard

    Ok try this:

    Code:
    --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:blit(0, 0, picb)
    end
    
    screen.flip()
    end
    That works for me!


    PM me for a sig like this!

    http://dspspforums.com/forums/index.php SIGN UP NOW!

  24. #1464
    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

    ok, how do I make this animation go slower?
    Games I Made:
    Stick Dance
    Stick Dance V2
    50% Done "Smile Quartet"


    MY XBOX.COM GAMER SPOTLIGHT!

  25. #1465
    QJ Gamer Blue
    Points: 4.734, Level: 43
    Level completed: 92%, Points required for next Level: 16
    Overall activity: 0%

    Registriert seit
    Feb 2006
    Ort
    Manila, Philippines
    Beiträge
    228
    Points
    4.734
    Level
    43
    Downloads
    0
    Uploads
    0

    Standard

    you can change the CPU speed and max frame skip

  26. #1466
    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

    sorry i forgot to post it... here

    Code:
    if pad:cross()and status == 0 then
    
    -- current player position
    playerX = 10
    playerY = 10
    
    -- blit current player animation image
    	screen:blit((playerX - 1) * 16 - 4, (playerY - 1) * 16 - 4, s1pic, 1 + 80 * 
    
    animation, 1, 78, 80)
    
    -- calculate next animation image
    	animationSlowDown = animationSlowDown + 1
    	if animationSlowDown == 2 then
    		animationSlowDown = 0
    		animation = animation + animationDirection
    		if animation == 2 then
    			animationDirection = -1
    		elseif animation == 0 then
    			animationDirection = 1
    		end
    end
    Geändert von Greenskull (04-11-2006 um 03:16 PM Uhr)
    Games I Made:
    Stick Dance
    Stick Dance V2
    50% Done "Smile Quartet"


    MY XBOX.COM GAMER SPOTLIGHT!

  27. #1467
    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

    how do i slow that down?
    Games I Made:
    Stick Dance
    Stick Dance V2
    50% Done "Smile Quartet"


    MY XBOX.COM GAMER SPOTLIGHT!

  28. #1468
    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
    Ok try this:

    Code:
    --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:blit(0, 0, picb)
    end
    
    screen.flip()
    end
    That works for me!
    Thanks I'll try it.

  29. #1469
    QJ Gamer Bronze
    Points: 5.459, Level: 47
    Level completed: 55%, Points required for next Level: 91
    Overall activity: 0%

    Registriert seit
    Jul 2005
    Ort
    Washington
    Beiträge
    211
    Points
    5.459
    Level
    47
    Downloads
    0
    Uploads
    0

    Standard

    Can someone help me? Im trying to have a character move when I press right, here is what I have so far. Note: The "loading finished" does not disappear after 4 seconds, the character image blinks (probably due to the fact the image is not transparent) and the character does nothing when I press right. Can someone tell me whats wrong? Thanks in advance.

    white = Color.new(255, 255, 255)
    char = Image.load("char.png")
    y = 100

    screenrint(100, 100, "loading finished", white)
    screen.flip()
    screen.waitVblankStart(24 0)
    screen:clear()

    screen:blit(150, y, char)
    screen.flip()

    pad = Controls.read()

    if pad:right() then
    y = y + 5
    end

    while true do
    screen.waitVblankStart()
    screen.flip()

    end
    Psp firmware: 1.5 - Thank you 0okm and Fanjita! ^^

  30. #1470
    Points: 4.063, Level: 40
    Level completed: 57%, Points required for next Level: 87
    Overall activity: 0%

    Registriert seit
    Mar 2006
    Beiträge
    7
    Points
    4.063
    Level
    40
    Downloads
    0
    Uploads
    0

    Standard

    You need to have your pad stuff inside your while loop. Like this:

    white = Color.new(255, 255, 255)
    char = Image.load("char.png")
    y = 100

    screenrint(100, 100, "loading finished", white)
    screen.flip()
    screen.waitVblankStart(24 0)
    screen:clear()

    while true do

    pad = Controls.read()

    if pad:right() then
    y = y + 5
    end

    screen:blit(150, y, char)
    screen.flip()

    screen.waitVblankStart()
    screen.flip()

    end


 

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 .