Tag Archives: flashpunk

The Plants are Planting, and Synthesizing Food

Well, I’ve been working a bit more on the first a-life experiment. So far, I have some ugly scaling bitmap plants that grow over time. Some of them are overlapping the boundary of the sandbox though and I don’t want to have that, so I need to make them move away from it when they touch it. Also, future me, draw your graphics large and scale them down. I don’t know what I was thinking making little green dots and scaling them up like this…

A big problem I’ve got is that when the plant collides with the sandbox boundary, it doesn’t give me the location of the collision. It’ll give me the colliding entity, and if it was a regular entity I could extrapolate the collision based on its location and dimensions, but in this case I’m using a tilemap and it doesn’t give me the tile’s info, it gives me the TILEMAP’s coord, which is 0,0.

Oho! I have come up with an idea. It’s a bit dirty but if I make sure that, upon growth, the plant is at least 16px from the border, it won’t overlap!

… Not sure that’s a great idea.

Instead, I think I’ll just futz it, leave it as it is, and only spawn plants at least their maximum size away from the walls.

*work work work* Okay, looking good! The plants are functional, so it’s time to add the animals. To start with, I’ll be making a mobile herbivore that will eat the plants, mate, reproduce, and die of old age.

They’ll need to have a sense of some kind to tell what’s around them, what direction to go, and so on. I’m thinking I’ll give them a radial sense, since most herbivores have a wide range of vision. I might give them a sense of smell, too. Sight will give them the exact location of a thing if it’s in range, and smell will have a longer range and give them a general direction to go in.

I’ll start by making them sense food and eat it; I won’t do reproduction untill I at least have them moving around and finding food.

But, for now, it’s getting busy in the cafe, I’m getting tired, the sun is shining in my face, and I’m all done my food. I think I’m going to head home.

Tagged , ,

A Beginning for A-Life

Today I don’t feel like working with text, but I can’t relax and play, so I’ve got to work on something else. So, I’m going to start doing the other option of the two I started with, when I started the text game. I’m going to start doing some A-Life experiments.

So, I’m going to keep on using HaXe and target Flash, so I’ll basically be making a flash app in HaXe. It seems like a decent language, especially for Flash development, and I can re-use code from it pretty easily.

First I’m going to do some experiments with how I want to render this. I might use a library, there’s a bunch of them out there. This HaXePunk looks good; it’s a HaXe port of FlashPunk. There’s one of Flixel too but it doesn’t look as good.

Hmm, they both need something called NME, which is related to HaXe…

It looks like NME is an extension API for HaXe which makes it even easier to do multiplatform programming.

Let’s try this NME out… *downloads an example, compiles, builds, runs* Yeah that works. I love it when things work.

*read read* Oh I see, NME basically has an interface like Flash, but you can target to other platforms with the same code. So, you can code the interface with HaXe instead of doing a different interface for each platform. That’s cool.

I’m taking a long time messing around with Libraries, I haven’t even touched the A-Life experiments I was going to start. Maybe I won’t get to them today, we’ll see. I’ll have to eat soon.

*read read read* awe6 seems good too, though. I should check them out later. FlashPunk seems more familiar, for now. It’s interesting and noteworthy that the same game on Flash and JavaScript/HTML5 is much faster for me in Flash. I guess JS/HTML5 has a ways to go yet.

I haven’t done much besides decide which library I’m going to use, but now it’s time for meal and break. I’m sure there will be interesting things coming up!

Tagged , , , ,