Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - Minverva

Pages: 1 ... 5 6 [7]
Sorry I've been really busy the last 48 hours so I wasn't able to take the time to reply earlier.

As for your second query, I haven't really done any path-finding work yet, but let me run an idea by you:

Create random waypoints for each enemy so they'll go to different spots.

Let me write this out a bit so you can see what I mean and maybe you can fit it in with the waypoint algorithm you are using.

zombie.waypoint.x = player.x + (FlxG.random() * 50) -25;
zombie.waypoint.y = player.y + (FlxG.random() * 50) -25;

This would create a random waypoint between -25 to 25 pixels from the player (you might want to increase the pixel amount). You'd want this to be contained in an if statement so it only does this algorithm when the zombies are far from the player, but when they get close they'll switch to going directly after the player. This should make them (sort of) try to surround the player before going in for the kill which should give the game a really nice feeling.

Like it?

By the way, are your zombies contained within an array? I seem to recall that they weren't. You might want to do that.

I don't understand how you don't know where to put this stuff since you seem to be aware of the update function?

In any case, I'd personally do it a different way, something along the lines of:

timer += FlxG.elapsed;

if (FlxU.abs(player.x-zombie.x) > (FlxU.abs(player.y-zombie.y) && timer > .5)
if(player.x > zombie.x) zombie.velocity.x = 100;
else zombie.x = -100;
zombie.velocity.y = 0;
timer = 0;
if(player.y > zombie.y) zombie.velocity.y = 100;
else zombie.y = -100;
zombie.velocity.x = 0;
timer = 0;

This would make it so the zombie would take the longest route first before switching and it only switches a minimum of every half-second so it shouldn't do any diagonal shuffling when it starts getting close.

You'd want this to be in the update function for your zombie class file.

help / Re: Circular movement question
« on: Tue, Sep 3, 2013 »
My impression is that the best way to do this would be to constantly find the angle between the two objects and then use sin/cos to constantly update the x/y acceleration. You'd also want the acceleration to be based on the distance between the objects.

From there it would just be a matter of putting in the correct initial velocity to put it into orbit.

This should pretty closely simulate actual planetary mechanics right?

Your game looks so nice. I wish I could draw like that.

help / Re: Destroying Blocks in Mode
« on: Sat, Aug 17, 2013 »
Well, I am using an earlier version of it (2.34).

Can you not call hurt() on the blocks from an overlap function in your version?

help / Destroying Blocks in Mode
« on: Wed, Aug 14, 2013 »
I've been playing around with Mode and I noticed that when I hurt blocks I can destroy them - which is really neat, but the problem is that the block chunks seem to be full of "empties" so when I destroy the outer layer you have these intangible but visible blocks.

Any thoughts on how to get rid of the empties?

Pages: 1 ... 5 6 [7]