Page 19 of 58 FirstFirst ... 915161718192021222329 ... LastLast
Results 181 to 190 of 577

Thread: sora adventure0.1 first attempt at lua

                  
   
  1. #181

  2. #182
    DCEmu Pro
    Join Date
    May 2006
    Posts
    575
    Rep Power
    72

    Default

    wow you are well tooled up with these and I am glad too. I am proud to be working with you and Gunn when I see this type of stuff


    Sadly I am unaware of the world names for the games and cartoons etc you asked for Sir however i have wondered, did Super Mario World even have a name for the worlds? there were places like the desert zone, water zone etc.

  3. #183
    GP2X Coder/Moderator
    Join Date
    Jan 2006
    Posts
    1,678
    Rep Power
    88

    Default

    Quote Originally Posted by gunntims0103
    dddaaaaaaaaaaaammmmmmmmmmm

    i cant get the attacks to work im doing somethin wrong im fustrated now sorry guys im gonna need help with this i though it would be simple i put sum attack sprites in the game and then tried the game but i keep getting script error maybe i have a falty code sum were or sumthin il get bac to ya
    Upload the latest snapshot of the code, I take a look at it.

  4. #184
    DCEmu Legend gunntims0103's Avatar
    Join Date
    May 2006
    Location
    Brentwood, NY
    Age
    34
    Posts
    2,976
    Rep Power
    112

    Default the code im using

    Quote Originally Posted by yaustar
    Upload the latest snapshot of the code, I take a look at it.
    this is the code i use

    if pad:square() then
    state = attack_r[W_FRAME]
    W_TIMER = W_TIMER - 1
    if W_TIMER == 0 then
    W_FRAME = W_FRAME + 1
    W_TIMER = 6
    end
    if W_FRAME == 4 then
    W_FRAME = 1
    end

    and the code for loading the attack images is

    --attacks
    attack_r = {}
    attack_r[1] = image.load("sora_ar/attack-1.png")
    attack_r[2] = image.load("sora_ar/attack-2.png")

    state = attack_r [W_FRAME]

    but its not working i must be doing sum thing wrong

    i appresiate the help

  5. #185
    GP2X Coder/Moderator
    Join Date
    Jan 2006
    Posts
    1,678
    Rep Power
    88

    Default

    In you control part of your code, the frames are going from 1-3, you only have 2 frames loaded as graphics. Frames 1 and 2 are okay but when it trys this operation:

    state = attack_r[W_FRAME]

    when W_FRAME is 3, then it crashes because that memory/variable/whatever doesn't exist.

    Change:
    if W_FRAME == 4 then
    W_FRAME = 1
    to
    if W_FRAME == 3 then
    W_FRAME = 1

  6. #186
    DCEmu Legend gunntims0103's Avatar
    Join Date
    May 2006
    Location
    Brentwood, NY
    Age
    34
    Posts
    2,976
    Rep Power
    112

    Default here it is

    yaustar here the 0.2 test version of the game there lies the entire code please feel free to mess with it as much as you can as i am still a noob at coding

    i have fixed the annoying black block around sora
    i changed the backround
    trying to implment attacks
    i have the floder with soras attacks
    try to fix the code for me my brain hurts

  7. #187
    GP2X Coder/Moderator
    Join Date
    Jan 2006
    Posts
    1,678
    Rep Power
    88

    Default

    I edited my previous reply. See if that works.

  8. #188
    GP2X Coder/Moderator
    Join Date
    Jan 2006
    Posts
    1,678
    Rep Power
    88

    Default

    Well I fixed as much as I could without changing all the code but there is a BIG problem with the way you are handling your frame animation.

    Each animation at present has a different number of frames, for example attack has 2 and movement has 3 but you are using the same frame counter (W_FRAME) to access the table/array of images.

    Imagine
    You move right, you are now using Run_r[W_FRAME] where W_FRAME is 3 as your state. You hit attack, now it tries to assign attack_r[3] to state which doesn't work because attack_r[3] doesn't exist to blit.

    Another problem is the way you are naming your variables. Some start in lower case whilst others in upper case eg:
    Run_r and attack_r

    Keep to one style.

  9. #189

  10. #190
    DCEmu Legend gunntims0103's Avatar
    Join Date
    May 2006
    Location
    Brentwood, NY
    Age
    34
    Posts
    2,976
    Rep Power
    112

    Default

    Quote Originally Posted by yaustar
    Well I fixed as much as I could without changing all the code but there is a BIG problem with the way you are handling your frame animation.

    Each animation at present has a different number of frames, for example attack has 2 and movement has 3 but you are using the same frame counter (W_FRAME) to access the table/array of images.

    Imagine
    You move right, you are now using Run_r[W_FRAME] where W_FRAME is 3 as your state. You hit attack, now it tries to assign attack_r[3] to state which doesn't work because attack_r[3] doesn't exist to blit.

    Another problem is the way you are naming your variables. Some start in lower case whilst others in upper case eg:
    Run_r and attack_r

    Keep to one style.
    thanx so much i will definitly take your feed back into accont and i will try to fix the script in the way i set up my variables etc....

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
  •