Care 4 Strays
Feed and cure our little wandering friends!
Disclaimer: Most of the Sprites/Code used are taken through tutorials, videos and lots of chatting/suggestion/debugging from fellow Pico8ers.
A big thank you to anyone involved!
ToDo
Code
- Win condition - end game
- Code cleanup/refactoring
Sprites
- Distinguish hungry from ill Cat sprites
- Create more flora sprites (grass, flowers, trees)
Map
- Revamp map
- Create more levels (seasonal)
Music & Sounds
- Create theme
- Sounds for Player interactions
Known Bugs
- Sometimes after Player movement, its sprite does not reset to default (no 10)
- Animated tiles epic cat bug (to be recorded)
v1.0 (initial commit):
v1.1:
Bugfixes
- Fixed Player's sprite movement - going diagonal is now very smooth
- Fixed a bug where colliding with a Food sprite gave a quantity of 3 Food on the Inventory
- Door is now opening correctly when Player has a Key and collides with it
- Food is now correctly swapping tiles when Player collides with it
Changelog
- Collision now happens through Player's feet
- Revamp map
- Added medicine, extra key and ill cat
- Added collision sound
Hello,
I am new to Pico-8 and this is my first try of creating a game.
Need a little help with understanding my errors.
Known bugs so far:
- south and east wall-sprites (stones,water) does not work as intended (player dives into them till their very last pixel row/column)
- sprite does not reset to no10 when player not moving
- cat and door tiles are not replaced when the requiremens are met, while food tile is replaced with a wrong tile
While skimming through I noticed that you typed
if not player.moving then player.srpite = 10 end |
Obviously a typo, it should be player.sprite
.
As for the cat and door, the relevant function declarations lack parameters, thus swap_tile()
has no idea where to swap from. Instead of
function feed_cat() player.food -= 1 swap_tile(x,y) -- sound effect end |
it should be
function feed_cat(x,y) player.food -= 1 swap_tile(x,y) -- sound effect end |
You are already passing x and y as arguments when calling those functions inside of interact()
so that fix will do the trick.
For the food tile swap bug, remember swap_tile()
is currently set up so that the swapped out tile is replaced with the one to its right on the spritesheet.
To fix this, the simplest would be to modify your spritesheet so that a floor tile is to the right of each food item.
To be more efficient you would use variables to keep track of which ground sprite needs to be passed to mset, according to whether the food was picked up outside or inside.
For a first step you need to check the right and bottom of where the player is going to be.
This isn't perfect (gameplay wise) and it can be cleaner code but... This works.
function can_move(x,y) --player sprite is 8 chars local offset=1-(1/8) if is_tile(wall, x,y) then --collide on top left return false end if is_tile(wall, x+offset,y) then --collide on top right return false end if is_tile(wall, x,y+offset) then --collide on bottom left return false end if is_tile(wall, x+offset,y+offset) then --collide on bottom right return false end return true end``` See if you can undersand why that works. Ideally you would have a collision box smaller than the sprite for gameplay) |
@jneda lol, stupid me! It is still a little hard to keep track of my functions in such a small programming interface, I notice I do lots of those mistakes!. Thank you!
@SquidLight much appreciated again! :)
It happens to all of us.
I edited my message to suggest a solution about your tile swapping issues.
I laughed when I discovered cats turn into poop after you feed them. I'm a simple man of simple tastes.
Haha. ye me too (at least at these first levels) ^^
Just tried your game, can't get how to play though but I really like the graphics!
Thanks again :D
That's not a game, it's the pathfinding demo from Picozine issue #4.
[Please log in to post a comment]