[WIP]BeatFever Mania ~ osu! Engine reimplementation

Show off your games, demos and other (playable) creations.
User avatar
Nixola
Inner party member
Posts: 1949
Joined: Tue Dec 06, 2011 7:11 pm
Location: Italy

Re: [WIP]BeatFever Mania ~ osu! Engine reimplementation

Post by Nixola »

Some guy on IRC wrote:don't give me credit
lf = love.filesystem
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics
User avatar
zorg
Party member
Posts: 3444
Joined: Thu Dec 13, 2012 2:55 pm
Location: Absurdistan, Hungary
Contact:

Re: [WIP]BeatFever Mania ~ osu! Engine reimplementation

Post by zorg »

Sulunia wrote:Does love even have a IRC? Where? :o:
https://love2d.org/ wrote:Community: (...) There is also an IRC channel: #[email protected].
Me and my stuff :3True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
User avatar
Davidobot
Party member
Posts: 1226
Joined: Sat Mar 31, 2012 5:18 am
Location: Oxford, UK
Contact:

Re: [WIP]BeatFever Mania ~ osu! Engine reimplementation

Post by Davidobot »

I'm not going to let down:

Code: Select all

local ffi = require('ffi')
ffi.cdef('int PHYSFS_mount(const char *newDir, const char *mountPoint, int appendToPath);')
local liblove = ffi.os == 'Windows' and ffi.load('love') or ffi.C

function love.filedropped(file)
  local path = file:getFilename()
  extractZip(true, path)
end

local lfs = love.filesystem

local function enu(folder, saveDir)
    local filesTable = lfs.getDirectoryItems(folder)
	if saveDir ~= "" and not lfs.isDirectory(saveDir) then lfs.createDirectory(saveDir) end
   
    for i,v in ipairs(filesTable) do
		local file = folder.."/"..v
		local saveFile = saveDir.."/"..v
		if saveDir == "" then saveFile = v end
      
        if lfs.isDirectory(file) then
			lfs.createDirectory(saveFile)
            enu(file, saveFile)
        else
			lfs.write(saveFile, tostring(lfs.read(file)))
		end
    end
end

function extractZIP(tech, file, dir, delete)
	local dir = dir or ""
	local temp = tostring(love.math.random(1000, 2000))
	if tech then
	success = liblove.PHYSFS_mount(path, temp, false)
	else
	success = lfs.mount(file, temp)
	end
	
        if success then enu(temp, dir) end
	lfs.unmount(file)
	if delete then lfs.remove(file) end
end
The tech variable checks if the complex lovelib call is needed or not, it is meant to be true only if the file is to be extracted from drop.
Last edited by Davidobot on Thu Mar 31, 2016 8:30 pm, edited 1 time in total.
PM me on here or elsewhere if you'd like to discuss porting your game to Nintendo Switch via mazette!
personal page and a raycaster
User avatar
Sulunia
Party member
Posts: 203
Joined: Tue Mar 22, 2016 1:10 pm
Location: SRS, Brazil

Re: [WIP]BeatFever Mania ~ osu! Engine reimplementation

Post by Sulunia »

Davidobot wrote:I'm not going to let down:

Code: Select all

local ffi = require('ffi')
ffi.cdef('int PHYSFS_mount(const char *newDir, const char *mountPoint, int appendToPath);')
local liblove = ffi.os == 'Windows' and ffi.load('love') or ffi.C

function love.filedropped(file)
  local path = file:getFilename()
  extractZip(true, path)
end

local lfs = love.filesystem

local function enu(folder, saveDir)
    local filesTable = lfs.getDirectoryItems(folder)
	if saveDir ~= "" and not lfs.isDirectory(saveDir) then lfs.createDirectory(saveDir) end
   
    for i,v in ipairs(filesTable) do
		local file = folder.."/"..v
		local saveFile = saveDir.."/"..v
		if saveDir == "" then saveFile = v end
      
        if lfs.isDirectory(file) then
			lfs.createDirectory(saveFile)
            enu(file, saveFile)
        else
			lfs.write(saveFile, tostring(lfs.read(file)))
		end
    end
end

function extractZIP(tech, file, dir, delete)
	local dir = dir or ""
	local temp = tostring(math.random(1000, 2000))
	if tech then
	success = liblove.PHYSFS_mount(path, temp, false)
	else
	success = lfs.mount(file, temp)
	end
	
        if success then enu(temp, dir) end
	lfs.unmount(file)
	if delete then lfs.remove(file) end
end
The tech variable checks if the complex lovelib call is needed or not, it is meant to be true only if the file is to be extracted from drop.
Now that's handy. Allright, the next "release" here will have drag and drop to install and a revamped selection screen UI.
Thanks to everybody so far! I'll be back with news soon enough. :3
Don't check my github! It contains thousands of lines of spaghetti code in many different languages cool software! :neko:
https://github.com/Sulunia
User avatar
zorg
Party member
Posts: 3444
Joined: Thu Dec 13, 2012 2:55 pm
Location: Absurdistan, Hungary
Contact:

Re: [WIP]BeatFever Mania ~ osu! Engine reimplementation

Post by zorg »

Davidobot wrote:I'm not going to let down:

Code: Select all

local temp = tostring(math.random(1000, 2000))
Not gonna run around, and will just say, use love.math.random instead, for various reasons, including the here important fact that it's actually seeded in love.run, unlike lua's math.random.
Me and my stuff :3True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
User avatar
Davidobot
Party member
Posts: 1226
Joined: Sat Mar 31, 2012 5:18 am
Location: Oxford, UK
Contact:

Re: [WIP]BeatFever Mania ~ osu! Engine reimplementation

Post by Davidobot »

zorg wrote:
Davidobot wrote:I'm not going to let down:

Code: Select all

local temp = tostring(math.random(1000, 2000))
Not gonna run around, and will just say, use love.math.random instead, for various reasons, including the here important fact that it's actually seeded in love.run, unlike lua's math.random.
To be fair, that's just a stupid way to ensure that there are no folder overlaps? If that makes sense. Anyways, I switched it out. This code was written before love.math.random was introduced, so it was justifiable. :P

EDIT: No it was not, filesystem.mount and love.math.random were introduced at the same time. No excuse :|
PM me on here or elsewhere if you'd like to discuss porting your game to Nintendo Switch via mazette!
personal page and a raycaster
User avatar
Sulunia
Party member
Posts: 203
Joined: Tue Mar 22, 2016 1:10 pm
Location: SRS, Brazil

Re: [WIP]BeatFever Mania ~ osu! Engine reimplementation

Post by Sulunia »

A wip to you guys:
Image
Once the UI is in place, i'll cleanup the code and implement drag and drop install.

Shouldn't the code be cleaned up first? I guess, but since it'll get messy again, lemme finish EVERYTHING so i refactor just once xD
Don't check my github! It contains thousands of lines of spaghetti code in many different languages cool software! :neko:
https://github.com/Sulunia
User avatar
Davidobot
Party member
Posts: 1226
Joined: Sat Mar 31, 2012 5:18 am
Location: Oxford, UK
Contact:

Re: [WIP]BeatFever Mania ~ osu! Engine reimplementation

Post by Davidobot »

Just want to let you know that https://github.com/danielpontello/beatfever is no longer a thing..
PM me on here or elsewhere if you'd like to discuss porting your game to Nintendo Switch via mazette!
personal page and a raycaster
User avatar
zorg
Party member
Posts: 3444
Joined: Thu Dec 13, 2012 2:55 pm
Location: Absurdistan, Hungary
Contact:

Re: [WIP]BeatFever Mania ~ osu! Engine reimplementation

Post by zorg »

C&D?
Me and my stuff :3True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
User avatar
Sulunia
Party member
Posts: 203
Joined: Tue Mar 22, 2016 1:10 pm
Location: SRS, Brazil

Re: [WIP]BeatFever Mania ~ osu! Engine reimplementation

Post by Sulunia »

Davidobot wrote:Just want to let you know that https://github.com/danielpontello/beatfever is no longer a thing..
Oops.

We forgot to unprivate the repo. I'll let him know.

@edit

Seens like github seriously has an issue with opening private repositories to the public. I guess i'll have to recreate it on my own profile :shock:
Last edited by Sulunia on Tue Apr 05, 2016 1:09 pm, edited 1 time in total.
Don't check my github! It contains thousands of lines of spaghetti code in many different languages cool software! :neko:
https://github.com/Sulunia
Post Reply

Who is online

Users browsing this forum: Google [Bot], Hugues Ross and 72 guests