Video of the gameplay
Version Update
Version 1.2
- Improved Gameplay
Version 1.1
- New Label
- Improved Gameplay
- Change of Controls
- Improved Graphics
- New End of Game
- Improved code
Thanks to Freds72 and Heracleum for all the great suggestions.
Background of Operation Pico
Operation Pico is based on an old favourite of mine, Operation Wolf first released in 1987. I enjoyed playing it at my local arcades and on my ZX Spectrum 128k with the best of gameplay on my great Commodore Amiga 500.
In Operation Pico there are six stages and 3 levels of gameplay to sink your teeth into.
Controls
Use the cursor keys to navigate the menu. ( X or left mouse button to select start )
Select (Normal / Hard / Insane) for the game play intensity.
Select mouse or keyboard ( cursor keys ) to move the crosshair.
Left mouse button = Shoot
Right Mouse button = Grenade
OR
Z = Shoot
X = Grenade
Rules
The object of the game is to rescue as many hostages as you can without getting killed. Use all your ammunition you have to kill the soldiers, tanks, helicopters, birds and chickens but try to avoid the hostages. Sometimes you might get extra ammo, free bullets, grenades or TNT if you shoot a bird or chicken.
Behind the scenes
I had a lot of fun coding Operation Pico. I think it captures the Operation Wolf gameplay in somewhat of a small form factor. I made a timer function that helped a lot with the animation of the entities. I will release a full version of the timer function soon. I ran out of Tokens so the game is not as I wanted, particularly at the end of the game. I have not coded for a long time so please forgive the messy code and lack of comments.
A side note : There still may be many bugs, please let me know when you find one. Also a big thank you to Youtube's Lazy Devs for the great videos on Pico-8.
Many thanks.
Have fun playing.
Antony
Excellent - one of my fav Amiga game!
Couple of remarks:
- show mouse cursor in menu
- level selection takes ages to skip
- mouse buttons are not working
- ground color tone could possibly be more brown than sand? (to make enemies stand out more clearly?)
- death warning tone is perhaps to early (can last several minutes)
- game title may be a bit "bland": Operation Wolpi? (Jelpi :) or something less 100% pico
- add a label (you've got good art)
Thanks for your comments.
I will take your comments onboard. I ran out of tokens so without a complete overhaul of the code this might be a bit tricky. But will try something. It was my first time coding with Pico-8 found it a nice experience. Thanks again
understood - though you have many options to reduce token usage:
- most of the tostr() calls are useless (pico automatically converts numbers to string)
- use more local variables to remove duplicate access to tables values
ex:
local x,y=panel_placment["x"],panel_placment["y"] rectfill(x,y,x+117,y+20,3) spr(64,x+40,y-32,4,4) |
- panel_placment["x"] is equivalent to panel_placment.x (1 less token)
- remove duplicate code!
ex:
sprite_split = split(entitie.anim_1["frame_" .. tostr(entitie.anim_1_frame)],"_") -- store direction test local is_flipped = entitie.move_direction == 0 -- reuse to flip sprite spr(sprite_split[1],entitie.x,entitie.y,sprite_split[4],sprite_split[5],is_flipped,false) -- reuse to set talking location hostage_talking_location = is_flipped and 0 or 12 |
- and many more you will learn with experience and reading other's cart code!
I agree, first of all on the game experience being nicely recreated and good graphics 👍.
But yes I scrolled the code and there's a lot of tokens you can save in different ways and places.
At a glance, one of the top token-killer is the 'draw' section in _stage_helper: around 500 tokens 👀 that could be brought down to 60 or less, because you're basically repeating SIX times the same code with different numbers (units and coordinates). For instance having a single function rendering a single stage info-card in a box at x,y and making the coordinates relative using camera(-x,-y) even better if you had 'stage' objects (tables) with their properties.
Also even very quick habits or tricks to gain a few tokens per line (but it could make a remarkable total gain of tokens overall), a few examples:
- no need to check
if var == true
on booleansif var
is good enough (and common practice in all languages); - same for false instead of
if var == false
useif not var
; - again on booleans, once you've removed all instances of direct boolean value checking (as above) you can even avoid having a
return false
at the end of a function, since if you don't return anything it will return NIL (which is a 'falsey' value); when you invoke that function e.g.has_value()
if it returns NIL in your code it'll beif has_value() then
it will work as false; - invoking any function that takes a single string as argument doesn't require parentheses (-1 token) and you have a lot of them, e.g.
_menu("init")
to_menu"init"
Also I see a lot of single print
s, you can save a lot of tokens moving the cursor in the same printed string (and do other wonders using p8scii and control codes, worth the read on manual/wiki)
Hi,
Thanks for the time you both put in to write your answers. You have made me think, I will do as you have suggested. Never thought about how you said do draw in the stage_helper.
With the above suggestions I can do a good ending ;-)
Thanks to you both. ( Freds72 and Heracleum )
Will do above suggestions soon.
Busy doing your suggestions, Freds72 can you explain about "add a label", I have one on the pico-8 cart, is there another one? Done the mouse keys and death tone. Next to get the code as you both said.
Should I rename it the game? Operation Pico / Operation Wolp. Have you any suggestions on this. If I do can I rename it in this post?
a label image can be anything- not only a screenshot of the game
suggestion was to take something like the Operation Wolf box art to have a more catchy thumbnail
As for the name, your call (Operation Wolp is interresting!)
Heracleum, can you explain about :
"Also I see a lot of single prints, you can save a lot of tokens moving the cursor in the same printed string"
Thanks
Just to ask how can I print the score and high score as 0000 not 0, so a score of 10 would look like 0010.
Thanks
Antony
convert score to string (tostr is useful here!) and take the required number of characters from a "pattern" string: "000000"
OK Will Fix Soon, Just looked yep I need to fix the x position of the Helicopter, it keeps in the same place not a random place.
[Please log in to post a comment]