Game Engine (generic)

Hi, i am new to this forum, i am trying to make a game.

I am trying to make a “copy” of the tower defence game “Plants vs Zombies”. i love that game but the game offers no challenges after you complete the game. Also i am trying to make a game with more Scale, (bigger maps and lots of monster) i want to see the war at max. :smiley:

There is some “Engines” for games to make things easy for developers, i know few but i can only remeber “GreenFoot”.
My first question is “Is there more good engines for java? and What is the good of each?”

As i told greenfoot is a good engine it allows for rapid programming, but its dificult to make it work with “Eclipse” or other IDE. Also the interface is is stricted to what “greenfoot” designed.

The engine have about 5 Classes only, and could be enouff but i think it lacks much so i am making a new.

GreenFoot have the:
Actor -> An Actor is an object that exists in the Greenfoot world.
Greenfoot -> This utility class provides methods to control the simulation and interact with the system.
GreenfootImage -> An image to be shown on screen.
MouseInfo -> This class contains information about the current status of the mouse.
World -> World is the world that Actors live in.

This ideas of the game is Ok but there could be more like:
Menu -> Like a world but for Menu stuff
MenuItem -> like actors but for Menu

And some others.

The logic About the Engine.
Right now i have something like this:

Create a Swing interface and with a big Canvas. (All happens inside canvas)
Create a World like greenfoot ( in the constructor you put all items you want the world to have )
Define the bounds of the World
Create a Menu ( create all items for menu in the contructor )
Add the world to the menu (this is just a instance so you can acess directly)
define the bounds of the world

Its all created now…

Define the Frames per Second: (using later )

The reall engine comes next: i have it inside a diferent thread
We need to get the time of the PC (i use nanoseconds)
them do a while(true) and inside put this:
Get clock
render World and Menu
Run Update for world (menu should not be needed)
Get clock and check how much time this actions took
With this you need to calc what time is left till the next Loop (remeber about the Frames per second desired)
Wait for the next loop and repeat.

its all:
now you need to put the logic in the update of world and the visual in the render of it.

This work like a tree so you need to loop every child of each so they can do their “thing”

Hope this helps someone, and someone can help me to clean this idea. and add some more consepts.

Tomarow i will try to put some code about this.

Edit:
i have made some progress on the game and now its playable.

I have put the src files too.

Plz give some opinions. :smiley:

yes, ther are many good ones for jaava :). slick, pulpcore, GTGE, and rebirth are the first hat pop into my mind.

Fixed a Majox bug where the ball weapon was not being garbage collected after leaving the Screen.

That would make all balls leaving the screen still being calculated, so after some minutes the CPU would stat incrising the calcs needed and so the performance would continuosly drop.

its fixed now, but was good to find what i did wrong in the first place.

next task is implement the Cash on the game so it can be more balanced.

here is the current Source.

im confusecd, are u asking for engines? or are u making one?

[quote]My first question is “Is there more good engines for java? and What is the good of each?”
[/quote]
this would lead me to to think ur looking for one,

but it sounds like u just released a new version?

At first i was looking for a engine, but i didn’t liked any of those i found… :frowning:

So i tryed to make a new.

The game is already starting to become stable and having some features.

if someone want to support it would be cool.

After this is more stable i will release a Game pakage so other developers can use this engine in their games too.

the idea i am making is like this:

Create your window and them get a Canvas control and send to the “Game” object the instance of this canvas, a MyWorld, and a MyMenu.

then you just make some classes that extends this classes.

The idea is the engine support all developers need to start their game.

I am posting now a version that let you real play the game with the Credits like the original game.

Tips:
At first build 4 plants so you get the Sun needed to start mass the Shooters.

the game is endless so you can play as you want, the current wave number of monsters is exponencial… with 1.6 multiplier.

i added some debug to the game so you can see some info of the objects on map.