Search found 5 matches

by Alecal
Wed May 04, 2011 1:18 am
Forum: Support and Development
Topic: Shooting collision help needed!
Replies: 3
Views: 1621

Shooting collision help needed!

Hello LÖVE-users! I need help with some shooting in a zombie game me and a friend of mine made (with alot of help from LÖVE user schme16) Basically we just need help with the shooting in the game! I've made the graphics and my friend the music. We've both been coding but we just cant seem to get th...
by Alecal
Sat Mar 26, 2011 5:22 pm
Forum: Support and Development
Topic: Some coding help!
Replies: 8
Views: 3588

Re: Some coding help!

I've made a lot of changes, I really only meant to do a quick fix, but the more I thought about it the more I felt you could benefit from using the camera lib, and creating a table of enemies, this helps scale the project later on, I also tried to straighten out some of the code blocks, getting the...
by Alecal
Sat Mar 26, 2011 1:59 pm
Forum: Support and Development
Topic: Some coding help!
Replies: 8
Views: 3588

Re: Some coding help!

Hey Alecal. I think you need to clarify what behavior you are trying to program for the enemies. If you want the enemy to move towards the player (at a constant speed) then the code should look something like: local dx = (x - enx) local dy = (y - eny) local dist = math.sqrt ( dx * dx + dy * dy ) --...
by Alecal
Fri Mar 25, 2011 7:57 am
Forum: Support and Development
Topic: Some coding help!
Replies: 8
Views: 3588

Re: Some coding help!

ishkabible wrote:

Code: Select all

enx = enx + mo
maybe this is what you want?
I actually went to write enx + mo
Yeah, no... It doesn't work :(
The thing is, since it does it in the update thing, when the variable grows bigger the enemy flies away faster and further the bigger the variable gets
by Alecal
Thu Mar 24, 2011 9:07 pm
Forum: Support and Development
Topic: Some coding help!
Replies: 8
Views: 3588

Some coding help!

Hey guys! I'm new to the forums and new to coding in LUA with löve ^^ I'm making a game and I need some help with the coding :megagrin: The code I've made is enx = enx + (x - enx) * (dt - 0.01) eny = eny + (y - eny) * (dt - 0.01) Where enx & eny is the enemys position and x & y is the playe...