So after I saw this I got obsessed with making something similar and even started using LOVE(damn you you weird O with your non-existence in my keyboard) a couple of days ago.
But getting the keyboard movement is completely kicking my ass, any ideas on how I can accomplish this feat?
Getting the movement like this.
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Re: Getting the movement like this.
Something like this?
- Attachments
-
- motion.love
- (2.11 KiB) Downloaded 409 times
Re: Getting the movement like this.
Dude I...I just love you
edit
"math.cos(math.pi * obj.angle / 180)"
So this is where I failed horribly, I completely forgot about the math.pi.
edit
"math.cos(math.pi * obj.angle / 180)"
So this is where I failed horribly, I completely forgot about the math.pi.
Re: Getting the movement like this.
Yes, LÖVE uses degrees, but Lua (math.sin and math.cos) uses radians...
Ah well...
Ah well...
- nightvenom
- Prole
- Posts: 36
- Joined: Sat Aug 16, 2008 3:07 pm
Re: Getting the movement like this.
Although i had no use for this, its pretty damn epic, didn't even know you could do that 0.o ill be fooling around with this
Re: Getting the movement like this.
So I finally have some time to mess around with this.
The next thing I wanted to implement would be a firing mode and another player. The second part isn't much of an issue, but the first one is and a big one at that.
I was thinking about making a body with a bullet sprite and make travel in the tanks center with it's direction and angle, so that when told to be fired it roars in the direction that the tank is facing and after some time another bullet is spawned in the tank.
The theory is pretty and all. But implementing it is the hard part, is it possible to apply an impulse to a body according to it's angle?
The next thing I wanted to implement would be a firing mode and another player. The second part isn't much of an issue, but the first one is and a big one at that.
I was thinking about making a body with a bullet sprite and make travel in the tanks center with it's direction and angle, so that when told to be fired it roars in the direction that the tank is facing and after some time another bullet is spawned in the tank.
The theory is pretty and all. But implementing it is the hard part, is it possible to apply an impulse to a body according to it's angle?
Re: Getting the movement like this.
True story: The abandoned game concept in that video was made in Löve. By me.
Re: Getting the movement like this.
Indeed, thanks for making me a LOVE addict :mrgreen:
Re: Getting the movement like this.
Ok, I somehow got the slug to be fired in the correct direction (seriously I have no idea how I did it) so now I just have to spawn a new slug in the tank after a predetermined time or after a collision.
Any thoughts on that?
Any thoughts on that?
Re: Getting the movement like this.
After you shoot, set a counter (number of seconds to wait), and subtract dt in each call of update(dt).
When the counter is zero (or less than zero) you know that the time has passed and you can allow another shot.
When the counter is zero (or less than zero) you know that the time has passed and you can allow another shot.
Who is online
Users browsing this forum: Bule, Google [Bot] and 2 guests