looking to make a very simple text based adventure with a gui and maybe some sounds/music
how would i go about getting using input and printing?
like:
print("what is your name?")
name = io.read()
print("hello"name)
but for love. all i have so far is
function love.draw()
love.graphics.print("what is your name?", 0, 0)
end
im not sure where to go from here.
User input
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Re: User input
You need to read SDL events, not the text console. So use love.keypressed.john wrote:looking to make a very simple text based adventure with a gui and maybe some sounds/music
how would i go about getting using input and printing?
like:
print("what is your name?")
name = io.read()
print("hello"name)
but for love. all i have so far is
function love.draw()
love.graphics.print("what is your name?", 0, 0)
end
im not sure where to go from here.
Check out the tutorial:http://love2d.org/wiki/Tutorial:Callback_Functions
My lovely code lives at GitHub: http://github.com/miko/Love2d-samples
- Taehl
- Dreaming in associative arrays
- Posts: 1025
- Joined: Mon Jan 11, 2010 5:07 am
- Location: CA, USA
- Contact:
Re: User input
If all you want is a text-based game, why not just use Lua by itself? I've done it before, so I could help a bit if you want to go that way.
Earliest Love2D supporter who can't Love anymore. Let me disable pixel shaders if I don't use them, dammit!
Lenovo Thinkpad X60 Tablet, built like a tank. But not fancy enough for Love2D 0.10.0+.
Lenovo Thinkpad X60 Tablet, built like a tank. But not fancy enough for Love2D 0.10.0+.
Who is online
Users browsing this forum: Ahrefs [Bot], Google [Bot] and 3 guests