Seite 303 von 342 ErsteErste ... 203 253 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 ... LetzteLetzte
Zeige Ergebnis 9.061 bis 9.090 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; How would I make platforms that I can jump on? Sorry, just started coding 3 days ago.:Punk:...

  
  1. #9061
    QJ Gamer Green
    Points: 4.034, Level: 40
    Level completed: 43%, Points required for next Level: 116
    Overall activity: 0%

    Registriert seit
    Jul 2008
    Beiträge
    467
    Points
    4.034
    Level
    40
    Downloads
    0
    Uploads
    0

    Standard

    How would I make platforms that I can jump on?

    Sorry, just started coding 3 days ago.:Punk:



  2. #9062
    QJ Gamer Blue
    Points: 4.268, Level: 41
    Level completed: 59%, Points required for next Level: 82
    Overall activity: 0%

    Registriert seit
    Apr 2008
    Beiträge
    497
    Points
    4.268
    Level
    41
    Downloads
    0
    Uploads
    0

    Standard

    umm, well, that would kinda work, except all you did is move the coin over, to the side so you should have.

    if player.x == coin.x, and player.y = coin.y and coin.visible = "true" then
    coin.visible = "false"
    player.points = player.points + 10
    end

    add that andyou won't need to worry about it

  3. #9063
    QJ Gamer Blue
    Points: 4.268, Level: 41
    Level completed: 59%, Points required for next Level: 82
    Overall activity: 0%

    Registriert seit
    Apr 2008
    Beiträge
    497
    Points
    4.268
    Level
    41
    Downloads
    0
    Uploads
    0

    Standard

    add collision to the platforms

  4. #9064
    QJ Gamer Green
    Points: 4.034, Level: 40
    Level completed: 43%, Points required for next Level: 116
    Overall activity: 0%

    Registriert seit
    Jul 2008
    Beiträge
    467
    Points
    4.034
    Level
    40
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von PSProgramer Beitrag anzeigen
    add collision to the platforms
    I tried but its not working and collision pisses me off

    :Argh:

  5. #9065
    QJ Gamer Blue
    Points: 4.268, Level: 41
    Level completed: 59%, Points required for next Level: 82
    Overall activity: 0%

    Registriert seit
    Apr 2008
    Beiträge
    497
    Points
    4.268
    Level
    41
    Downloads
    0
    Uploads
    0

    Standard

    lol,well it's not going to magically work, lol look at the collision tut at evilmana

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

    You aren't gonna make much without collision detection :/

    There is a nice collision snippet on http://www.tacticalpenguin.com

  7. #9067
    QJ Gamer Green
    Points: 4.034, Level: 40
    Level completed: 43%, Points required for next Level: 116
    Overall activity: 0%

    Registriert seit
    Jul 2008
    Beiträge
    467
    Points
    4.034
    Level
    40
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von PSProgramer Beitrag anzeigen
    lol,well it's not going to magically work, lol look at the collision tut at evilmana
    I took the code from the tut LOL its just not working


  8. #9068
    QJ Gamer Green
    Points: 4.034, Level: 40
    Level completed: 43%, Points required for next Level: 116
    Overall activity: 0%

    Registriert seit
    Jul 2008
    Beiträge
    467
    Points
    4.034
    Level
    40
    Downloads
    0
    Uploads
    0

    Standard

    The coin function doesnt worl if the coins are in the air

  9. #9069
    QJ Gamer Blue
    Points: 4.268, Level: 41
    Level completed: 59%, Points required for next Level: 82
    Overall activity: 0%

    Registriert seit
    Apr 2008
    Beiträge
    497
    Points
    4.268
    Level
    41
    Downloads
    0
    Uploads
    0

    Standard

    what do you mean, it should, add a if player.jumping = "true" kinda thing.

  10. #9070
    QJ Gamer Green
    Points: 4.034, Level: 40
    Level completed: 43%, Points required for next Level: 116
    Overall activity: 0%

    Registriert seit
    Jul 2008
    Beiträge
    467
    Points
    4.034
    Level
    40
    Downloads
    0
    Uploads
    0

    Standard

    Is there a way to show an image only when no buttons are being pressed, and when I press a button the image dissapears?
    My Releases:
    ---------------------------------------------------
    [URL="http://forums.qj.net/showthread.php?t=145654"]ROFLFlasher[/URL]

    [URL="http://forums.qj.net/showthread.php?t=144892"]DTS MGS Edition[/URL]

    [URL="http://forums.qj.net/showthread.php?t=143735"]Arkanoid Deluxe Beta[/URL]

    [URL="http://forums.qj.net/showthread.php?p=2144700#post2144700"]SAVIOR![/URL]

  11. #9071
    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

    Work these thing out for yourself. You won't learn anything by continually asking for code.

  12. #9072
    QJ Gamer Green
    Points: 4.034, Level: 40
    Level completed: 43%, Points required for next Level: 116
    Overall activity: 0%

    Registriert seit
    Jul 2008
    Beiträge
    467
    Points
    4.034
    Level
    40
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von eldiablov Beitrag anzeigen
    Work these thing out for yourself. You won't learn anything by continually asking for code.
    Is there a pad ~= pressed function
    My Releases:
    ---------------------------------------------------
    [URL="http://forums.qj.net/showthread.php?t=145654"]ROFLFlasher[/URL]

    [URL="http://forums.qj.net/showthread.php?t=144892"]DTS MGS Edition[/URL]

    [URL="http://forums.qj.net/showthread.php?t=143735"]Arkanoid Deluxe Beta[/URL]

    [URL="http://forums.qj.net/showthread.php?p=2144700#post2144700"]SAVIOR![/URL]

  13. #9073
    QJ Gamer Blue
    Points: 4.268, Level: 41
    Level completed: 59%, Points required for next Level: 82
    Overall activity: 0%

    Registriert seit
    Apr 2008
    Beiträge
    497
    Points
    4.268
    Level
    41
    Downloads
    0
    Uploads
    0

    Standard

    ummm, I think so. . . I don't remeber exactly what it was, what are you using it for??mabey I can help more then...

  14. #9074
    QJ Gamer Green
    Points: 4.034, Level: 40
    Level completed: 43%, Points required for next Level: 116
    Overall activity: 0%

    Registriert seit
    Jul 2008
    Beiträge
    467
    Points
    4.034
    Level
    40
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von PSProgramer Beitrag anzeigen
    ummm, I think so. . . I don't remeber exactly what it was, what are you using it for??mabey I can help more then...
    when I press left it shows left sprite image, when I press right it shows right sprite image, when I press up it shows up sprite image, when I press down it shows down sprite image, so if I blit still sprite image it merges with the other sprite image so I need it to dissapear while im pressin up left right or down
    My Releases:
    ---------------------------------------------------
    [URL="http://forums.qj.net/showthread.php?t=145654"]ROFLFlasher[/URL]

    [URL="http://forums.qj.net/showthread.php?t=144892"]DTS MGS Edition[/URL]

    [URL="http://forums.qj.net/showthread.php?t=143735"]Arkanoid Deluxe Beta[/URL]

    [URL="http://forums.qj.net/showthread.php?p=2144700#post2144700"]SAVIOR![/URL]

  15. #9075
    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 xXChromeXx Beitrag anzeigen
    Is there a pad ~= pressed function
    there's an if not ;)

  16. #9076
    QJ Gamer Green
    Points: 4.034, Level: 40
    Level completed: 43%, Points required for next Level: 116
    Overall activity: 0%

    Registriert seit
    Jul 2008
    Beiträge
    467
    Points
    4.034
    Level
    40
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von eldiablov Beitrag anzeigen
    there's an if not ;)
    elseif?
    My Releases:
    ---------------------------------------------------
    [URL="http://forums.qj.net/showthread.php?t=145654"]ROFLFlasher[/URL]

    [URL="http://forums.qj.net/showthread.php?t=144892"]DTS MGS Edition[/URL]

    [URL="http://forums.qj.net/showthread.php?t=143735"]Arkanoid Deluxe Beta[/URL]

    [URL="http://forums.qj.net/showthread.php?p=2144700#post2144700"]SAVIOR![/URL]

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

    of course

  18. #9078
    QJ Gamer Green
    Points: 4.034, Level: 40
    Level completed: 43%, Points required for next Level: 116
    Overall activity: 0%

    Registriert seit
    Jul 2008
    Beiträge
    467
    Points
    4.034
    Level
    40
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von eldiablov Beitrag anzeigen
    of course
    Thanks
    My Releases:
    ---------------------------------------------------
    [URL="http://forums.qj.net/showthread.php?t=145654"]ROFLFlasher[/URL]

    [URL="http://forums.qj.net/showthread.php?t=144892"]DTS MGS Edition[/URL]

    [URL="http://forums.qj.net/showthread.php?t=143735"]Arkanoid Deluxe Beta[/URL]

    [URL="http://forums.qj.net/showthread.php?p=2144700#post2144700"]SAVIOR![/URL]

  19. #9079
    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

    Each pad function returns true or false, so learn Lua's Boolean operations.

    Code:
    if pad:left() then
    	blah
    else
    	blah
    end
    or
    Code:
    if pad:left() then
    	blah
    elseif bla2 then
    	blah
    end
    or
    Code:
    if pad:left() ~= true then
    or
    Code:
    if pad:left() == false then
    or
    Code:
    if not pad:left() then

  20. #9080
    QJ Gamer Green
    Points: 4.034, Level: 40
    Level completed: 43%, Points required for next Level: 116
    Overall activity: 0%

    Registriert seit
    Jul 2008
    Beiträge
    467
    Points
    4.034
    Level
    40
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von Nielkie Beitrag anzeigen
    Each pad function returns true or false, so learn Lua's Boolean operations.

    Code:
    if pad:left() then
    	blah
    else
    	blah
    end
    or
    Code:
    if pad:left() then
    	blah
    elseif bla2 then
    	blah
    end
    or
    Code:
    if pad:left() ~= true then
    or
    Code:
    if pad:left() == false then
    or
    Code:
    if not pad:left() then
    Thanks
    My Releases:
    ---------------------------------------------------
    [URL="http://forums.qj.net/showthread.php?t=145654"]ROFLFlasher[/URL]

    [URL="http://forums.qj.net/showthread.php?t=144892"]DTS MGS Edition[/URL]

    [URL="http://forums.qj.net/showthread.php?t=143735"]Arkanoid Deluxe Beta[/URL]

    [URL="http://forums.qj.net/showthread.php?p=2144700#post2144700"]SAVIOR![/URL]

  21. #9081
    Seven Year Vet. BOW DOWN.
    Points: 14.794, Level: 78
    Level completed: 86%, Points required for next Level: 56
    Overall activity: 0%

    Registriert seit
    Dec 2005
    Ort
    Manchester, UK
    Beiträge
    2.240
    Points
    14.794
    Level
    78
    My Mood
    Cheerful
    Downloads
    1
    Uploads
    0

    Standard

    Zitat Zitat von EminentJonFrost Beitrag anzeigen
    Code:
    --[[Drawing a circle
    Created by FxN
    
    This draws a circle and takes 5 arguements:
    1.Target = What we are drawing on
    2.X coordinate
    3.Y coordinate
    4.Radius of the circle
    5.Color
    
    The X and Y coordinates are for the middle point of the circle]]
    
    function drawcircle(target, ux, uy, crad, ccolor)
    	degree = 0
    	while degree < (6.4) do
    		target:pixel((math.floor(crad * math.cos(degree)))+ ux, (math.floor(crad * math.sin(degree))) + uy, ccolor)
    		degree = degree + 0.005
    	end
    end --drawcircle
    ---circle function
    
    screen:clear()
    drawcircle(screen,100,100, 50, red)
    screen.flip()
    while not Controls.read():cross() do
    screen.waitVblankStart(1)
    end
    I tried using this in a game I'm making, but it just lags like hell. Anyone have any idea what the problem might be? I know that I havn't put the function in the loop, but I did call it. If I leave all the surrounding code alone and put '--' in front of the drawcircle() so that luaplayer skips it, it runs fine, but I don't see why a simple calculation would slow it so much.

  22. #9082
    OMFG
    Points: 19.453, Level: 88
    Level completed: 21%, Points required for next Level: 397
    Overall activity: 0%

    Registriert seit
    Jul 2005
    Ort
    Toronto
    Beiträge
    2.814
    Points
    19.453
    Level
    88
    Downloads
    0
    Uploads
    0

    Standard

    Just look at it...

    Every single loop if you call that, it has to add 0.005 onto degree all the way up until it gets to 6.4. That's 1280 times.

    That would probably do it... Try something like 0.05 (128 times), see if that helps?

  23. #9083
    Seven Year Vet. BOW DOWN.
    Points: 14.794, Level: 78
    Level completed: 86%, Points required for next Level: 56
    Overall activity: 0%

    Registriert seit
    Dec 2005
    Ort
    Manchester, UK
    Beiträge
    2.240
    Points
    14.794
    Level
    78
    My Mood
    Cheerful
    Downloads
    1
    Uploads
    0

    Standard

    Ohhh yeah, Good point. I didn't even notice that, My bad. Anyway, I don't need help with this anymore, I got TacticalPenguin to show me another way to do it. Thanks anyway, though.

  24. #9084
    QJ Gamer Green
    Points: 4.034, Level: 40
    Level completed: 43%, Points required for next Level: 116
    Overall activity: 0%

    Registriert seit
    Jul 2008
    Beiträge
    467
    Points
    4.034
    Level
    40
    Downloads
    0
    Uploads
    0

    Standard

    Is Luaplayer or LuaplayerHM better?
    My Releases:
    ---------------------------------------------------
    [URL="http://forums.qj.net/showthread.php?t=145654"]ROFLFlasher[/URL]

    [URL="http://forums.qj.net/showthread.php?t=144892"]DTS MGS Edition[/URL]

    [URL="http://forums.qj.net/showthread.php?t=143735"]Arkanoid Deluxe Beta[/URL]

    [URL="http://forums.qj.net/showthread.php?p=2144700#post2144700"]SAVIOR![/URL]

  25. #9085
    QJ Gamer Green
    Points: 3.721, Level: 38
    Level completed: 48%, Points required for next Level: 79
    Overall activity: 0%

    Registriert seit
    Jan 2008
    Beiträge
    612
    Points
    3.721
    Level
    38
    Downloads
    0
    Uploads
    0

    Standard

    Depends what you want it for. If you want it for making a game, generally good ol 0.16 will be your best bet but if you need to use a bunch of oneline functions to make a crappy shell then go for HM, that's about all it's used for anyways.

  26. #9086
    QJ Gamer Green
    Points: 4.034, Level: 40
    Level completed: 43%, Points required for next Level: 116
    Overall activity: 0%

    Registriert seit
    Jul 2008
    Beiträge
    467
    Points
    4.034
    Level
    40
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von TurtlesPwn Beitrag anzeigen
    Depends what you want it for. If you want it for making a game, generally good ol 0.16 will be your best bet but if you need to use a bunch of oneline functions to make a crappy shell then go for HM, that's about all it's used for anyways.
    Ok because im currently using luaplayer 0.16 for my game just wanted to make sure
    My Releases:
    ---------------------------------------------------
    [URL="http://forums.qj.net/showthread.php?t=145654"]ROFLFlasher[/URL]

    [URL="http://forums.qj.net/showthread.php?t=144892"]DTS MGS Edition[/URL]

    [URL="http://forums.qj.net/showthread.php?t=143735"]Arkanoid Deluxe Beta[/URL]

    [URL="http://forums.qj.net/showthread.php?p=2144700#post2144700"]SAVIOR![/URL]

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

    Okay, just a couple of questions. First of all, is the easiest way to do a credits ending just putting the y values of each line of text as something like y + 5? Using this way I would have to write each line of credit individually and have to do a lot of estimation in order to get it write which is why I ask.

    Second, is there way to do fading effects by programming it? Like have one image fade into another or just have an image fade into black? I have searched but maybe I am looking for the wrong thing?

    Thanks,
    Daniel

  28. #9088
    QJ Gamer Blue
    Points: 4.268, Level: 41
    Level completed: 59%, Points required for next Level: 82
    Overall activity: 0%

    Registriert seit
    Apr 2008
    Beiträge
    497
    Points
    4.268
    Level
    41
    Downloads
    0
    Uploads
    0

    Standard

    Question, I need to mave an image accross the screen, during the game, but I don't want it to just appear, I need to be able to see the movement :) any help would be appreciated.

  29. #9089
    QJ Gamer Green
    Points: 4.034, Level: 40
    Level completed: 43%, Points required for next Level: 116
    Overall activity: 0%

    Registriert seit
    Jul 2008
    Beiträge
    467
    Points
    4.034
    Level
    40
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von PSProgramer Beitrag anzeigen
    Question, I need to mave an image accross the screen, during the game, but I don't want it to just appear, I need to be able to see the movement :) any help would be appreciated.
    You could make a table for the image
    For Example

    image = {}
    image.x = 60
    after this just make a simple code such as

    if blah blah blah then
    image.x = image.y + 5
    end

    then just blit the image
    screen:blit(image.x,image .y,image)

    that will move the image every loop
    My Releases:
    ---------------------------------------------------
    [URL="http://forums.qj.net/showthread.php?t=145654"]ROFLFlasher[/URL]

    [URL="http://forums.qj.net/showthread.php?t=144892"]DTS MGS Edition[/URL]

    [URL="http://forums.qj.net/showthread.php?t=143735"]Arkanoid Deluxe Beta[/URL]

    [URL="http://forums.qj.net/showthread.php?p=2144700#post2144700"]SAVIOR![/URL]

  30. #9090
    QJ Gamer Blue
    Points: 4.268, Level: 41
    Level completed: 59%, Points required for next Level: 82
    Overall activity: 0%

    Registriert seit
    Apr 2008
    Beiträge
    497
    Points
    4.268
    Level
    41
    Downloads
    0
    Uploads
    0

    Standard

    ... ummm mabey... but I don't think that would work for what I'm trying to do, but thanx. I think I figured it out. :)


 

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

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