Log In  


This is an early version (not sure if I'll ever renew it), of a dynamic vegetation system I made that you can easily use thanks to #import.

Basically, it automatically sets grass and/or flowers on top of a graphic with a specified flag turned on.

Cart #rahohazoya-0 | 2019-04-21 | Code ▽ | Embed ▽ | No License
5

INSTALL INSTRUCTIONS

Navigate to your cart folder

Windows: C:/Users/Yourname/AppData/Roaming/pico-8/carts
OSX: /Users/Yourname/Library/Application Support/pico-8/carts
Linux: ~/.lexaloffle/pico-8/carts

Extract the folder from this download:
https://drive.google.com/file/d/1Ac0nAAU2EaJB_MIr-UZ-WC0gzp5UW5KU/view?usp=sharing

use this script in your cart:

#include ss_scripts/ss_dynveg.p8

Done.

After exporting it'll use, like maybe about 500 tokens? couldn't get it less than that, least not with my current skills/dedication.

CARTS SAMPLE CODE:

#include ss_scripts/ss_dynveg.p8

--ss_dynveg auto-creates a
--camera you can use. 
--configure it to your
--liking, but its best
--to leave it default.

--even if you dont use
--camera(), its best to
--at least include 
--_camera.x and _camera.y
--in your viewport modification,
--otherwise grass wont spawn
--outside of the first 127x127
--pixels.

--setup vegetation info
grass_flag_id=0 --this flag needs
--to be on in order to spawn grass
--on the tile.
grass_flow_spd=2 --how fast it
--flows
grass_veg_amount=4 --amount of
--grass that spawns per tile,
--max of 6.

function _init()
	--spawn the grass and
	--set wave amp, increase
	--for larger waves.
	wave_amp=2
	dgrass_init(wave_amp)
end

function _draw()
	cls(12)
	--draw entire map
	map()

	--draw the grass
	dgrass()
	--move camera, set it to
	--_camera.x and _camera.y,
	--which is the grasses 
	--camera. note, this wont
	--overwrite another variable
	--named _camera.
	camera(_camera.x, _camera.y)

	--draw grass debug info
	grass_render_debug()
end
function _update()

	--move the grass camera
	--a bit.
	_camera.x+=1
end
5



[Please log in to post a comment]