Skip to content

Commit

Permalink
Added LuaPlayerYT v0.4
Browse files Browse the repository at this point in the history
  • Loading branch information
antim0118 committed Oct 11, 2024
1 parent 7146b5c commit 35f24d0
Show file tree
Hide file tree
Showing 15 changed files with 203 additions and 4 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
*.elf
*.o
bunnyMarkLuaPlayerPlus_r163/lpp_err.log
bunnyMarkLuaPlayerYTv04/error_log.txt
15 changes: 11 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,13 @@ Benchmark for PSP based on [Pixijs's BunnyMark](https://www.goodboydigital.com/p
| PSP | 60 FPS | 60 FPS | 37 FPS | 16 FPS | 8 FPS |
| PPSSPP (Emulator) | 60 FPS | 60 FPS | 46 FPS | 19 FPS | 10 FPS |

### [LuaPlayerYT v0.4](https://vk.com/nomoreyuliateam)
| ![ICON0](https://raw.githubusercontent.com/antim0118/bunnyMark-psp/master/bunnyMarkLuaPlayerYT04/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 |
| PPSSPP (Emulator) | 60 FPS | 60 FPS | 30 FPS | 15 FPS | 10 FPS |
`* - Crashes after 3745 bunnies`

### 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 All @@ -29,10 +36,10 @@ Benchmark for PSP based on [Pixijs's BunnyMark](https://www.goodboydigital.com/p
`* - Crashes after 4k bunnies`

### [Lua Player Plus r163](https://www.gamebrew.org/wiki/Lua_Player_Plus_PSP)
| ![ICON0](https://raw.githubusercontent.com/antim0118/bunnyMark-psp/master/bunnyMarkGodot21/ICON0.png "ICON0") | 100 BUNNIES | 500 BUNNIES | 1000 BUNNIES | 2500 BUNNIES | 5000 BUNNIES |
| ------------------------------------------------------------------------------------------------------------- | ----------- | ----------- | ------------ | ------------ | ------------ |
| PSP | 39-40 FPS | 8-9 FPS | 4-5 FPS | 1-2 FPS | 1 FPS |
| PPSSPP (Emulator) | 60 FPS | 27 FPS | 13-14 FPS | 5-6 FPS | 2-3 FPS |
| ![ICON0](https://raw.githubusercontent.com/antim0118/bunnyMark-psp/master/bunnyMarkLuaPlayerPlus_r163/ICON0.png "ICON0") | 100 BUNNIES | 500 BUNNIES | 1000 BUNNIES | 2500 BUNNIES | 5000 BUNNIES |
| ------------ | ------------ | ------------ | ------------ | ------------ | ------------ |
| PSP | 39-40 FPS | 8-9 FPS | 4-5 FPS | 1-2 FPS | 1 FPS |
| PPSSPP (Emulator) | 60 FPS | 27 FPS | 13-14 FPS | 5-6 FPS | 2-3 FPS |

### [Godot 2.1](https://github.com/technicaljicama/godot-psp)
| ![ICON0](https://raw.githubusercontent.com/antim0118/bunnyMark-psp/master/bunnyMarkGodot21/ICON0.png "ICON0") | 100 BUNNIES | 500 BUNNIES | 1000 BUNNIES | 2500 BUNNIES | 5000 BUNNIES |
Expand Down
Binary file added bunnyMarkLuaPlayerYTv04/Assets/Fonts/ltn0.pgf
Binary file not shown.
44 changes: 44 additions & 0 deletions bunnyMarkLuaPlayerYTv04/Assets/Scripts/Bunny.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
Bunny = {}
Bunny.__index = Bunny

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.scale = 0.5 + math.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
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
end
elseif bunny.y < minY then
bunny.speedY = 0
bunny.y = minY
end
end
122 changes: 122 additions & 0 deletions bunnyMarkLuaPlayerYTv04/Assets/Scripts/Main.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
require("Assets/Scripts/Rect")
require("Assets/Scripts/Bunny")
require('Assets/Scripts/buttonsCommon')

width = 480
height = 272

wabbitTexture = nil

bunnys = {}
gravity = 0.5 --1.5

maxX = width
minX = 0
maxY = height
minY = 0

startBunnyCount = 3000
isAdding = false
count = 0

amount = 10

bgColor = Color.new(255, 255, 255)
font = intraFont.load('Assets/Fonts/ltn0.pgf')
fontFGColor = Color.new(0, 255, 255)
fontBGColor = Color.new(16, 92, 182)

bunnyTextures = nil
currentTexture = nil
bunnyType = nil

function spawnBunny()
local bunny = Bunny:create(currentTexture)
table.insert(bunnys, bunny)
count = count + 1
end

function onReady()
wabbitTexture = Image.load("Assets/Sprites/bunnys.png")

bunnyTextures = {
Rect:create(2, 47, 26, 37),
Rect:create(2, 86, 26, 37),
Rect:create(2, 125, 26, 37),
Rect:create(2, 164, 26, 37),
Rect:create(2, 2, 26, 37)
}

bunnyType = 2
currentTexture = bunnyTextures[bunnyType]

for i = 1, startBunnyCount do
spawnBunny()
end
end


function onTouchStart()
isAdding = true;
end

function onTouchEnd()
bunnyType = bunnyType + 1
bunnyType = (bunnyType % 5) + 1;
currentTexture = bunnyTextures[bunnyType];

isAdding = false;
end

local crossPressed = false
local lastSecond = 0
local countedFrames = 0
local FPS = 60
local buttons_pad = nil
function update()
screen.clear(bgColor)

buttons.read()
if press('cross') then
onTouchStart()
end
if release('cross') then
onTouchEnd()
end

if isAdding then
-- add 10 at a time :)
if count < 200000 then
for i = 0, amount do
spawnBunny()
end
end
end

for i = 1, count do
local bunny = bunnys[i]
Bunny:processPhysics(bunny)
local tex = bunny.texture
Image.draw(wabbitTexture,
bunny.x, bunny.y, bunny.w, bunny.h,
nil,
tex.x, tex.y, tex.w, tex.h)
end

if lastSecond ~= System.getTime().seconds then
lastSecond = System.getTime().seconds
FPS = countedFrames
countedFrames = 0
end
countedFrames = countedFrames + 1

intraFont.printBackground(font, 2, 15, tostring(FPS) .. " FPS", fontFGColor, fontBGColor)
intraFont.printBackground(font, 2, 32, count .. " BUNNIES", fontFGColor, fontBGColor)

screen.flip()
end

onReady()
while true do
update()
end
12 changes: 12 additions & 0 deletions bunnyMarkLuaPlayerYTv04/Assets/Scripts/Rect.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
Rect = {}
Rect.__index = Rect

function Rect:create(x,y,w,h)
local r = {}
setmetatable(r, Rect)
r.x = x
r.y = y
r.w = w
r.h = h
return r
end
11 changes: 11 additions & 0 deletions bunnyMarkLuaPlayerYTv04/Assets/Scripts/buttonsCommon.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
function press(button)
return buttons.pressed(buttons[button])
end

function held(button)
return buttons.held(buttons[button])
end

function release(button)
return buttons.released(buttons[button])
end
Binary file added bunnyMarkLuaPlayerYTv04/Assets/Sprites/bunnys.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added bunnyMarkLuaPlayerYTv04/EBOOT.PBP
Binary file not shown.
Binary file added bunnyMarkLuaPlayerYTv04/EBOOT.PBP.txt
Binary file not shown.
Binary file added bunnyMarkLuaPlayerYTv04/ICON0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added bunnyMarkLuaPlayerYTv04/ICON0.psd
Binary file not shown.
Binary file added bunnyMarkLuaPlayerYTv04/luaFont.pgf
Binary file not shown.
2 changes: 2 additions & 0 deletions bunnyMarkLuaPlayerYTv04/script.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
System.HighCPU()
dofile("Assets/Scripts/Main.lua")
Binary file added bunnyMarkLuaPlayerYTv04/system.wav
Binary file not shown.

0 comments on commit 35f24d0

Please sign in to comment.