I need help, the image doesn't disappear.

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
Pollo Rostizado
Prole
Posts: 7
Joined: Tue Oct 28, 2014 5:18 am

I need help, the image doesn't disappear.

Post by Pollo Rostizado »

If this topic is not in the correct place, move it please.
Sorry for my bad english.

This is the thing:
I want that when one image reach the floor, that image disappear, and another image appear. But I dont know how to do it, because with the script I have done, the second image (the explotion) just is on the first image (the face), and I want that the face disappear and the explotion stays. I leave images about the .lua script and the image of the game. Thanks.

Image

---------------------------------------------------------------------------------------------------

Image

---------------------------------------------------------------------------------------------------

Image

---------------------------------------------------------------------------------------------------

Image

---------------------------------------------------------------------------------------------------

Image
Pollo Rostizado
New in the programation world
Old in the learning world
User avatar
HugoBDesigner
Party member
Posts: 403
Joined: Mon Feb 24, 2014 6:54 pm
Location: Above the Pocket Dimension
Contact:

Re: I need help, the image doesn't disappear.

Post by HugoBDesigner »

You're drawing the same image twice:

Code: Select all

love.graphics.draw(teemo, posX, posY) --First time

if (haValidoQueso) then
    love.graphics.draw(explosion, posX, posY, -40)
else
    love.graphics.draw(teemo, posX, posY) --Second time
end
But you don't need the first time since you have it already in the "if-else" statement:

Code: Select all

if haValidoQueso then
    love.graphics.draw(explosion, posX, posY, -40)
else
    love.graphics.draw(teemo, posX, posY) --Second time
end
So just remove the line 103 and you should be fine.
Also, I'd recommend you paste the code here using [code][/code] tabs instead of images, it makes things easier :)
@HugoBDesigner - Twitter
HugoBDesigner - Blog
Pollo Rostizado
Prole
Posts: 7
Joined: Tue Oct 28, 2014 5:18 am

Re: I need help, the image doesn't disappear.

Post by Pollo Rostizado »

Oooooooh, that makes a lot of sense. Thaaaaanks.

Oh, that new for me (Im new in the forum). Thanks HugoBDesigner (:
Pollo Rostizado
New in the programation world
Old in the learning world
Pollo Rostizado
Prole
Posts: 7
Joined: Tue Oct 28, 2014 5:18 am

Re: I need help, the image doesn't disappear.

Post by Pollo Rostizado »

Worked perfectly now. Thread may be closed.
Pollo Rostizado
New in the programation world
Old in the learning world
Post Reply

Who is online

Users browsing this forum: Bing [Bot], DarkblooM, SiENcE and 7 guests