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.
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.