Hammer smashed face

Show off your games, demos and other (playable) creations.
User avatar
The Burrito
Party member
Posts: 153
Joined: Mon Sep 21, 2009 12:14 am
Contact:

Re: Hammer smashed face

Post by The Burrito »

jradich wrote:If you do not mind, my good sir, would you show me what you mean?
Sure, you could so something like this:

Code: Select all

if facing == "right" then
love.graphics.draw( player, x, y )
else
love.graphics.draw( player, x+player:getWidth(), y, 0, -1, 1, 0, 0 )
end
Normally this would just flip the sprite over the x coordinate, so you have to add the width of the image to compensate.

Then make pressing right or left set facing accordingly. Don't forget you already have a left facing thing that you should get rid of if you do this.
User avatar
jradich
Party member
Posts: 100
Joined: Mon Dec 12, 2011 8:44 pm

Re: Hammer smashed face

Post by jradich »

Thanks, that will make everything a lot easier, my good sir.
Losing a friend's trust is the fastest way to lose a friend, forever. FOREVER!
coffee
Party member
Posts: 1206
Joined: Wed Nov 02, 2011 9:07 pm

Re: Hammer smashed face

Post by coffee »

Fun GFX but I'm totally disappointed! Where is the face to smash? FAIL :D

jradich I doubt that anyone could anatomically "smash" a face like you are doing. The guy seems more like stabbing/sticking something in the face. :)
User avatar
jradich
Party member
Posts: 100
Joined: Mon Dec 12, 2011 8:44 pm

Re: Hammer smashed face

Post by jradich »

Will a good sir be inclined to help me out? The code I have tried has not worked to cancel all actions (except the one for x) when x is pressed
Losing a friend's trust is the fastest way to lose a friend, forever. FOREVER!
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: Hammer smashed face

Post by Robin »

jradich wrote:Will a good sir be inclined to help me out? The code I have tried has not worked to cancel all actions (except the one for x) when x is pressed
Could you be a bit more specific? And also upload a .love from your current source code to the forums? Then we can see what you're doing and what you could change to make it do what you want it to do.
Help us help you: attach a .love.
User avatar
jradich
Party member
Posts: 100
Joined: Mon Dec 12, 2011 8:44 pm

Re: Hammer smashed face

Post by jradich »

Robin wrote:
jradich wrote:Will a good sir be inclined to help me out? The code I have tried has not worked to cancel all actions (except the one for x) when x is pressed
Could you be a bit more specific? And also upload a .love from your current source code to the forums? Then we can see what you're doing and what you could change to make it do what you want it to do.
I apologize for my late response, but what I mean is that when you press 'x' (which currently just makes the guy look like he is striking a hammer) it will stop you from moving if you are moving when you press it, in addition to what it presently does. Basically, I've been trying to make it so that when you press it, it looks like he is stopping in a fixed position so he can strike his hammer.
Losing a friend's trust is the fastest way to lose a friend, forever. FOREVER!
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: Hammer smashed face

Post by Robin »

You can wrap the other checks in an if:

Code: Select all

if not love.mouse.isDown('x') then
   if love.mouse.isDown('left') then
      ....
   end
   if love.mouse.isDown('right') then
      .... 
   end
   ....
end
Help us help you: attach a .love.
User avatar
jradich
Party member
Posts: 100
Joined: Mon Dec 12, 2011 8:44 pm

Re: Hammer smashed face

Post by jradich »

Thanks love community. You have been very helpful.
Losing a friend's trust is the fastest way to lose a friend, forever. FOREVER!
waraiotoko
Prole
Posts: 33
Joined: Thu Oct 06, 2011 6:08 pm

Re: Hammer smashed face

Post by waraiotoko »

You asked for some collision help, I've attached a version of your main.lua with a really simple bounding box algorithm, it doesn't work for polygons but could. It's not the best, but hopefully it helps. Just drop it in a copy of your code (replacing your main) and test it out.

EDIT: You "test it out" by trying to move into the boxes. You can add more boxes (check love.load()).
Attachments
main.lua
(3.73 KiB) Downloaded 135 times
User avatar
jradich
Party member
Posts: 100
Joined: Mon Dec 12, 2011 8:44 pm

Re: Hammer smashed face

Post by jradich »

waraiotoko wrote:You asked for some collision help, I've attached a version of your main.lua with a really simple bounding box algorithm, it doesn't work for polygons but could. It's not the best, but hopefully it helps. Just drop it in a copy of your code (replacing your main) and test it out.

EDIT: You "test it out" by trying to move into the boxes. You can add more boxes (check love.load()).
I am forever in your debt, noble warrior. :awesome:
Losing a friend's trust is the fastest way to lose a friend, forever. FOREVER!
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 2 guests