The above video goes away if you are a member and logged in, so log in now!




 
Would you like to get all the newest Gaming News from
QJ.NET in your email each day?




Want to learn more about the team who brings you the QJ news?

Read about them now!

 


Results 1 to 9 of 9

lua animation

This is a discussion on lua animation within the PSP Development Forum forums, part of the PSP Development, Hacks, and Homebrew category; im sorry if i sound like a n00b to lua but i am so ill try to make sense:) i ...

  
  1. #1
    QJ Gamer Silver
    Points: 8,653, Level: 62
    Level completed: 68%, Points required for next Level: 97
    Overall activity: 0%

    Join Date
    Oct 2006
    Posts
    1,043
    QJ Pts
    8,653
    Level
    62
    Downloads
    0
    Uploads
    0

    Question lua animation

    im sorry if i sound like a n00b to lua but i am so ill try to make sense:) i just have a few questions. is moving a character a matter of using sprites, button imput, the x/y things and in/then statements to make the sprite move to the left or right? like (i know its not lua, just an example) if lpad button: then move image.png 5 pixels to the right? hope im making sense. please no flaming.

  2. #2
    QJ Gamer Green
    Points: 7,803, Level: 59
    Level completed: 27%, Points required for next Level: 147
    Overall activity: 0%

    Join Date
    Dec 2006
    Location
    main();
    Posts
    1,071
    QJ Pts
    7,803
    Level
    59
    Downloads
    0
    Uploads
    0

    Default

    taken from an example given to me by soulkiller

    Code:
    white = Color.new(255, 255, 255)
    
    spr1 = Image.load("images/spr1.jpg") --thats white btw ;)
     
    player = {
       x = 80,
       y = 80,
    }
    screen:clear()
    screen:print(80, 80, "Press Start To Begin Moving", white)
    screen.flip()
    while true do
    	pad = Controls.read()
    	if pad:start() then
    		break
    	end
            screen.waitVblankStart()
    end
    while true do
            pad = Controls.read()
            screen:clear()
    	if pad:left() then
    		player.x = player.x - 5
    	end
    	if pad:right() then
    		player.x = player.x + 5
    	end
    	if pad:up() then
    		player.y = player.y + 5
    	end
    	if pad:down() then
    		player.y = player.y - 5
    	end
            screen:blit(player.x,player.y,spr1)
            screen.flip()
            screen.waitVblankStart()
    end

  3. #3
    QJ Gamer Silver
    Points: 7,278, Level: 56
    Level completed: 64%, Points required for next Level: 72
    Overall activity: 0%

    Join Date
    Oct 2006
    Location
    Pimp'en in the US F#
    Posts
    1,254
    QJ Pts
    7,278
    Level
    56
    Downloads
    0
    Uploads
    0

    Default

    OR, you can use Grimfate's animLib, wich is a library for lua animations, (with this you can do an animation in two lines, one to load it, and another to blit it.) just google it or search these forums to find it, its VERY use full, and if you do use it, be sure to give a much derserved THANKS to Grimfate!

    also, the above example, (although correct) isn't really "animation", it just moves the player,

    im telling you man, its very very very useful (thanks so much Grimfate!!!!)

    PS. Doom kicks ass, nice Avitar! you play Zdaemon?
    The Wentire Worls in two Sectors....
    When did I get dev statz?
    Spoiler for my PSP homebrewReleases:
    Ace of Space V1|PvP Pong Online|PvP Pong v3 | 3.03 BlackShark Custom Firmware
    (PvP Pong DL'ed well over 2403 times combined! get yours now!)
    Spoiler for Great Quotes:

    "No Snowflake in an Avalanche ever feels responsible....." - Fortune Cookie.

  4. #4
    QJ Gamer Silver
    Points: 8,653, Level: 62
    Level completed: 68%, Points required for next Level: 97
    Overall activity: 0%

    Join Date
    Oct 2006
    Posts
    1,043
    QJ Pts
    8,653
    Level
    62
    Downloads
    0
    Uploads
    0

    Default

    i dont know what zdaemon is, is it like zdoomgl? yea i love doom. ive got doom 1, 2, and final doom on my PSP. so whats the difference between moving the character and animation? thanks:)

  5. #5
    Your Fate is Grim...
    Points: 11,640, Level: 70
    Level completed: 98%, Points required for next Level: 10
    Overall activity: 0%

    Join Date
    Oct 2005
    Posts
    2,269
    QJ Pts
    11,640
    Level
    70
    Downloads
    0
    Uploads
    0

    Default

    Quote Originally Posted by nosushi4you
    i dont know what zdaemon is, is it like zdoomgl? yea i love doom. ive got doom 1, 2, and final doom on my PSP. so whats the difference between moving the character and animation? thanks:)
    moving a character is when the x/y position of the char changes. animation is when the image of the char animates.
    --------------------------------------------------------------------------------------

  6. #6
    QJ Gamer Silver
    Points: 8,653, Level: 62
    Level completed: 68%, Points required for next Level: 97
    Overall activity: 0%

    Join Date
    Oct 2006
    Posts
    1,043
    QJ Pts
    8,653
    Level
    62
    Downloads
    0
    Uploads
    0

    Default

    so would it be a thing like stop motion animation like if l is pressed load image one if l is pressed load im age 2 type of thing?

  7. #7
    Your Fate is Grim...
    Points: 11,640, Level: 70
    Level completed: 98%, Points required for next Level: 10
    Overall activity: 0%

    Join Date
    Oct 2005
    Posts
    2,269
    QJ Pts
    11,640
    Level
    70
    Downloads
    0
    Uploads
    0

    Default

    Quote Originally Posted by nosushi4you
    so would it be a thing like stop motion animation like if l is pressed load image one if l is pressed load im age 2 type of thing?

    umm, sorry, but that made no sense to me. :Cry: can you make it a bit clearer? thanks.
    --------------------------------------------------------------------------------------

  8. #8
    QJ Gamer Silver
    Points: 8,653, Level: 62
    Level completed: 68%, Points required for next Level: 97
    Overall activity: 0%

    Join Date
    Oct 2006
    Posts
    1,043
    QJ Pts
    8,653
    Level
    62
    Downloads
    0
    Uploads
    0

    Default

    sorry, i was typing really fast there and i guess my brain got ahead of me. lol. what i meant was, is it like stop motion animation. like you make different pictures of someone in frames. like for example, with walking, would you make one picture of him with his leg a little off the ground and then another with his leg a little higher and so on until you can load then in order to make the person walk? i hope that made sense:) im trying to get the hang of lua cause i know the basics and button imput but i need to find out how to make the animation to create a game. thanks very much:)

  9. #9
    QJ Gamer Silver
    Points: 7,278, Level: 56
    Level completed: 64%, Points required for next Level: 72
    Overall activity: 0%

    Join Date
    Oct 2006
    Location
    Pimp'en in the US F#
    Posts
    1,254
    QJ Pts
    7,278
    Level
    56
    Downloads
    0
    Uploads
    0

    Default

    hehe, ya, im a n00b too :) i made my first game just a little while ago PvP Pong, but that contains no animation, check out my [WiP] thats in my signiture Fight for Freedom, and get the ALPHA release, it has a good example of Animation, feel free to use the animation code if ya want, :)
    The Wentire Worls in two Sectors....
    When did I get dev statz?
    Spoiler for my PSP homebrewReleases:
    Ace of Space V1|PvP Pong Online|PvP Pong v3 | 3.03 BlackShark Custom Firmware
    (PvP Pong DL'ed well over 2403 times combined! get yours now!)
    Spoiler for Great Quotes:

    "No Snowflake in an Avalanche ever feels responsible....." - Fortune Cookie.


 

Tags for this Thread

Posting Permissions

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





All times are GMT -8. The time now is 01:12 AM.

Use of this Web site constitutes acceptance of the TERMS & CONDITIONS and PRIVACY POLICY
Copyright © 2013, Caputo Media, LLC. All Rights Reserved. Cluster C4.
Contact Us | Free Flash Games | Ad Blockers Suck! Why?