Results 1 to 8 of 8

Thread: help with my platform game please!

                  
   
  1. #1
    Wii User shiftybill's Avatar
    Join Date
    Nov 2005
    Location
    The dark side of the moon
    Posts
    221
    Rep Power
    68

    Default help with my platform game please!

    heya all i decided to make a simple megaman game in LUA

    im having trouble displaying some of the pictures heres some of my code

    function input()
    pad = Controls.read()
    if pad:left() or pad:right() == true then
    move = true
    else
    move = false
    end
    if move == true then
    if pad:left() then
    stance = mmrunleft
    lastdir = left
    end
    if pad:right() then
    stance = mmrunright
    lastdir = right
    end
    end

    if move == false then
    if lastdir == left then
    stance = mmstandleft
    end
    if lastdir == right then
    stance = mmstandright
    end
    end
    end

    while true do

    input()

    screen:blit(playerx, playery, stance[picnumber], true)

    end
    when i let go of either the left or right button it always displays the standing right pictures, I dont know how to fix this plese help me!

  2. #2

    Default

    You should add:
    screen:waitVblankStart()
    screen:flip()
    After the screen:blit

    I think it will also be better not to blit the player directly on the screen but on an image and to blit the image on the screen later on.

    something like:
    board:clear()

    board:blit(0, 0, background, 0, 0, background:width(), background:height(), false)
    board:blit(playerx, playery, stance[picnumber], true)
    screen:blit(0, 0, board)


    Before the loop create the board image like this:
    board = Image.createEmpty(480, 272)

    and load the background image (called here background ) like this:
    background = Image.load("background.png")

    By doing this it shold avoir some flickering.

  3. #3
    Wii User shiftybill's Avatar
    Join Date
    Nov 2005
    Location
    The dark side of the moon
    Posts
    221
    Rep Power
    68

    Default

    Thanks for your advice, I will add that to my game.

    Yet I still cant get the correct images to be displayed.

  4. #4
    Wii User shiftybill's Avatar
    Join Date
    Nov 2005
    Location
    The dark side of the moon
    Posts
    221
    Rep Power
    68

    Default

    ok thanks for the help so far, i have all the running and jumping pictures working!

    but now I need some help with collision, i have it working but when you scroll the background it scrolls the image but not the collision stuff, its hard to explain, its like the background is still in the same place, yet its moving

    thx in adv. it late and im tired heres a little demo

    http://www.freewebs.com/shifthouse/MegaMan.zip

  5. #5
    DCEmu Rookie .:PSP1.0:.'s Avatar
    Join Date
    Nov 2005
    Posts
    221
    Rep Power
    68

    Default

    Hey man really interested in what it looks like but the link you posted only bring me back to this page..

  6. #6
    Won Hung Lo wraggster's Avatar
    Join Date
    Apr 2003
    Location
    Nottingham, England
    Age
    52
    Posts
    139,552
    Blog Entries
    3209
    Rep Power
    50

    Default

    upload to this forum, makes it easy to download

  7. #7
    Wii User shiftybill's Avatar
    Join Date
    Nov 2005
    Location
    The dark side of the moon
    Posts
    221
    Rep Power
    68

    Default

    if u copy then paste the link in a new window it will work

  8. #8

    Default

    You need to set your collision map to the coordinates of your scroll, I'm not sure this is your problem cause your code is a bit hard to read especially for a newby like me, if you woul put tiles to your code parts with -- it would be easier to elp you.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

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