Skip to content

Commit

Permalink
Optimized Bunny.lua - Updated lua stats
Browse files Browse the repository at this point in the history
  • Loading branch information
antim0118 committed Dec 7, 2024
1 parent 1ea7cbb commit 2cc0610
Show file tree
Hide file tree
Showing 7 changed files with 140 additions and 94 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ Benchmark for PSP based on [Pixijs's BunnyMark](https://www.goodboydigital.com/p
### [LuaPlayer Euphoria v8](https://www.brewology.com/downloads/download.php?id=11378&mcid=1)
| ![ICON0](https://raw.githubusercontent.com/antim0118/bunnyMark-psp/master/bunnyMarkLuaPlayerEuphoria_V8/ICON0.png "ICON0") | 100 BUNNIES | 500 BUNNIES | 1000 BUNNIES | 2500 BUNNIES | 5000 BUNNIES |
| ------------ | ------------ | ------------ | ------------ | ------------ | ------------ |
| PSP | 60 FPS | 44 FPS | 22-23 FPS | 9 FPS | 4 FPS |
| PPSSPP (Emulator) | 60 FPS | 60 FPS | 46 FPS | 18 FPS | 9 FPS |
| PSP | 60 FPS | 47 FPS | 23-24 FPS | 9-10 FPS | 4-5 FPS |
| PPSSPP (Emulator) | 60 FPS | 60 FPS | 50 FPS | 19-20 FPS | 9-10 FPS |

### [Phoenix Game Engine 0.02](https://archive.org/details/pgelua.7z)
| ![ICON0](https://raw.githubusercontent.com/antim0118/bunnyMark-psp/master/bunnyMarkPhoenixGameEngine/ICON0.png "ICON0") | 100 BUNNIES | 500 BUNNIES | 1000 BUNNIES | 2500 BUNNIES | 5000 BUNNIES |
Expand All @@ -36,15 +36,15 @@ Benchmark for PSP based on [Pixijs's BunnyMark](https://www.goodboydigital.com/p
### [LuaPlayerYT v0.4](https://vk.com/nomoreyuliateam)
| ![ICON0](https://raw.githubusercontent.com/antim0118/bunnyMark-psp/master/bunnyMarkLuaPlayerYTv04/ICON0.png "ICON0") | 100 BUNNIES | 500 BUNNIES | 1000 BUNNIES | 2500 BUNNIES | 3700 BUNNIES* |
| ------------ | ------------ | ------------ | ------------ | ------------ | ------------ |
| PSP | 60 FPS | 20 FPS | 12 FPS | 5-6 FPS | 3-4 FPS |
| PSP | 60 FPS | 20 FPS | 12 FPS | 5 FPS | 3-4 FPS |
| PPSSPP (Emulator) | 60 FPS | 60 FPS | 30 FPS | 15 FPS | 10 FPS |
`* - Crashes after 3745 bunnies`

### [ONElua v4R1](http://onelua.x10.mx/)
| ![ICON0](https://raw.githubusercontent.com/antim0118/bunnyMark-psp/master/bunnyMarkONEluav4R1/ICON0.png "ICON0") | 100 BUNNIES | 500 BUNNIES | 1000 BUNNIES | 2500 BUNNIES | 5000 BUNNIES |
| ------------ | ------------ | ------------ | ------------ | ------------ | ------------ |
| PSP | 60 FPS | 20 FPS | 12 FPS | 5 FPS | 3 FPS |
| PPSSPP (Emulator) | 60 FPS | 30 FPS | 20 FPS | 10 FPS | 6 FPS |
| PSP | 60 FPS | 20 FPS | 12 FPS | 6 FPS | 3 FPS |
| PPSSPP (Emulator) | 60 FPS | 30 FPS | 23-29 FPS | 12 FPS | 6 FPS |

### Gamemaker 8.1 ([Chovy-GM](https://github.com/LiEnby/chovy-gm))
| ![ICON0](https://raw.githubusercontent.com/antim0118/bunnyMark-psp/master/bunnyMarkGamemaker81/ICON0.png "ICON0") | 100 BUNNIES | 500 BUNNIES | 1000 BUNNIES | 2500 BUNNIES | 4000 BUNNIES* |
Expand Down
59 changes: 35 additions & 24 deletions bunnyMarkLuaPlayerEuphoria_V8/Assets/Scripts/Bunny.lua
Original file line number Diff line number Diff line change
@@ -1,43 +1,54 @@
Bunny = {}
Bunny.__index = Bunny

local random = math.random

function Bunny:create(texture)
local r = {}
setmetatable(r, Bunny)
r.x = 0
r.y = 0

r.texture = texture
r.speedX = math.random() * 10
r.speedY = math.random() * 10 - 5

r.w = texture.w
r.h = texture.h
r.speedX = random() * 10
r.speedY = random() * 10 - 5

r.scale = 0.5 + random() * 0.5
r.w = r.scale * texture.w
r.h = r.scale * texture.h

return r
end

function Bunny:processPhysics(bunny)
bunny.x = bunny.x + bunny.speedX
bunny.y = bunny.y + bunny.speedY
bunny.speedY = bunny.speedY + gravity

if bunny.x > maxX - bunny.w then
bunny.speedX = bunny.speedX * -1
bunny.x = maxX - bunny.w
elseif bunny.x < minX then
bunny.speedX = bunny.speedX * -1
bunny.x = minX
local x = bunny.x + bunny.speedX
local y = bunny.y + bunny.speedY
local speedX = bunny.speedX
local speedY = bunny.speedY + gravity
local w = bunny.w
local h = bunny.h

if x > maxX - w then
speedX = speedX * -1
x = maxX - w
elseif x < minX then
speedX = speedX * -1
x = minX
end

if bunny.y > maxY - bunny.h then
bunny.speedY = bunny.speedY * -0.85
bunny.y = maxY - bunny.h
if math.random() > 0.5 then
bunny.speedY = bunny.speedY - math.random() * 6
if y > maxY - h then
speedY = speedY * -0.85
y = maxY - h
if random() > 0.5 then
speedY = speedY - random() * 6
end
elseif bunny.y < minY then
bunny.speedY = 0
bunny.y = minY
elseif y < minY then
speedY = 0
y = minY
end
end

bunny.x = x
bunny.y = y
bunny.speedX = speedX
bunny.speedY = speedY
end
57 changes: 36 additions & 21 deletions bunnyMarkLuaPlayerPlus_r163/Assets/Scripts/Bunny.lua
Original file line number Diff line number Diff line change
@@ -1,39 +1,54 @@
Bunny = {}
Bunny.__index = Bunny

local random = math.random

function Bunny:create(texture)
local r = {}
setmetatable(r, Bunny)
r.x = 0
r.y = 0

r.texture = texture
r.speedX = math.random() * 10
r.speedY = math.random() * 10 - 5
r.speedX = random() * 10
r.speedY = random() * 10 - 5

r.scale = 0.5 + random() * 0.5
r.w = r.scale * texture.w
r.h = r.scale * texture.h

return r
end

function Bunny:processPhysics(bunny)
bunny.x = bunny.x + bunny.speedX
bunny.y = bunny.y + bunny.speedY
bunny.speedY = bunny.speedY + gravity

if bunny.x > maxX - bunny.texture.w then
bunny.speedX = bunny.speedX * -1
bunny.x = maxX - bunny.texture.w
elseif bunny.x < minX then
bunny.speedX = bunny.speedX * -1
bunny.x = minX
local x = bunny.x + bunny.speedX
local y = bunny.y + bunny.speedY
local speedX = bunny.speedX
local speedY = bunny.speedY + gravity
local w = bunny.w
local h = bunny.h

if x > maxX - w then
speedX = speedX * -1
x = maxX - w
elseif x < minX then
speedX = speedX * -1
x = minX
end

if bunny.y > maxY - bunny.texture.h then
bunny.speedY = bunny.speedY * -0.85
bunny.y = maxY - bunny.texture.h
if math.random() > 0.5 then
bunny.speedY = bunny.speedY - math.random() * 6
if y > maxY - h then
speedY = speedY * -0.85
y = maxY - h
if random() > 0.5 then
speedY = speedY - random() * 6
end
elseif bunny.y < minY then
bunny.speedY = 0
bunny.y = minY
elseif y < minY then
speedY = 0
y = minY
end
end

bunny.x = x
bunny.y = y
bunny.speedX = speedX
bunny.speedY = speedY
end
Binary file modified bunnyMarkLuaPlayerPlus_r163/EBOOT.PBP
Binary file not shown.
54 changes: 32 additions & 22 deletions bunnyMarkLuaPlayerYTv04/Assets/Scripts/Bunny.lua
Original file line number Diff line number Diff line change
@@ -1,44 +1,54 @@
Bunny = {}
Bunny.__index = Bunny

local random = math.random

function Bunny:create(texture)
local r = {}
setmetatable(r, Bunny)
r.x = 0
r.y = 0

r.texture = texture
r.speedX = math.random() * 10
r.speedY = math.random() * 10 - 5
r.speedX = random() * 10
r.speedY = random() * 10 - 5

r.scale = 0.5 + math.random() * 0.5
r.scale = 0.5 + random() * 0.5
r.w = r.scale * texture.w
r.h = r.scale * texture.h

return r
end

function Bunny:processPhysics(bunny)
bunny.x = bunny.x + bunny.speedX
bunny.y = bunny.y + bunny.speedY
bunny.speedY = bunny.speedY + gravity

if bunny.x > maxX - bunny.w then
bunny.speedX = bunny.speedX * -1
bunny.x = maxX - bunny.w
elseif bunny.x < minX then
bunny.speedX = bunny.speedX * -1
bunny.x = minX
local x = bunny.x + bunny.speedX
local y = bunny.y + bunny.speedY
local speedX = bunny.speedX
local speedY = bunny.speedY + gravity
local w = bunny.w
local h = bunny.h

if x > maxX - w then
speedX = speedX * -1
x = maxX - w
elseif x < minX then
speedX = speedX * -1
x = minX
end

if bunny.y > maxY - bunny.h then
bunny.speedY = bunny.speedY * -0.85
bunny.y = maxY - bunny.h
if math.random() > 0.5 then
bunny.speedY = bunny.speedY - math.random() * 6
if y > maxY - h then
speedY = speedY * -0.85
y = maxY - h
if random() > 0.5 then
speedY = speedY - random() * 6
end
elseif bunny.y < minY then
bunny.speedY = 0
bunny.y = minY
elseif y < minY then
speedY = 0
y = minY
end
end

bunny.x = x
bunny.y = y
bunny.speedX = speedX
bunny.speedY = speedY
end
Binary file modified bunnyMarkLuaPlayerYTv04/EBOOT.PBP
Binary file not shown.
54 changes: 32 additions & 22 deletions bunnyMarkONEluav4R1/Assets/Scripts/Bunny.lua
Original file line number Diff line number Diff line change
@@ -1,44 +1,54 @@
Bunny = {}
Bunny.__index = Bunny

local random = math.random

function Bunny:create(texture)
local r = {}
setmetatable(r, Bunny)
r.x = 0
r.y = 0

r.texture = texture
r.speedX = math.random() * 10
r.speedY = math.random() * 10 - 5
r.speedX = random() * 10
r.speedY = random() * 10 - 5

r.scale = 0.5 + math.random() * 0.5
r.scale = 0.5 + random() * 0.5
r.w = r.scale * texture.w
r.h = r.scale * texture.h

return r
end

function Bunny:processPhysics(bunny)
bunny.x = bunny.x + bunny.speedX
bunny.y = bunny.y + bunny.speedY
bunny.speedY = bunny.speedY + gravity

if bunny.x > maxX - bunny.w then
bunny.speedX = bunny.speedX * -1
bunny.x = maxX - bunny.w
elseif bunny.x < minX then
bunny.speedX = bunny.speedX * -1
bunny.x = minX
local x = bunny.x + bunny.speedX
local y = bunny.y + bunny.speedY
local speedX = bunny.speedX
local speedY = bunny.speedY + gravity
local w = bunny.w
local h = bunny.h

if x > maxX - w then
speedX = speedX * -1
x = maxX - w
elseif x < minX then
speedX = speedX * -1
x = minX
end

if bunny.y > maxY - bunny.h then
bunny.speedY = bunny.speedY * -0.85
bunny.y = maxY - bunny.h
if math.random() > 0.5 then
bunny.speedY = bunny.speedY - math.random() * 6
if y > maxY - h then
speedY = speedY * -0.85
y = maxY - h
if random() > 0.5 then
speedY = speedY - random() * 6
end
elseif bunny.y < minY then
bunny.speedY = 0
bunny.y = minY
elseif y < minY then
speedY = 0
y = minY
end
end

bunny.x = x
bunny.y = y
bunny.speedX = speedX
bunny.speedY = speedY
end

0 comments on commit 2cc0610

Please sign in to comment.