Hello Color started as a tutorial for a friend, teaching him Lua + LOVE. However, after the tutorial session, I began tweaking the code, and came up with this simple prototype. The goal of the game is to find the circle matching the background color. The game ends when you have cleared all the circles. The total circles is based on the starting game resolution.
Enjoy!
HelloColor
- TylertheDesigner
- Citizen
- Posts: 80
- Joined: Sat Apr 10, 2010 2:27 am
HelloColor
- Attachments
-
- HelloColor.love
- (25.89 KiB) Downloaded 156 times
- Robin
- The Omniscient
- Posts: 6506
- Joined: Fri Feb 20, 2009 4:29 pm
- Location: The Netherlands
- Contact:
Re: HelloColor
It's pretty late at night, so I don't have much time to try it out, but I have one piece of criticism that applies to your other games posted as well: please use love.keypressed rather than love.keyboard.isDown, because it is rather annoying when I tap a key once and it treats it like > 1.
Help us help you: attach a .love.
Re: HelloColor
I second that change in all of your games so far it is rather annoying.Robin wrote:It's pretty late at night, so I don't have much time to try it out, but I have one piece of criticism that applies to your other games posted as well: please use love.keypressed rather than love.keyboard.isDown, because it is rather annoying when I tap a key once and it treats it like > 1.
Sir Kittenface
Möko IDE Codename (Erös) Returns Soon
I am dyslexic so if any of my replys confusing please just ask me to reword it as this will make things a lot easier for all parties lol.
Möko IDE Codename (Erös) Returns Soon
I am dyslexic so if any of my replys confusing please just ask me to reword it as this will make things a lot easier for all parties lol.
- TylertheDesigner
- Citizen
- Posts: 80
- Joined: Sat Apr 10, 2010 2:27 am
Re: HelloColor
The problem I have with that (and I hope you guys can offer solutions) is that when its love.keypressed and you already have another key held, it stops detecting that key. In some of the games I have made, I set separate booleans for the keys (Player1.upKeyIsDown, etc).Robin wrote:It's pretty late at night, so I don't have much time to try it out, but I have one piece of criticism that applies to your other games posted as well: please use love.keypressed rather than love.keyboard.isDown, because it is rather annoying when I tap a key once and it treats it like > 1.
Is there another way I can resolve this issue?
Thanks for the feedback!
Re: HelloColor
to a maybe do a double check likeTylertheDesigner wrote:The problem I have with that (and I hope you guys can offer solutions) is that when its love.keypressed and you already have another key held, it stops detecting that key. In some of the games I have made, I set separate booleans for the keys (Player1.upKeyIsDown, etc).Robin wrote:It's pretty late at night, so I don't have much time to try it out, but I have one piece of criticism that applies to your other games posted as well: please use love.keypressed rather than love.keyboard.isDown, because it is rather annoying when I tap a key once and it treats it like > 1.
Is there another way I can resolve this issue?
Thanks for the feedback!
Code: Select all
if Player1.upKeyIsDown and Player1.upKeyIsDown then
Sir Kittenface
Möko IDE Codename (Erös) Returns Soon
I am dyslexic so if any of my replys confusing please just ask me to reword it as this will make things a lot easier for all parties lol.
Möko IDE Codename (Erös) Returns Soon
I am dyslexic so if any of my replys confusing please just ask me to reword it as this will make things a lot easier for all parties lol.
- tentus
- Inner party member
- Posts: 1060
- Joined: Sun Oct 31, 2010 7:56 pm
- Location: Appalachia
- Contact:
Re: HelloColor
That would work, yeah. This is what I currently use for the player in my game, Kurosuke:crow wrote:to a maybe do a double check likeTylertheDesigner wrote:The problem I have with that (and I hope you guys can offer solutions) is that when its love.keypressed and you already have another key held, it stops detecting that key. In some of the games I have made, I set separate booleans for the keys (Player1.upKeyIsDown, etc).Robin wrote:It's pretty late at night, so I don't have much time to try it out, but I have one piece of criticism that applies to your other games posted as well: please use love.keypressed rather than love.keyboard.isDown, because it is rather annoying when I tap a key once and it treats it like > 1.
Is there another way I can resolve this issue?
Thanks for the feedback!maybe not sure if love would let you do this?Code: Select all
if Player1.upKeyIsDown and Player1.upKeyIsDown then
Code: Select all
local left = love.keyboard.isDown(self.key.left) or joystick.pressed[self.key.left]
local right = love.keyboard.isDown(self.key.right) or joystick.pressed[self.key.right]
if right and not left then
ent.actor.avatar[self.id].direction = 1
ent.actor.avatar[self.id]:run()
elseif left and not right then
ent.actor.avatar[self.id].direction = -1
ent.actor.avatar[self.id]:run()
end
Kurosuke needs beta testers
Re: HelloColor
I personally solve that problem by using vectors.
It looks something like this:
This also makes it super easy to implement joystick input. Just replace all those if statements with:
It looks something like this:
Code: Select all
moveBy = Vector(0, 0)
if isDown("right") then
moveBy = moveBy + Vector(1, 0)
end
if isDown("down") then
moveBy = moveBy + Vector(0, 1)
end
if isDown("left") then
moveBy = moveBy - Vector(1, 0)
end
if isDown("up") then
moveBy = moveBy - Vector(0, 1)
end
player:move(moveBy * player.speed * dt)
Code: Select all
moveBy = Vector(love.joystick.getAxis(0), love.joystick.getAxis(1)) -- or something similar
Re: HelloColor
Is vectors a love function ? or a lua module?
Sir Kittenface
Möko IDE Codename (Erös) Returns Soon
I am dyslexic so if any of my replys confusing please just ask me to reword it as this will make things a lot easier for all parties lol.
Möko IDE Codename (Erös) Returns Soon
I am dyslexic so if any of my replys confusing please just ask me to reword it as this will make things a lot easier for all parties lol.
Re: HelloColor
There are several implementations, I can recommend the Vector "class" in vrld's HUMP library.
Who is online
Users browsing this forum: No registered users and 1 guest