diff options
| author | jussi | 2022-12-09 16:02:28 +0200 |
|---|---|---|
| committer | jussi | 2022-12-09 16:02:28 +0200 |
| commit | e1a85f898e0781c9dd69ced6cd6ccb4e304a7bd1 (patch) | |
| tree | e6fc38ef9c149de6cd58aa43a28e1c67d0cb7317 /examples/bunnymark | |
| parent | 973d902a16b35258629d2a0b228ad9c3f49b6198 (diff) | |
| download | reilua-enhanced-e1a85f898e0781c9dd69ced6cd6ccb4e304a7bd1.tar.gz reilua-enhanced-e1a85f898e0781c9dd69ced6cd6ccb4e304a7bd1.tar.bz2 reilua-enhanced-e1a85f898e0781c9dd69ced6cd6ccb4e304a7bd1.zip | |
Draw Mesh Instanced Example.
Diffstat (limited to 'examples/bunnymark')
| -rw-r--r-- | examples/bunnymark/main.lua | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/examples/bunnymark/main.lua b/examples/bunnymark/main.lua index 8672887..8bdc9b9 100644 --- a/examples/bunnymark/main.lua +++ b/examples/bunnymark/main.lua @@ -1,3 +1,6 @@ +-- Forked from raylib-lua example by TSnake41 +-- https://github.com/TSnake41/raylib-lua/blob/master/examples/textures_bunnymark.lua + local MAX_BUNNIES = 100000 -- This is the maximum amount of elements (quads) per batch @@ -39,8 +42,6 @@ function Bunny:update() end end --- Init - function init() RL_SetWindowState( FLAG_VSYNC_HINT ) RL_SetWindowSize( { screenWidth, screenHeight } ) @@ -50,8 +51,6 @@ function init() texSize = RL_GetTextureSize( texBunny ) end --- Update - function process( delta ) if RL_IsMouseButtonDown( 0 ) then -- Create more bunnies @@ -59,7 +58,7 @@ function process( delta ) if #bunnies < MAX_BUNNIES then local speed = { math.random( -250, 250 ) / 60, math.random( -250, 250 ) / 60 } local color = { math.random( 50, 240 ), math.random( 80, 240 ), math.random( 100, 240 ), 255 } - table.insert( bunnies, Bunny:new( RL_GetMousePosition(), speed, color) ) + table.insert( bunnies, Bunny:new( RL_GetMousePosition(), speed, color ) ) end end end @@ -69,8 +68,6 @@ function process( delta ) end end - -- Draw - function draw() RL_ClearBackground( RAYWHITE ) |
