Hot answers tagged java
4
You should clearly separate GUI (view) from the actual game state (model). GUI just shows the model to the player (in one way or another) and lets the player control it, but the model itself is solid enough to know everything it needs (level, player, etc). The GUI should know only things GUI needs, which model does not care about (e.g. controls positions).
3
I don't know much about java.awt but from the documentation I can tell you this:
The antialiasing option you are using does not use multiple samples like MSAA and thus does not support the MSAA x2, x4 ... sample counts. The antialiasing method of awt blends the edge pixels with the destination surface by using the exact coverage of the target pixel as the ...
3
Can I just suggest that you absolutely forget about biomes if you can't make and use height-maps yet.
Step by step is the way to go.
A +---+---+ B
|\..|\..|
|.\.|.\.|
|..\|..\|
+---+---+ Y
|\..|\..| |
|.\.|.\.| |
|..\|..\| |
C +---+---+ D ---------x
imagine the +'s as the vertices of your mesh. Simply randomize the ...
2
You would probably be better off having your artists produce variations on the default color set, and decide which one to use when the zombie is initially created. The implementation you are using now performs per texel checks to only change a specific color, and say your image is 100x100, that is 10,000 color checks per zombie, on top of the final draw ...
2
I agree with the people in the comments. It's very hard to do these kinds of things. I recommend looking into Perlin Noise more before you attempt anything. Another thing is to look into Simplex Noise, but I'd start with Perlin Noise, just classier :).
Perlin Noise Info
How it works
This should give you a slight idea about using it
Perlin Worms - This is ...
1
You could probably benefit of a data driven approach.
I'm assuming the premisse that every card might have one or more associated effects, or it can just have some stats and no special effect, something like M:tG.
You can create the effects each on it own class and probably use a factory to generate them as the cards are instantiated. The more generic the ...
1
Your problem is that you are doing the update logic in keyPressed() method.
When you press a key, AWT will call this method once. After a delay (typically 250-1000 milliseconds) it starts calling this method again repeatedly with a smaller delay (typically 30-400 milliseconds). When the key is released, this repetition stops and keyReleased() method is ...
1
The answer to your specific question, how does the GUI know about the level being played, is: it doesn't.
The GUI displays everything it's being told to display, but it doesn't have any information about what that data actually is.
A common approach is to use a message system to pass messages from one component to another. When the LevelLoader has finished ...
1
You need to create polygons to check for collisions and check them every step in updating the position. I found example in the internet and try translate comments to English.
You can download example.
Other way is creating collision map, like this
P.S. Sorry for Google-translate.
Only top voted, non community-wiki answers of a minimum length are eligible
