This is a short snippet showing how the water reflection effect is implemented in Pilot8.
Here is the code:
local g_rnd=nil local g_clk=0 function _init() init_rnd() end function init_rnd() g_rnd={} for i=1,64 do add(g_rnd,flr(rnd(32))) end end function _update() g_clk+=1 end function render_water(water_y) local addr_w=0x6000+64*water_y local addr_r=addr_w local rip_c=0x11 memset(addr_w,rip_c,64) for y=water_y+1,127 do addr_w+=64 addr_r-=(y%2)*64 local offset=1+(flr(g_clk/4)+y)%#g_rnd local prand=g_rnd[offset] if 0~=band(prand,30) then memcpy(addr_w,addr_r+prand%2*64,64) else memset(addr_w,rip_c,64) end end end function _draw() cls(0) map(0,0) print("pilot8 water effect", band(g_clk,127),88,7) render_water(96) end |
by btco
UPDATE: Version 1.1:
- faster ship
- constant enemy spawns (no delays)
- muzzle flash effect and better explosions
- other gameplay tweaks
STORY: Welcome, Pilot 8. You are our top choice for this mission. I mean, 8th choice. Nothing suspicious at all happened to the other 7 pilots that came before you. They... uh... retired. Anyway, here is your comprehensive battle training: use the arrows to move, press [Z] to shoot. End of comprehensive training. Off to war you go. Good luck, Pilot 8.... Ok, that pilot is hopeless, let's start training Pilot 9. Oh, what? It's still on? How do I turn this off <click>
This is a simple space shooter.
- 18 levels across 6 worlds (Flood City, Oasis, Marshes, Coast, Canals, Fortress)
- Different weapons and powerups (shield, weapons, etc).
- Collect chips dropped by enemies to upgrade your ship. 14 upgrades available:
- extra speed
- rapid fire (3 levels)
- ammo capacity (3 levels)
- shield (3 levels)
- starting laser
- powerup frequency
- World map
Tech aspects:
- Dynamic lighting (via framebuffer post-processing).
- Screen-space reflection (water effect, lightning, etc).
- Particle effects, rain, etc.