Search found 243 matches

by Tjakka5
Fri Feb 16, 2018 6:06 pm
Forum: Support and Development
Topic: Disable key repeat?
Replies: 22
Views: 11043

Re: Disable key repeat?

Because the best way is to just use keypressed / released

Code: Select all

function love.keypressed(key)
  if key == "up" then
    print("Enter the new room")
  end
end
And that will do exactly what you need it to.
by Tjakka5
Sat Feb 03, 2018 4:51 pm
Forum: Support and Development
Topic: Timer Value only decreases once.G
Replies: 5
Views: 4266

Re: Timer Value only decreases once.G

It seems to me you come from a different language that supported references. If this is not the case, please mention it so I can redo my explanation. Variables can be global, or local to a scope (In loops, in functions, etc). Values passed to functions or defined to another variable are copied. The ...
by Tjakka5
Sat Feb 03, 2018 11:57 am
Forum: Support and Development
Topic: How are wiggle animations done?
Replies: 3
Views: 3295

Re: How are wiggle animations done?

This effect can be achieved by shearing the sprite. love.graphics.draw last 2 optional arguments are 'kx' and 'ky'. For this particular effect, only kx should be increased / decreased. To see it in action you can try map it to a sine function. Do note that for it to look good you will have to put th...
by Tjakka5
Fri Feb 02, 2018 12:30 pm
Forum: Support and Development
Topic: Bump.lua - how to change or display collision box?
Replies: 21
Views: 12765

Re: Bump.lua - how to change or display collision box?

world:update is needed for when you want to change the dimensions (Or move somewhere without collision).

What you were missing what cancelling the offset after calling world:move.
In your examples, you were setting the player position directly.
by Tjakka5
Fri Feb 02, 2018 12:07 pm
Forum: Support and Development
Topic: Bump.lua - how to change or display collision box?
Replies: 21
Views: 12765

Re: Bump.lua - how to change or display collision box?

I made a few mistakes in my code. For clarity I have made a .love demonstrating how it works.
You can also do the transformations with the functions Zorg provided.
by Tjakka5
Fri Feb 02, 2018 11:54 am
Forum: Support and Development
Topic: Background colour won't change
Replies: 10
Views: 6668

Re: Background colour won't change

If you're looking for alternatives, Lurker has always worked well for me.
https://github.com/rxi/lurker
by Tjakka5
Fri Feb 02, 2018 11:10 am
Forum: Support and Development
Topic: Background colour won't change
Replies: 10
Views: 6668

Re: Background colour won't change

Lick overwrites love.run with a variant that seems to is pre - 0.10. In this case, it calls love.graphics.clear without passing the background colors as arguments. Simply go to line 125 and change it to: love.graphics.clear(love.graphics.getBackgroundColor()) If any more weird problems I'd suggest d...
by Tjakka5
Fri Feb 02, 2018 11:05 am
Forum: Support and Development
Topic: Bump.lua - how to change or display collision box?
Replies: 21
Views: 12765

Re: Bump.lua - how to change or display collision box?

The reason that your object is flying to the left is because you're setting the position directly, instead of cancelling the offset. I explained this in my post. Either way, here's a full snippet that should fully work: world = bump.newWorld(32) local item = { x = 0, y = 0, w = 100, h = 100, } funct...
by Tjakka5
Fri Feb 02, 2018 8:40 am
Forum: Support and Development
Topic: Bump.lua - how to change or display collision box?
Replies: 21
Views: 12765

Re: Bump.lua - how to change or display collision box?

That makes sense but for some reason doesn't work that well. function love.load() world:add(player, player.x - player.w/2, player.y, player.w/2, player.h) function love.update(dt) world:move(player, player.x + player.dx, player.y + player.dy) Is this what you mean? How would I alter the move functi...
by Tjakka5
Thu Feb 01, 2018 1:20 pm
Forum: Support and Development
Topic: Bump.lua - how to change or display collision box?
Replies: 21
Views: 12765

Re: Bump.lua - how to change or display collision box?

When you register the body, offset it by half the length and width. world:add(item, item.x - item.w/2, item.y - item.h/2, item.w, item.h Also do this for :update and similair functions. When you try to :move a body, do it as follows: local newX, newY, cols, len = world:move(item, item.x - item.w/2, ...