Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Hi! I'm really interested in making a simple game using WiiLove, but I always get stuck when setting up the controls. I've tried analyzing your project, but I haven't been able to fully understand the logic behind the input. Could you please explain how you implemented it or which functions you use? It would help me out a lot and I'd really appreciate it. Thank you so much

Hello, sure! :D

First, you need to set up a variable to get the wiimote:

local wiimote = love.wiimote.getWiimotes()[1]

Then, to get the input, just use the following command:

wiimote:isDown()

Inside the parentheses, you should put a string with the specified button you want to check. The buttons are "up", "left", "down", "right", "a", "b", "1", "2", "+" and "-".

Example program:

local wiimote = love.wiimote.getWiimotes()[1] -- defines wiimote 1
function love.draw()
    if wiimote:isDown("a") then -- checks if A is being pressed
        love.graphics.print("A is being pressed!", 10, 10)
    end
end

Hope this helps :)