Log In  
Follow
JoVaMi

I make games for you to enjoy

[ :: Read More :: ]

Cart #urlcat-0 | 2023-09-09 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
2


This is a demo I made as a challenge to create a whole game to fit in Pico 8 Education edition's URL functionality. The whole game fits into (EDIT: THE URL DOESN'T WORK ANYMORE, I'LL FIX IT SOON) this URL. 431 tokens and 1196 total characters, this was hard for me because im still learning new things everyday about pico 8.

Features:

  • Smooth Camera (Found it somewhere online, can't find the original. If you can find it telling me qould be greatly appreciated because I want to credit the original creator. )
  • Map to text Compression and vice versa (Also not my code. Couldn't really simplify this by modifying, because I don't understand it.)
  • too many one letter variables (Not really a feature. :/)
  • not perfect collision (It still works, so who's complaining?)
  • 64x64 resolution (Achieved through poke(24364,3))
  • 60 fps (Achieved by using _update60)

Behind the Scenes

Backstory

This game originally was posted on my blog around 2021 called duck game (the original main character was a duck.) and was created through to different templates and some knowledge on how lua works. 95% of the code wasn't mine and I unlisted it only to later delete it, because the collision was messed up and it wasn't really a game. Fast forward to a little over a month ago, i posted my first game Catatac and I remembered about the duck game, and tried to recreate it, BUT I wanted to create all of the code myself and that didn't turn out so well, got stuck on collision again (Curse you, collision!). Here is that project:

Cart #cat_col_broken-0 | 2023-09-09 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
2


I'll soon fix that project but right now it's still looking pretty ugly. Later I was scrolling through BBS the other day and went on my account, and clicked and looked at my unlisted, and turns out, I saved an older version of the duck game, missing some features and broken, still, but it's still the original! I saved the graphics and I had the idea to create it into a URL so I can't lose it anymore, and here I am, writing a post about it.
TLDR: Created game long time ago through copied code, deleted it out of shame, tried to recreate it, found a broken version of the game, stole graphics and created this.

How it was achieved

Once I got the older version, I started up a new project, found a camera that I can use (I still can't find the post, if you somehow know who made it, which is probably slim to none, please comment and tell me, because i want to credit them.) Created simple movement and collision, that is not perfect but works. Instead of creating a object for the player, all of the variables are independent variables, which would be bad because of organizing but this is a small project so who cares? created a map, and used Shrinko8 to compress the code. once I tried to save it to the URL, I couldn't. The problem was that it was to big. Here are some optimizations I made:

1. Optimizing sprite space

I had too many sprites that I didn't need, and I tried to keep most original sprites.

here is a before:

and here's an after:

This is self explanatory what I did here, but there were some revisions and specific optimizations made, like how the first 11 sprites (not counting the main character) are "walls" so I can just loop starting at 2 and going to 12 to find out what sprite is in front of the player. I got rid of similar sprites and created a mutual sprite, and I got rid of most decorations.

2. Using one main loop

Instead of using an _init, _update60, and _draw, I'm only using _update60 as a loop, to get rid of extra unneeded functions. here's a link to a explanation of how I did it.

3. Creating extra variables for constants that are used frequently

This is a no-brainer, but for sx and sy and some other variables, they all change by .2, so I just added a variable that is a constant of .2, and I used it 5 times, saving me 1 character! this is a small change, but it adds up if you keep doing simple tweaks like this. Here is a comprehensive list of tweaks like these if you want to optimize tokens (and sometimes characters) using small tweaks.

TLDR: Sprites take up too much, simplified it. Used only one main loop, and did lots of small tweaks.

Problems along the way

By far the biggest problem I had was character count and that there is a caveat to the URL feature:
map's didn't save in the URL.
I almost gave up because of this problem but I found the map to text converter (here) and I figured out how to implement it. The only limitation now is that I will need space to store the text, and I have a limited character count. A small solution was to optimize even further and zoom in the camera to create the map bigger. the map spans a total of 4 screens, the house, school, store, and sea, when it used to take up alot more space, specifically the whole map size, not including the shared space. some excluded areas were the lake, the flower field, the forest, and the caves, which took up most of the space because it was a maze. It's funny how you're reading this now, which means you've read my text dump on how I created this game, so thank you, person on the internet.

TLDR: Had to create map smaller to fit into a string, zoomed in camera to make it "feel" bigger.

Credits:

  • @dw817: Used his Map to text/Text to map code, click here for the cartridge
  • @thisismypassword: Shrinko8 was used heavily for this project, everytime i made a change I used this to compress it even more. I highly recommend using this tool, click here for the post
  • unknown creator: for creating the camera I used, can't find the original post anywhere, so I can't credit him/her directly.
P#134094 2023-09-09 17:05 ( Edited 2023-09-09 17:36)

[ :: Read More :: ]

Cart #catatac_v1-1 | 2023-07-31 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
6

How to play

Move - Use arrow keys

Shoot Bullet - Press/Hold X/V

Shoot Special Bullet - Press/Hold Z/C

Rules

Catatac is a Shmup (Shoot-em-up) game in which you control a ship and you need to defeat the evil cats with your laser beam. You have 6 different ships to choose, 5 powerups to get, and 8 types of enemies to defeat!

Bugs/suggestions

If you experience a bug, comment below and describe the bug in detail, and what version your playing on. You can check the version on the top left corner in the start screen.

If you have a suggestion, comment below with the suggestion and i might add it in the next update, if i dont run out of token space.

Behind the scenes

(Its hidden because there is too much text, so if you don't want to see it, don't click it.)


This game took me a total of 41 days to finish, but I got lazy on some days so its more of a 27-33 days. The project originally started on August 21 2022, but I stopped working on it because of complications. Then, I rediscovered the tutorial that krystman created and decided "why not give it another shot?" and so the journey began again.

The farthest I've got on my first attempt, around 4 videos in on the tutorial

first few days were pretty quick on implementing the basics, because I was following the tutorial and not deviating and creating my own things.

By the time I reached the middle of the tutorial, I decided I wanted to make different difficulties stuff, so I created different ships. One of the problems I had was that my powerup's are not working, because in the tutorial there is 1 powerup which is much simpler than what I have, and I overcomplicated the program by making another bullet object, pbul (stands for powerup bullet). Because of that, I had to add more logic and not break the program without any help. When I finally fixed the problem, I closed my laptop and took a break, but when I came back, I realized I didn't save my progress and I forgot to put my laptop on charge, so I lost 4-5 days of work creating the powerup system, creating the difficulty system and fixing many bugs. I almost quit at that moment, and wasn't developing the game for a couple of days, so I lost some time and had less days before my deadline, July 31, 2023.

This is right before I started implementing the powerups

The reason I set a harsh deadline is because on my first attempt I did not have one and I just thought I can "finish it later", and we all know how that turned out, so this time I set a harsh deadline to finish it by the end of July, so at least I had a messy, but finished game than a polished not finished game. I plan on expanding on this game, adding new features and maybe reworking the entire game from scratch(?) but that's for future me to worry about.

TLDR: First attempt failed because of complications, Second attempt almost failed because i forgot to save once, learned my lesson to save frequently and to set deadlines.

Credits

Me: For not giving up on this project.

Lazy Devs: For creating the tutorial, without it I would not have posted anything. If you want to create something like this, I'd highly recommend his Youtube tutorial.

Aktane: For inspiring the star movement when the ship moves

P#132613 2023-07-31 23:20 ( Edited 2023-07-31 23:23)

Follow Lexaloffle:          
Generated 2024-04-19 00:16:04 | 0.082s | Q:17