Log In  

Humble beginnings!

This isn't much more than my own naive implementation for sprite-animation. The little cat can walk (looping animation), look up, lie down (transitional animation), and meow(non-interuptable animation). The current sprite is displayed in a box at the bottom left, together with some variables.

Cart #machi00-1 | 2020-08-03 | Code ▽ | Embed ▽ | No License
4

It may be bad and basic but I'm still a BIT proud of it.
I'll prolly expand this into an actual game at some point, would be a shame to let the cat sprites go to waste, nyohohee~
[0x0]

P#80282 2020-08-03 00:26 ( Edited 2020-08-04 23:03)

1

cat

P#80285 2020-08-03 00:52
2

That “meow” animation/sound is awesome

P#80312 2020-08-03 13:07
1

Yeah I find this cool. Will need to implement something like this into my game, so thanks for putting this up here (also it's not bad, at least for me). Also the code looks really complex - how long have you been using Pico-8?

P#80343 2020-08-04 16:06 ( Edited 2020-08-04 16:09)

@JCD
This is the first thing I ever coded in Pico8.
(Do have some coding experience in Python and Haskell however, so Lua was actually easier than previous languages haha)
Is the complexity good or bad? I was just attempting to make my code modular so I can expand it easily later on and reuse as much code as possible, hence the anims() function
ALSO, most of the scary looking code is just that stuff inside the _draw function! thats just for when you hold the button down for displaying all the "debug info" haha

P#80367 2020-08-04 23:06 ( Edited 2020-08-05 00:07)
1

@machi
The complexity (for me) is a little confusing, but I'm a really bad programmer.
I have a bit of experience with python, as I used it for fun for several years, but never got very advanced. Thanks for your reply!

P#80371 2020-08-05 06:09 ( Edited 2020-08-05 06:12)
1

@JCD
I shouldve been nicer to code-readers and document my code, so I'll just qwuickly do it here:
{
x=16, -- these two are coords
y=64,
lf=false, -- "lf" is a variable short for "left-facing". keeps track of wether I need to flip my sprite
t=0, -- short for "tick", a tick counter used for the animation
s=0, -- "state", needed to check what the character was doing the previous frame for animations
ns=0, -- "new state", like state, but for the current frame instead for the previous
vel=0, -- velocity
acc=.5, -- acceleration
spr=0 -- current sprite
}

P#80401 2020-08-05 22:53 ( Edited 2020-08-05 23:00)

@machi
Thanks, I appreciate the help

P#80406 2020-08-06 05:37

[Please log in to post a comment]

Follow Lexaloffle:          
Generated 2024-03-28 23:01:04 | 0.038s | Q:26