More PICO-8 Gamedev - Retro Camera, Abilites
Tags: gamedev, lua, pixelart
Published: 2022-06-19 20:40:22

> This article was taken from my Ko-Fi page, where you check more of my stuff! If you like what I do, you can support me with a price of a single coffee!
[![ko-fi](https://www.ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/L4L81GBPX)


This week was quite active for me on the gamedev side, thanks to the bug I fixed [last time](https://ko-fi.com/post/Health-Update-and-Actual-Gamedev-J3J7D7369). It opened up the project for more fun stuff and helped to relieve some stress that was building up due to the issue, so let's see what was done!

 

**Retro Camera:**

If you’ve seen past gifs about the project you can pretty much notice one thing that may be bothering you. The smallest change in the player's position drags the camera immediately. This is due how the camera is moved atm, as I just assign the player coordinates to it’s center, which may cause some issues with how quickly it snaps and jiggles as you move around and I wanted to avoid that at all cost.


![Retro Camera](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/69i86suv5wcdt33rhqvp.gif)

In old games there was a system implemented into the game that basically let the player move around in the center of the screen freely, without triggering camera movement. This is not a really difficult feature to code, as you only need to set boundaries and check if the player is inside or outside of them, and adjust the camera only when we happen to be outside.


![New Camera](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pt31t5dd8cu170kgcooj.gif)


The code is easy and the result speaks for itself if you ask me. You can now adjust movement and position without twitching the camera like crazy.



**Dashing ability:**

Do you remember the gift I left you last time?


![Old Gif](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/j1mlp0q316zinueoefge.gif)

At that point the ability was hardcoded and I have a button set to cycle around the power up stages, that is why you saw the Dino already in the yellow form. So with all the code done, let’s do some art!


![New Sprites](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/y33n3o51e46e1thoikqe.png)

For the moment I’m working with mystical flowers that let you change power-up states, which may change in the future. This one is simple yellow one with some flash to let me feel some forward motion in the project, and to be honest I really like how it looks animated in the game!



![Ingame look](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/o083tcadv7b8r08pl7as.gif)


**Fireball ability:**

Since I started posting about this project you could see the red sprite for the player but nothing special was happening. Well because I haven’t done anything yet! This issue got tackled as well this week, with adding some really simple frames and doing a few lines of code. Added a really simple fireball rotation animation (see above cursor) and went coding!


![Fireball Sprites](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wg19zro7b4l5fyrgb9io.png)

I have a separate collection for my firebally, a add_fireball function, which takes position and speed and to top it all an update and a draw function. Basically they are moved according to the speed and checked for any enemy collision, on which both the fireball and the enemy dies. At the moment i haven’t coded any special movement into them (like the bounce in Super Mario) nor do they have collision with the environment. The latter is gonna change for sure but not sure on a special movement for them yet, so that is up for the future!


![Ingame Look](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wll8rrhnsig4zog31fpw.gif)



**Ending and future plans:**

So that is all that I have for this week. If you want to follow the project more closely you can check the newly created [GitHub](https://github.com/Achie72/retro_pico_platformer/projects/1) table for more frequent updates! 



The other thing I was wondering about is maybe to upload the weekly “build” of the game for Ko-Fi supporters, so if you are interested in something along that line don’t be afraid to comment down below!



That is the end for this update! PicoShorts will be postponed for the next weekend due to the lack of time to write the article!



![Ko-fi supporters](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nikg8u21ga5bgj90v03c.png)


**Big thank you to Csöndi, for supporting my work!**



> _Wanna see your name here? See more frequent updates? Longer PicoShorts? Or you just like what i do? Consider supporting my work with even the price of a single coffee, and if you can please share my work, so more people can enjoy the magical world of PICO-8._


**Other social sites:**
🐦 [Twitter](https://twitter.com/Achie7240)
📷 [Instagram](https://www.instagram.com/justanerdlife/)
🎥 [Twitch](https://www.twitch.tv/achie7240)
🎬 [YouTube](https://www.youtube.com/channel/UCzWXrvo-Pj7_KDv4w4q-4Kg)


**Games and devlogs i made: **
⌨️ [GitHub repos](https://github.com/Achie72)
🎮 [Itch.io](https://achie.itch.io/)
🕹️ [Newgrounds](https://achie72.newgrounds.com/)