![]() |
| Forums | Gaming News | Videos | Downloads | Today's Posts | Mark Forums Read | Chat | FAQ | Members List | Contact |
| ||||||
This is a discussion on [release] my mod of lua animLib v4 now v0.3 maybe last within the PSP Development Forum forums, part of the PSP Development, Hacks, and Homebrew category; Hi, Here's my 2nd lua library, in fact a mod of an existing library: animLib v4 by Grimfate126. I changed ...
![]() |
|
|
LinkBack | Thread Tools |
|
|
#1 |
![]() ![]() ![]() Developer
|
Hi,
Here's my 2nd lua library, in fact a mod of an existing library: animLib v4 by Grimfate126. I changed a lot of things, and added also a lot, mainly image buffering so that animations share common image ressources. For those who don't know animLib, this allows you to easily create animations based on multiple images or on spritesheets. And for those who use animLib and wish to change for this mod, I'm sorry but you'll have to rewrite parts of your code because I changed a lot of things. But I think it's worth the -little- trouble. As it's the first release and although I tested it intensively, there may be bugs or things missing or things you wouldn't expect to behave like it does... If it's the case report it there. I'm developping a game with it and for the moment it does what I need in a great way. I included a long readme with explanations for everything and an index.lua which will create a bunch of animations and show you how to do things. Here is the file: animLib daaa's mod v0.1 animLib daaa's mod v0.2 (only added width() and height() function to smoothly replace your images in your code) animLib daaa's mod v0.3 Spoiler for readme.txt:
Last edited by daaa57150; 05-03-2007 at 06:06 AM.. |
|
|
|
|
|
#3 | |
![]() ![]() ![]() Developer
|
Quote:
|
|
|
|
|
|
|
#4 |
![]() ![]() total-Z
|
This is great man thanks screen:blit doesnt work for me this will make everything so much easier its what everyone needs thanks again
__________________
牧来栠摩琠敨映汩獥PSN: youresam From Earth the Frozen Ipaqs shall rise and be silenced and all will live free.
--Mike Hollingsworth |
|
|
|
|
|
#5 |
![]() |
Nice, but how can I mod it to make this work:
Code:
function collision(obj1, obj2) if (obj1.x >= obj2.x or obj1.x + obj1.img:width() >= obj2.x) and (obj1.x <= obj2.x + obj2.img:width() or obj1.x <= obj2.x + obj2.img:width())then if (obj1.y >= obj2.y or obj1.y + obj1.img:height() >= obj2.y) and (obj1.y <= obj2.y + obj2.img:height() or obj1.y + obj1.img:height() <= obj2.y + obj2.img:height()) then return true end else return false end end |
|
|
|
|
|
#6 | |
![]() ![]() ![]() Developer
|
Quote:
animLib daaa's mod v0.2 your "obj1.img" should be the animation so that your "obj1.img:height()" and such will work. I think it's what you want. -= Double Post =- Oh and you function seems to miss some cases there are cases it returns nothing. Not a problem in Lua as it will consider returning nil and nil is equivalent to false, but if sometime you want to program with another language: Code:
function collision(obj1, obj2) if <cases> then if <cases> then return true missing else return false end else return false end end Code:
function collision(obj1, obj2) if <cases> then if <cases> then return true end end return false end Last edited by daaa57150; 04-18-2007 at 12:17 AM.. Reason: Automerged Doublepost |
|
|
|
|
|
|
#7 | |
![]() ![]() Developer in Making...
|
Quote:
__________________
NEWMy New BLOG!NEW The Wentire Worls in two Sectors.... When did I get dev statz?Spoiler for my PSP homebrewReleases:
Spoiler for Great Quotes:
|
|
|
|
|
|
|
#8 | |
![]() ![]() ![]() Developer
|
Quote:
![]() Sorry I don't want to code in c for the PSP. But it should be easy to translate. |
|
|
|
|
|
|
#9 |
![]() |
Hey thanks, that works great!
As for that cases thing, I just did a little test and (in lua at least) you don't need to put any "return false" statements in a function like this. It seems that unless you have a "return true" statement, it automatically returns as false. Also, for that second example you gave, are you sure that one would work? I haven't tried it, but it seems like since you don't have the "return false" inside an if statement, it would automatically return false even if the case for "return true" was true. I've also thought of something else that can be added - a reverse toggle. If you've got an animation of for changing the direction a sprite is facing, the way it is now you would have to create a second animation if you wanted to reverse it. Having a toggle to run the animation in reverse would save on the memory that would be needed for the second animation. |
|
|
|
|
|
#10 | |
![]() ![]() total-Z
|
Quote:
__________________
牧来栠摩琠敨映汩獥PSN: youresam From Earth the Frozen Ipaqs shall rise and be silenced and all will live free.
--Mike Hollingsworth |
|
|
|
|
|
|
#12 | ||
![]() ![]() ![]() Developer
|
Quote:
Quote:
|
||
|
|
|
|
|
#13 | |
![]() ![]() total-Z
|
Quote:
__________________
牧来栠摩琠敨映汩獥PSN: youresam From Earth the Frozen Ipaqs shall rise and be silenced and all will live free.
--Mike Hollingsworth |
|
|
|
|
|
|
#14 | |
![]() |
Quote:
|
|
|
|
|
|
|
#15 | |
![]() ![]() Your Fate is Grim...
|
Quote:
__________________
-------------------------------------------------------------------------------------- ![]() |
|
|
|
|
|
|
#16 | ||
![]() ![]() ![]() Developer
|
Quote:
. Can you PM me those flipping functions?Quote:
. But it's not so trivial to do and for the moment I'm working on another library so I'll think of this later. Keep thinking on ideas Merick.I found a bug in v0.2: line 190 : self.loops = numloops should be : self.loops = self.numloops correct it until I release next version. this bug can result in a crash saying "comparing nil with number" if you try to use finishedLooping() after a blit on multiple images animations. Last edited by daaa57150; 04-20-2007 at 12:55 AM.. Reason: Automerged Doublepost |
||
|
|
|
|
|
#17 |
![]() ![]() ![]() Developer
|
Hey guys here's a new version, where I changed some small things and corrected others:
http://www.box.net/shared/pm42eqmsod The changes: Code:
added fps counter on the demo corrected a bug in ANIM:blit() added pixel() and save() methods so now you have all the getter methods existing on images optimized spriteSheet animations (no more calculations on blit) corrected a copy/paste bug in setMaxLoops() for spriteSheets added frameChanged() method The frameChanged method tells you if the picture changed before your last blit on the animation object, useful to spare some blittings, if you want to optimize a bit. -= Double Post =- ---- Also, if people are willing to help me, here is my current project (wanted to call it "mega puyo drop attack portable" ):A puzzle game It should run in any luaplayer 0.16 to 0.20 but I use it with 0.17dk (a modded version of 0.17 that allows overclocking). If you want to help a little, just play the game and tell me how long it lasts before freezing for you. If you are super motivated, I'd be super happy to know what's wrong, if you can find it in that mess (yeah it's not cleaned, I always do things fast and clean/improve/comment after). That is, if you believe my code is the cause, I seriously think it's the player's fault. Last edited by daaa57150; 05-03-2007 at 06:31 AM.. Reason: Automerged Doublepost |
|
|
|
|
|
#18 |
![]() |
Hmm... 35 different scripts? I've only just downloaded the game and haven't really had time to go through it yet, but a quick look through the file directories makes me think that the problem might be that you're trying to use too many dofiles
*edit* With lua player v0.20 I get Error: initialization.lua:93: Image.load: Error loading image. However, in cools mod 3 I've played it for almost 30 minutes with no freezing or crashes. The problems you're having are probably because you're using an older version of the player. Last edited by Merick; 05-03-2007 at 02:48 PM.. |
|
|
|
|
|
#19 |
![]() ![]() PSP Developer
Join Date: Oct 2005
Real First Name: Alex
Location: ~* Confidential *~
Just Played: N/A
Posts: 839
Trader Feedback: 0
|
Interesting work.
Although, I still like my AnimatedSprite Class/Library stuff that I created. I believe that mine might be better, but that's probably pride or something .I am in the process of making it way better than before, but it may be a while before I release it to the public. Also, good luck on this and ur game
__________________
![]() "Every team needs an idealistic person (whether they are a noob or a pro), my team doesn't have one cus im the idealistic founder."-me Anime/Manga and Fanfiction is my inspiration! Creator of: - PSPSDK makefile creator - Lua Prompt - Animated Sprite Class\Library for Lua - Gmax2PSP - |
|
|
|
|
|
#20 | |||||
![]() ![]() ![]() Developer
|
Quote:
Quote:
*edit* : I just tested and I got an error "cannot create image", my guess is that the memory is completely full. Quote:
And since you tested that thing, what do you think about it? Was that fun? You have to imagine it with some techno/electro music and sfx. -= Double Post =- Quote:
But seriously what's wrong with yours is that there is no explanation, no example, nothing. Why not write a little howto, some examples and comment your functions? Or did I miss the explanations? Quote:
Last edited by daaa57150; 05-04-2007 at 12:07 AM.. Reason: Automerged Doublepost |
|||||
|
|
|
|
|
#22 | |
![]() ![]() ![]() Developer
|
Quote:
|
|
|
|
|
|
|
#23 | |
![]() ![]() PSP Developer
Join Date: Oct 2005
Real First Name: Alex
Location: ~* Confidential *~
Just Played: N/A
Posts: 839
Trader Feedback: 0
|
Quote:
Edit: Oops... I forgot to include the doc and example that's in v2.0...
__________________
![]() "Every team needs an idealistic person (whether they are a noob or a pro), my team doesn't have one cus im the idealistic founder."-me Anime/Manga and Fanfiction is my inspiration! Creator of: - PSPSDK makefile creator - Lua Prompt - Animated Sprite Class\Library for Lua - Gmax2PSP - |
|
|
|
|
|
|
#24 |
|
hey, thanks for you work, i got it to work, however, after i started adding many different animations based on player states, i keep getting this error, and I can't figure out why:
C:\Projects\game2>luaplay er script.lua error: ./Scripts/animLibDaaa.lua:151: Image.load: Error loading image. C:\Projects\game2>pause Press any key to continue . . . is there a limit to the number of frames per animation? is there a limit to the number of animations you can have? anyone have an idea on this? thanks |
|
|
|
|
|
|
#25 | |
![]() ![]() ...in a dream...
|
Quote:
) It'd be nice to make one for OSlib ^^ (by the way, saying "now make on in C" is ambiguous considering there's atleast a 7 different graphics libraries (someone should make a list linking to each giving descriptions and what they're meant for/good at )
__________________
...you'll never know what it's like... spending your whole life in a dream...
Launch a Kitten out of a Cannon and win real cash! Checkout my newly updated site for all my projects (Kitten Cannon, BOXHEAD, Light Cycle 3D) |
|
|
|
|
|
|
#26 | |
![]() ![]() ![]() Developer
|
Quote:
There is no limit to the number of frames per animation nor to the number of animations you can have, the only limit is the RAM size. Oh and the images cannot be bigger than 512x512, that's why I don't like spritesheets. |
|
|
|
|
![]() |
| Tags |
| animlib , lua , mod , release , v03 |
| Thread Tools | |
|
|