Results 1 to 2 of 2

Thread: LUA Help is needed.

  
  1. #1
    boomhowza is offline -Hacks Smarty
    Join Date
    Jul 2006
    Location
    Australia
    Posts
    149
    Rep Power
    14

    Default

    ive got my game all beautiful, and such but ive got 2 players on my screen (which i want) and p2 uses the x,o,tri,squ. and p1 use dir butons. i got them moing but theres a problem, THEY LOOK THE SAME. P2 is ment 2 look ANGRY :evil: and the other one is meant 2 be happy :bucktooth: . THEY BOTH LOOK HAPPY.

    if you can see a problem in this code just help me out.
    if you want to see the game im making 2 fix the code PM me and ill send you it.

    -- Smily Dude
    -- Author: BOOM

    System.usbDiskModeActivate()

    grass = Image.load("grass.png")
    player = Image.load("player.png")
    player2 = Image.load("player2.png")
    flower = Image.load("flower.png")

    screenwidth = 480 - player:width()
    screenheight = 272 - player:width()

    Player = { }
    Player[1] = { x = 200, y = 50 }
    Player2 = { }
    Player2[1] = { x = 100, y = 30 }

    while true do
    pad = Controls.read()
    screen:clear()

    for a = 0, 14 do
    for b = 0, 8 do
    screen:blit(32 * a, 32 * b, grass)
    end
    end

    screen:blit(100,100,flower)
    screen:blit(300,220,flower)
    screen:blit(Player[1].x,Player[1].y,player)
    screen:blit(Player2[1].x,Player2[1].y,player)

    if pad:left() and Player[1].x > 0 then
    Player[1].x = Player[1].x - 2
    end

    if pad:right() and Player[1].x < screenwidth then
    Player[1].x = Player[1].x + 2
    end

    if pad:up() and Player[1].y > 0 then
    Player[1].y = Player[1].y - 2
    end

    if pad:down() and Player[1].y < screenheight then
    Player[1].y = Player[1].y + 2
    end

    if pad:square() and Player2[1].x > 0 then
    Player2[1].x = Player2[1].x - 2
    end

    if pad:circle() and Player2[1].x < screenwidth then
    Player2[1].x = Player2[1].x + 2
    end

    if pad:triangle() and Player2[1].y > 0 then
    Player2[1].y = Player2[1].y - 2
    end

    if pad:cross() and Player2[1].y < screenheight then
    Player2[1].y = Player2[1].y + 2
    end

    screen.waitVblankStart()
    screen.flip()
    end
    yeah this code does look familyar, mm what could it hav been from, OH WELL.

    can any1 help


  2. #2
    soulkiller is offline -Hacks Smarty
    Join Date
    Jan 2006
    Location
    pffff I\'m not telling you
    Posts
    197
    Rep Power
    14

    Default

    change the blittiing line for player2 so it blits the player2 image and not the player1 image
    GOOGLE IS YOUR FREIND, USE IT. IF GOOGLE FAILS THEN REFER TO THIS LINK MQ:BtG Programmer

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •