Auctus[0.1]

So I’ve created a pretty simple game in a matter of a couple of days (don’t ask me why it took so long to make something so simple), and I’ve got it sorted and ready to go. It’s called Auctus - which is the latin word for growth.

You start out as a square in a world full of other squares, your task is to consume the smaller squares and avoid the larger squares, similar to the Cell Stage in the game “Spore”, and the game “Feeding Frenzy”. It’s kinda fun, but in it’s very early and undeveloped form it’s also kinda crappy, and you have to exit the game every time you win or lose. You also lose a lot. It’s a little bit buggy still and will need a bit of fixing. The code’s messy too.

I’ve decided to release it open source, it’s in Java, so I know a lot of people on this particular forum can probably have fun modifying it and making it better, I’m really looking forward to that part.

I’ve created a .jar file for it to run from, so all you need to do is make sure that you have Java1.6 or higher installed on your computer, then you just have to double click the jar file, and the game should run.

Anyway, here’s some screen shots for you “no-pic-no-clickers”

What you’ll see when you first fire the game up.
[spoiler]


[/spoiler]

Game over screen, probably seen shortly after firing up the game.
[spoiler]

[/spoiler]

When you know you’ll win.
[spoiler]

[/spoiler]

When you’ve pretty much won.
[spoiler]

[/spoiler]

What you’ll see when you win
[spoiler]

[/spoiler]

And finally, here’s the download link, not adf.ly ridden, you’ll be pleased to know.
Download: http://goo.gl/tqMKo - 8.12MB (Megabytes) - 8 seconds download on a standard 8Mbps download speed.
Source: http://goo.gl/QM8sn - 2.04KB (Kilobytes) - Less than a second to download on most, if not all internet connections.

A heads up before I play - your download link has several typos.

Ok played [and lost] the game, and to make this game 1000x better, change

numberOfEnemies = 500

to like

numberOfEnemies = 5

, or better yet, remove that variable entirely. Change the win condition to a particular size, which is greater than or equal to the maximum size of the enemies, and include spawning code. On a side note, your enemies should be a List, not an array.

Here is an example of what I would expect your spawn code to look like.


private static final float SPAWN_CHANCE = 0.01f;
private static final int MAX_ENEMIES = 25; // or something
private static final int WIDTH = 640; // or whatever it is
private static final int HEIGHT = 480; // again, the actual number
private static final int MAX_SIZE = 25; // whatever your max size is

private Random gen;

...

private void spawn() {
  if(enemies.size() < MAX_ENEMIES && gen.nextFloat() < SPAWN_CHANCE) {
     float x = gen.nextFloat() * WIDTH;
     float y = gen.nextFloat() * HEIGHT;
     float xVel = (gen.nextFloat() + 1) * 3; // this can be changed of course
     float yVel = (gen.nextFloat() + 1) * 3; // again, can be changed
     float size = gen.nextInt(MAX_SIZE); // no idea what you use
     enemies.add(new Enemy(world, x, y, xVel, yVel, size)); // Or whatever your constructor is, but this is what I would expect
  }
}

..

private boolean checkIfWin() {
  return player.getSize() >= MAX_SIZE;
}

Another thing I noticed, you generally want to avoid polling input in the same spot you move, make an update method (Or use slicks one) and do it there. When polling input, set the velocity of the character. This also allows for neat effects like you speed up to the max velocity and slow down to zero, or making it take a moment to change directions. Being a square I’d imagine it takes a bit to get moving.

Also with this kind of spawning, you can make it fancy and have it make less and less small squares as you get bigger, and less huge ones when you are tiny.

http://goo.gl/tqMKo is the correct link, I believe

Moved to WIP board :point:

Yes, I’ll change that now. Thanks.

Quite a fun game! After about ten thousand a dozen or so tries, I managed to win twice. :smiley:

Just a suggestion, but you should probably set a minimum size for your square. To avoid things like this…

That’s brilliant, I was looking for a way to make it do that but wasn’t sure how, thank you! I’ll change that when I get a chance.

Yeah, I definitely had that on the list to do before I uploaded it, but if I wasn’t ashamed of the mess I had uploaded, it wouldn’t be version 1.

Of course, nothing to be ashamed of, it’s 1million times better than the average computer user has ever done =)

Broh, yeah I said broh, don’t worry about how ugly the code is or how horrible the design is. We all start some where. I should show you some of my early code. Everything in one huge ass class.

And it looks like you use lwjgl? It is no easy feat to get stuff working in opengl. Keep up the work.

I would recommend getting some images in there as a next step. Get a background going and maybe make the squares into textured quads. Just 3 images: background, good guy, and bad guy. If you need help ask around here as we have a great many people who are quite pro at opengl.

Very difficult and fun. However, the fps counter is showing things like 700 fps. I would recommend you cap the fps to increase performance, as when I run the program I get around 70% CPU usage.

doesnt run for me :frowning: i get this error

Exception in thread “main” java.lang.UnsatisfiedLinkError: no lwjgl in java.library.path
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1758)
at java.lang.Runtime.loadLibrary0(Runtime.java:823)
at java.lang.System.loadLibrary(System.java:1045)
at org.lwjgl.Sys$1.run(Sys.java:73)
at java.security.AccessController.doPrivileged(Native Method)
at org.lwjgl.Sys.doLoadLibrary(Sys.java:66)
at org.lwjgl.Sys.loadLibrary(Sys.java:95)
at org.lwjgl.Sys.(Sys.java:112)
at org.lwjgl.opengl.Display.(Display.java:132)
at org.newdawn.slick.AppGameContainer$1.run(AppGameContainer.java:39)
at java.security.AccessController.doPrivileged(Native Method)
at org.newdawn.slick.AppGameContainer.(AppGameContainer.java:36)
at auctus.Auctus.main(Auctus.java:204)

This is really hard :stuck_out_tongue: ! Pretty fun though.
Sometimes I have no time to react, I die almost instantly. Starting with a better position would be a good idea :slight_smile: