Page 5 of 6

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

Posted: Mon Nov 08, 2010 10:29 am
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.

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

Posted: Mon Nov 08, 2010 12:32 pm
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. ;)

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

Posted: Mon Nov 08, 2010 1:02 pm
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.

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

Posted: Mon Nov 08, 2010 1:57 pm
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?

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

Posted: Mon Nov 08, 2010 1:58 pm
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

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

Posted: Mon Nov 08, 2010 2:01 pm
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

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

Posted: Mon Nov 08, 2010 2:12 pm
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. :|

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

Posted: Mon Nov 08, 2010 6:05 pm
by Robin
What is the code that causes them to come from the one side or the other, exactly?

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

Posted: Mon Nov 08, 2010 6:09 pm
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

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

Posted: Mon Nov 08, 2010 6:23 pm
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.