Camera Shake? / Collisions / Enemies...

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.
User avatar
Ryne
Party member
Posts: 444
Joined: Fri Jan 29, 2010 11:10 am

Re: Camera Shake? / Collisions / Enemies...

Post by Ryne »

Mud wrote:I love the look of your game. Did you do the sprites?
Thanks!, and yes, Everything you see is all me :). I used to do draw a lot, so pixel art comes naturally. Actually, pixel art is easier, since you can be pixel-perfect with everything and if there is a mistake it usually just comes down to 1 or 2 pixels that need fixing. Although my zombies need complete fixing, I drew them at around 4am last night, and now that I look at them I'm not impressed...

I also went with the "cute" looks since cute + violence is oddly appealing.
@rynesaur
User avatar
zac352
Party member
Posts: 496
Joined: Sat Aug 28, 2010 8:13 pm
Location: In your head.
Contact:

Re: Camera Shake? / Collisions / Enemies...

Post by zac352 »

Enemies? I can help with that. I wrote life. It's somewhere in projects if you want to look.

I can also help with their pathfinding, I've successfully implemented the A* algorithm before. ;)
Hello, I am not dead.
User avatar
Ryne
Party member
Posts: 444
Joined: Fri Jan 29, 2010 11:10 am

Re: Camera Shake? / Collisions / Enemies...

Post by Ryne »

zac352 wrote:Enemies? I can help with that. I wrote life. It's somewhere in projects if you want to look.

I can also help with their pathfinding, I've successfully implemented the A* algorithm before. ;)
Thats great! I can create and spawn an enemy just fine (as you can see in the demo) but I'm unsure on how to add multiple enemies. They won't spawn in random areas though, they will actually approach from the right off screen and walk towards the enemy. Any Ideas would be appreciated, I'm still wondering what's causing the issue in my last post.
@rynesaur
User avatar
zac352
Party member
Posts: 496
Joined: Sat Aug 28, 2010 8:13 pm
Location: In your head.
Contact:

Re: Camera Shake? / Collisions / Enemies...

Post by zac352 »

Ryne wrote:
zac352 wrote:Enemies? I can help with that. I wrote life. It's somewhere in projects if you want to look.

I can also help with their pathfinding, I've successfully implemented the A* algorithm before. ;)
Thats great! I can create and spawn an enemy just fine (as you can see in the demo) but I'm unsure on how to add multiple enemies. They won't spawn in random areas though, they will actually approach from the right off screen and walk towards the enemy. Any Ideas would be appreciated, I'm still wondering what's causing the issue in my last post.
What exactly do you need?
Hello, I am not dead.
User avatar
Ryne
Party member
Posts: 444
Joined: Fri Jan 29, 2010 11:10 am

Re: Camera Shake? / Collisions / Enemies...

Post by Ryne »

Ryne wrote: Also something weird is happening when I package the game as a .love file. The enemy approaches from the left instead of the right If I play directly from the folder. Even more odd is that if the .love file isn't in the same directory as the LOVE shortcut enemy approaches from the left, but if its in the same directory enemy approaches from the right. Is this happening for anyone else?
It's odd and its tickling my O.C.D.

As for the enemies, I'm not sure what I need since I'm unsure of an efficient way to create a horde. Ideally, I would like to be able to freely call as many zombies as I want to the field. I'm just wondering if it's easier than it seems :p
@rynesaur
User avatar
zac352
Party member
Posts: 496
Joined: Sat Aug 28, 2010 8:13 pm
Location: In your head.
Contact:

Re: Camera Shake? / Collisions / Enemies...

Post by zac352 »

... That's really weird. :huh:
As for the enemies, I'm not sure what I need since I'm unsure of an efficient way to create a horde. Ideally, I would like to be able to freely call as many zombies as I want to the field. I'm just wondering if it's easier than it seems :p
I will work on it when I get home.
* Hording
* Spawning
Short list. :P
Hello, I am not dead.
User avatar
Ryne
Party member
Posts: 444
Joined: Fri Jan 29, 2010 11:10 am

Re: Camera Shake? / Collisions / Enemies...

Post by Ryne »

zac352 wrote:... That's really weird. :huh:
As for the enemies, I'm not sure what I need since I'm unsure of an efficient way to create a horde. Ideally, I would like to be able to freely call as many zombies as I want to the field. I'm just wondering if it's easier than it seems :p
I will work on it when I get home.
* Hording
* Spawning
Short list. :P
Awesome! Ill check it out after I sleep for 14 hours, Hopefully someone will be able to shed some light on my odd problem. :|
@rynesaur
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: Camera Shake? / Collisions / Enemies...

Post by Robin »

What is the code that causes them to come from the one side or the other, exactly?
Help us help you: attach a .love.
User avatar
Ryne
Party member
Posts: 444
Joined: Fri Jan 29, 2010 11:10 am

Re: Camera Shake? / Collisions / Enemies...

Post by Ryne »

Robin wrote:What is the code that causes them to come from the one side or the other, exactly?
This is the only code that has to do with player location. It's what I'm currently to make the enemy follow the player.

Code: Select all

	if CheckCollision(player, enemy) == false then
	enemy.x = enemy.x + (player.x - enemy.x) * (dt - 0.01)
	enemy.y = enemy.y + (player.y - enemy.y) * (dt - 0.01)
	end
@rynesaur
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: Camera Shake? / Collisions / Enemies...

Post by Robin »

Three things:
  1. Now I'm not sure what the issue was. Wasn't it the initial position of the enemy weird?
  2. You could change the if-statement to if not CheckCollision(player, enemy) then. It works the same, but you're less likely to get odd looks from others. ;) Perhaps if you rename the function to hasCollision or isCollision or so it will make more sense?
  3. The enemy speed doesn't have an upper limit: the further they are away, the faster they will go. Off the top of my head, that will probably mean that:
    1. You can't outrun the zombies. Ever.
    2. Any horde will end up in one jumbling mess, since the ones at the back move faster than the ones in front.
Help us help you: attach a .love.
Post Reply

Who is online

Users browsing this forum: Google [Bot] and 48 guests