Results 1 to 6 of 6

Thread: [LUA] how walk out of the screen ? please help

  
  1. #1
    stevendmm is offline -Hacks Newbie
    Join Date
    Apr 2007
    Posts
    2
    Rep Power
    0

    Default

    Hello,
    I have a question,

    I making a game like "zelda" (sort of) but how can I walk out of the screen and see a new piece of land? (something like the camera is following the player...)
    I can already move to al directions, but when I walk out of the screen my guy is gone (normal of cours)


    Can somebody tell me a script of tutorial ?
    :idea:

    Please help,
    Thanx in advance!
    Steven


  2. #2
    pirata nervo is offline Programmer -Hacks Titan
    Join Date
    Mar 2007
    Posts
    5,529
    Rep Power
    18

    Default

    C or C++ is more simple you can set the collision of the screen and make a map:

    see this-> http://www.psp-hacks.com/forums/view...850561#p850561
    Its C/C++ !!! :mrgreenthumbsup:
    Console Addicted - The news about your console, every day!
    Console Addicted Forums

  3. #3
    stevendmm is offline -Hacks Newbie
    Join Date
    Apr 2007
    Posts
    2
    Rep Power
    0

    Default

    Hello, thanx for your reply,

    Because of a lot troubles setting up my pc with C++ tools,
    I started out with LUAcode...

    But that link you gave me is exactly what I am looking for,
    but only in LUA-language... :cool:

    So if anyone now how to do such thing with LUA... PLEASE HELP !

    I'm stuck with my game now...

    Thanx already !
    Grz
    Steven

  4. #4
    Zora 182 is offline -Hacks Enthusiast
    Join Date
    Jun 2006
    Location
    Hyrule Rank:Hero
    Posts
    418
    Rep Power
    14

    Default

    ok, so you want to make the screen follow your character, eh?
    then instead of making the character move (x = x + 2, y = y + 2) make the game move instead!
    so it would be:

    if pad:up() then
    object.y = object.y + 2
    bg.y = bg.y + 2
    end

    if pad:down() then
    object.y = object.y - 2
    bg.y = bg.y - 2
    end

    if pad:right() then
    object.x = object.x - 2
    bg.x = bg.x - 2
    end

    if pad:left() then
    object.x = object.x + 2
    bg.x = bg.x + 2
    end

    get it?
    I hope this helps...
    (p.s. to make the game look good, you'll need various bgs and make them scroll, if you need help on that, I can try to show you ;) )

  5. #5
    originalfragster is offline -Hacks Newbie
    Join Date
    Nov 2006
    Location
    New Zealand
    Posts
    48
    Rep Power
    14

    Default

    you could create a tonne of functions for each "screen" and create a screen x & y variable. Then before each function in your main code, check if x==something and y==something.

    What is up with me and functions lately... lol :mrgreenthumbsup:

  6. #6
    Blade_punk's Avatar
    Blade_punk is offline Programmer -Hacks Guru
    Join Date
    Nov 2006
    Location
    Candy Mountain
    Posts
    2,314
    Rep Power
    16

    Default

    you could also have:

    Code:
    if Player.x + PlayerWidth == 480 then
    screen:blit(Next Area)
    Player.x = 1
    end
    thats so that when you reach the end of the screen, it blits the next area

    and Pirata, stop trying to convert people! :mrgreen:

    -Rock Station-
    PSN: Xsjado7


Posting Permissions

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