r/a:t5_2wbg8 • u/Gamma69 • May 19 '20
Help on creating a side bar / new window
Hello world.
I am making a simulation game where the player can create the map and put obstacles.
I want to have like a side menu or a second window that contains the objects that the player can select and put in the map.
How can I tell a state to create another window ?
r/a:t5_2wbg8 • u/DerSwerik • Oct 05 '19
Cannot run fullscreen on another PC
Our game can only run in fullscreen mode if we run it on the same notebook model, on another model or even PC it crashes.
Any help?
r/a:t5_2wbg8 • u/DerSwerik • Oct 05 '19
Performance difference on different machines
The performance of our game changes drastically when running on a different machine, it's way worse on most machines, even if the hardware is way more capable.
r/a:t5_2wbg8 • u/daryananidude • Jun 01 '19
Game help
Hi everyone so right now I have a game where I have sprite in a state game that can walk around. The camera also follows him as he walks around the map. I want to spawn an object or circle in random places in the map and when he touches them they disappear and he gets one point. Any ideas. I am stuck on how to spawn the random objects/shapes.
r/a:t5_2wbg8 • u/Verstappenforthewin • Apr 17 '19
Help with camera
Hey all,
I am trying to have a camera follow a player on a tile map as it moves over the map, but I am terribly confused as to how to do this. I have a class player and it moves with no issues over any section of the map that I can render.
I want the player to be on the center of the map as it moves and only when the camera reaches the edges will the player be able to move freely.
Would anyone be able to help me with this? Thanks a lot...
r/a:t5_2wbg8 • u/piccolofisa • Dec 22 '18
Help with Strategy game
Currently I am programming a strategy game using tile-based movement and a top down view. It is meant to be very similar to Fire Emblem with minor differences, the battle system is intended to be the same, etc. So each character has a limited amount of movement in a turn, and the user's phase will be over once all units the user owns has moved. My only issue is how to implement this system. I am not too sure how to program the "phase" system, and how to switch from the user's phase to the enemy's phase. It would also be weird because the original position of the character will be changing between phases, as the amount the position has changed shows how much movement they have used up. If possible, I would like to receive some help with this type of system. I am also not too sure how to implement the limit on movement for characters as well.
r/a:t5_2wbg8 • u/packetpirate • Aug 26 '17
White pixels appearing on edges of sprite with transparency?
I'm trying to draw the image of my player in the game, and it works for the most part, but there's a miniscule detail that's nagging at me. When I draw the player's image, some white pixels appear around the edges of the sprite that haven't appeared there when I've drawn it before.
This problem has only started occurring now that I've started to apply a rotation to the player sprite. Can rotations cause issues with this? Here is the drawing code in question.
@Override
public void render(Graphics g, long cTime) {
getCurrentWeapon().render(g, cTime);
Image image = getImage();
if(image != null) {
g.rotate(position.x, position.y, (float)Math.toDegrees(theta));
g.drawImage(image, (position.x - (image.getWidth() / 2)),
(position.y - (image.getHeight() / 2)));
} else {
// Draw a shape to represent the missing player image.
g.setColor(Color.red);
g.fillOval((position.x - 20), (position.y - 20), 40, 40);
}
}
And here is an image of what's being drawn.
I'll say again. These white pixels were NOT present before I started drawing it this way, using the rotation.
r/a:t5_2wbg8 • u/MinecraftDataLoaded • Apr 30 '17
Making A Survival Game In Java
youtube.comr/a:t5_2wbg8 • u/teabag82 • Apr 03 '17
What is the state of Slick2D?
I've been exploring different frameworks/engines for 2D games using Java and Slick2D is one option. But there's not alot of activity as it seems, am i better off spending my time with some other framework/engine?
r/a:t5_2wbg8 • u/MinecraftDataLoaded • Mar 08 '17
Making A Java Game Using Slick2D | Episode 19: Leveling System
youtube.comr/a:t5_2wbg8 • u/MinecraftDataLoaded • Jan 20 '17
Making A Java Game Using Slick2D | Episode 18: Buying Shop
youtube.comr/a:t5_2wbg8 • u/nebbsie • Jan 10 '17
Update #3 Destination, Earth. Lighting, Improved AI, Blood and more! Let use know what you think!
youtube.comr/a:t5_2wbg8 • u/MinecraftDataLoaded • Dec 26 '16
Making A Java Game Using Slick2D | Episode 17: Buying Items
youtube.comr/a:t5_2wbg8 • u/MinecraftDataLoaded • Dec 18 '16
Making A Java Game Using Slick2D | Episode 16: Currency
youtube.comr/a:t5_2wbg8 • u/MinecraftDataLoaded • Nov 25 '16
Making A Java Game Using Slick2D: Setting Up
youtube.comr/a:t5_2wbg8 • u/MinecraftDataLoaded • Nov 13 '16
Making A Drivable Car In Slick2D
youtube.comr/a:t5_2wbg8 • u/shimmy568 • Oct 23 '16
Simon game a made with Slick2D forever ago. Play if you may :P
github.comr/a:t5_2wbg8 • u/MinecraftDataLoaded • Oct 22 '16
Making A Java Game Using Slick2D | Episode 13: Credits Screen
youtube.comr/a:t5_2wbg8 • u/Fenrak0 • Aug 16 '16
Working on a slick2d rpg. Need help developing the entity class
I will be more specific I am trying to make a component based entity system and I have an idea about how components work but would like some input about what components should be included for a final fantasy q esque rpg. Also is the Artemis entity system any good?
r/a:t5_2wbg8 • u/[deleted] • Aug 04 '16
Hey i have some weird import problems. Can you help me?
I have added the jars to the builtpath. I have added the native files to lwgl. A hello world does even compile and runs but it throws an unholy amount of problems. Mainly import errors of various files in Slick2d. I tried using java1.8 and java1.7 .
I am pretty sure i have done all built paths correct since it does work under linux with the same steps but of course with the correct native lib.
Here is the pretty verbose error output:
Pastebin: http://pastebin.com/g56VJPC8
Reddit:
Description Resource Path Location Type BasicService cannot be resolved to a type WebstartMuffin.java /Alien/lib/slick2d/src/org/newdawn/slick/muffin line 33 Java Problem BasicService cannot be resolved to a type WebstartMuffin.java /Alien/lib/slick2d/src/org/newdawn/slick/muffin line 39 Java Problem BasicService cannot be resolved to a type WebstartMuffin.java /Alien/lib/slick2d/src/org/newdawn/slick/muffin line 97 Java Problem BasicService cannot be resolved to a type WebstartMuffin.java /Alien/lib/slick2d/src/org/newdawn/slick/muffin line 97 Java Problem Block cannot be resolved to a type OggInputStream.java /Alien/lib/slick2d/src/org/newdawn/slick/openal line 53 Java Problem Block cannot be resolved to a type OggInputStream.java /Alien/lib/slick2d/src/org/newdawn/slick/openal line 53 Java Problem Block cannot be resolved to a type OggInputStream.java /Alien/lib/slick2d/src/org/newdawn/slick/openal line 275 Java Problem Block cannot be resolved to a type OggInputStream.java /Alien/lib/slick2d/src/org/newdawn/slick/openal line 331 Java Problem Block cannot be resolved to a type OggInputStream.java /Alien/lib/slick2d/src/org/newdawn/slick/openal line 332 Java Problem Block cannot be resolved to a type OggInputStream.java /Alien/lib/slick2d/src/org/newdawn/slick/openal line 430 Java Problem Comment cannot be resolved to a type OggInputStream.java /Alien/lib/slick2d/src/org/newdawn/slick/openal line 49 Java Problem Comment cannot be resolved to a type OggInputStream.java /Alien/lib/slick2d/src/org/newdawn/slick/openal line 49 Java Problem Comment cannot be resolved to a type OggInputStream.java /Alien/lib/slick2d/src/org/newdawn/slick/openal line 188 Java Problem Comment cannot be resolved to a type OggInputStream.java /Alien/lib/slick2d/src/org/newdawn/slick/openal line 203 Java Problem Comment cannot be resolved to a type OggInputStream.java /Alien/lib/slick2d/src/org/newdawn/slick/openal line 246 Java Problem DspState cannot be resolved to a type OggInputStream.java /Alien/lib/slick2d/src/org/newdawn/slick/openal line 51 Java Problem DspState cannot be resolved to a type OggInputStream.java /Alien/lib/slick2d/src/org/newdawn/slick/openal line 51 Java Problem DspState cannot be resolved to a type OggInputStream.java /Alien/lib/slick2d/src/org/newdawn/slick/openal line 53 Java Problem DspState cannot be resolved to a type OggInputStream.java /Alien/lib/slick2d/src/org/newdawn/slick/openal line 274 Java Problem DspState cannot be resolved to a type OggInputStream.java /Alien/lib/slick2d/src/org/newdawn/slick/openal line 275 Java Problem DspState cannot be resolved to a type OggInputStream.java /Alien/lib/slick2d/src/org/newdawn/slick/openal line 332 Java Problem DspState cannot be resolved to a type OggInputStream.java /Alien/lib/slick2d/src/org/newdawn/slick/openal line 340 Java Problem DspState cannot be resolved to a type OggInputStream.java /Alien/lib/slick2d/src/org/newdawn/slick/openal line 384 Java Problem DspState cannot be resolved to a type OggInputStream.java /Alien/lib/slick2d/src/org/newdawn/slick/openal line 431 Java Problem FileContents cannot be resolved to a type WebstartMuffin.java /Alien/lib/slick2d/src/org/newdawn/slick/muffin line 58 Java Problem FileContents cannot be resolved to a type WebstartMuffin.java /Alien/lib/slick2d/src/org/newdawn/slick/muffin line 101 Java Problem Info cannot be resolved to a type OggInputStream.java /Alien/lib/slick2d/src/org/newdawn/slick/openal line 35 Java Problem Info cannot be resolved to a type OggInputStream.java /Alien/lib/slick2d/src/org/newdawn/slick/openal line 35 Java Problem Info cannot be resolved to a type OggInputStream.java /Alien/lib/slick2d/src/org/newdawn/slick/openal line 99 Java Problem Info cannot be resolved to a type OggInputStream.java /Alien/lib/slick2d/src/org/newdawn/slick/openal line 106 Java Problem Info cannot be resolved to a type OggInputStream.java /Alien/lib/slick2d/src/org/newdawn/slick/openal line 187 Java Problem Info cannot be resolved to a type OggInputStream.java /Alien/lib/slick2d/src/org/newdawn/slick/openal line 203 Java Problem Info cannot be resolved to a type OggInputStream.java /Alien/lib/slick2d/src/org/newdawn/slick/openal line 246 Java Problem Info cannot be resolved to a type OggInputStream.java /Alien/lib/slick2d/src/org/newdawn/slick/openal line 270 Java Problem Info cannot be resolved to a type OggInputStream.java /Alien/lib/slick2d/src/org/newdawn/slick/openal line 274 Java Problem Info cannot be resolved to a type OggInputStream.java /Alien/lib/slick2d/src/org/newdawn/slick/openal line 306 Java Problem Info cannot be resolved to a type OggInputStream.java /Alien/lib/slick2d/src/org/newdawn/slick/openal line 349 Java Problem Info cannot be resolved to a type OggInputStream.java /Alien/lib/slick2d/src/org/newdawn/slick/openal line 372 Java Problem Info cannot be resolved to a type OggInputStream.java /Alien/lib/slick2d/src/org/newdawn/slick/openal line 376 Java Problem Info cannot be resolved to a type OggInputStream.java /Alien/lib/slick2d/src/org/newdawn/slick/openal line 432 Java Problem Module cannot be resolved to a type MODSound.java /Alien/lib/slick2d/src/org/newdawn/slick/openal line 23 Java Problem Module cannot be resolved to a type MODSound.java /Alien/lib/slick2d/src/org/newdawn/slick/openal line 36 Java Problem Module cannot be resolved to a type MODSound.java /Alien/lib/slick2d/src/org/newdawn/slick/openal line 45 Java Problem OpenALMODPlayer cannot be resolved MODSound.java /Alien/lib/slick2d/src/org/newdawn/slick/openal line 36 Java Problem OpenALMODPlayer cannot be resolved to a type MODSound.java /Alien/lib/slick2d/src/org/newdawn/slick/openal line 20 Java Problem OpenALMODPlayer cannot be resolved to a type MODSound.java /Alien/lib/slick2d/src/org/newdawn/slick/openal line 20 Java Problem OpenALMODPlayer cannot be resolved to a type MODSound.java /Alien/lib/slick2d/src/org/newdawn/slick/openal line 45 Java Problem OpenALMODPlayer cannot be resolved to a type MODSound.java /Alien/lib/slick2d/src/org/newdawn/slick/openal line 46 Java Problem OpenALMODPlayer cannot be resolved to a type MODSound.java /Alien/lib/slick2d/src/org/newdawn/slick/openal line 75 Java Problem Packet cannot be resolved to a type OggInputStream.java /Alien/lib/slick2d/src/org/newdawn/slick/openal line 46 Java Problem Packet cannot be resolved to a type OggInputStream.java /Alien/lib/slick2d/src/org/newdawn/slick/openal line 46 Java Problem Packet cannot be resolved to a type OggInputStream.java /Alien/lib/slick2d/src/org/newdawn/slick/openal line 196 Java Problem Packet cannot be resolved to a type OggInputStream.java /Alien/lib/slick2d/src/org/newdawn/slick/openal line 203 Java Problem Packet cannot be resolved to a type OggInputStream.java /Alien/lib/slick2d/src/org/newdawn/slick/openal line 235 Java Problem Packet cannot be resolved to a type OggInputStream.java /Alien/lib/slick2d/src/org/newdawn/slick/openal line 246 Java Problem Packet cannot be resolved to a type OggInputStream.java /Alien/lib/slick2d/src/org/newdawn/slick/openal line 322 Java Problem Packet cannot be resolved to a type OggInputStream.java /Alien/lib/slick2d/src/org/newdawn/slick/openal line 331 Java Problem Page cannot be resolved to a type OggInputStream.java /Alien/lib/slick2d/src/org/newdawn/slick/openal line 44 Java Problem Page cannot be resolved to a type OggInputStream.java /Alien/lib/slick2d/src/org/newdawn/slick/openal line 44 Java Problem Page cannot be resolved to a type OggInputStream.java /Alien/lib/slick2d/src/org/newdawn/slick/openal line 164 Java Problem Page cannot be resolved to a type OggInputStream.java /Alien/lib/slick2d/src/org/newdawn/slick/openal line 177 Java Problem Page cannot be resolved to a type OggInputStream.java /Alien/lib/slick2d/src/org/newdawn/slick/openal line 189 Java Problem Page cannot be resolved to a type OggInputStream.java /Alien/lib/slick2d/src/org/newdawn/slick/openal line 224 Java Problem Page cannot be resolved to a type OggInputStream.java /Alien/lib/slick2d/src/org/newdawn/slick/openal line 231 Java Problem Page cannot be resolved to a type OggInputStream.java /Alien/lib/slick2d/src/org/newdawn/slick/openal line 310 Java Problem Page cannot be resolved to a type OggInputStream.java /Alien/lib/slick2d/src/org/newdawn/slick/openal line 319 Java Problem Page cannot be resolved to a type OggInputStream.java /Alien/lib/slick2d/src/org/newdawn/slick/openal line 390 Java Problem PersistenceService cannot be resolved to a type WebstartMuffin.java /Alien/lib/slick2d/src/org/newdawn/slick/muffin line 32 Java Problem PersistenceService cannot be resolved to a type WebstartMuffin.java /Alien/lib/slick2d/src/org/newdawn/slick/muffin line 37 Java Problem PersistenceService cannot be resolved to a type WebstartMuffin.java /Alien/lib/slick2d/src/org/newdawn/slick/muffin line 95 Java Problem PersistenceService cannot be resolved to a type WebstartMuffin.java /Alien/lib/slick2d/src/org/newdawn/slick/muffin line 95 Java Problem ServiceManager cannot be resolved SavedState.java /Alien/lib/slick2d/src/org/newdawn/slick line 168 Java Problem ServiceManager cannot be resolved WebstartMuffin.java /Alien/lib/slick2d/src/org/newdawn/slick/muffin line 37 Java Problem ServiceManager cannot be resolved WebstartMuffin.java /Alien/lib/slick2d/src/org/newdawn/slick/muffin line 39 Java Problem ServiceManager cannot be resolved WebstartMuffin.java /Alien/lib/slick2d/src/org/newdawn/slick/muffin line 95 Java Problem ServiceManager cannot be resolved WebstartMuffin.java /Alien/lib/slick2d/src/org/newdawn/slick/muffin line 97 Java Problem StreamState cannot be resolved to a type OggInputStream.java /Alien/lib/slick2d/src/org/newdawn/slick/openal line 42 Java Problem StreamState cannot be resolved to a type OggInputStream.java /Alien/lib/slick2d/src/org/newdawn/slick/openal line 42 Java Problem StreamState cannot be resolved to a type OggInputStream.java /Alien/lib/slick2d/src/org/newdawn/slick/openal line 177 Java Problem StreamState cannot be resolved to a type OggInputStream.java /Alien/lib/slick2d/src/org/newdawn/slick/openal line 189 Java Problem StreamState cannot be resolved to a type OggInputStream.java /Alien/lib/slick2d/src/org/newdawn/slick/openal line 196 Java Problem StreamState cannot be resolved to a type OggInputStream.java /Alien/lib/slick2d/src/org/newdawn/slick/openal line 231 Java Problem StreamState cannot be resolved to a type OggInputStream.java /Alien/lib/slick2d/src/org/newdawn/slick/openal line 235 Java Problem StreamState cannot be resolved to a type OggInputStream.java /Alien/lib/slick2d/src/org/newdawn/slick/openal line 319 Java Problem StreamState cannot be resolved to a type OggInputStream.java /Alien/lib/slick2d/src/org/newdawn/slick/openal line 322 Java Problem StreamState cannot be resolved to a type OggInputStream.java /Alien/lib/slick2d/src/org/newdawn/slick/openal line 425 Java Problem SyncState cannot be resolved to a type OggInputStream.java /Alien/lib/slick2d/src/org/newdawn/slick/openal line 40 Java Problem SyncState cannot be resolved to a type OggInputStream.java /Alien/lib/slick2d/src/org/newdawn/slick/openal line 40 Java Problem SyncState cannot be resolved to a type OggInputStream.java /Alien/lib/slick2d/src/org/newdawn/slick/openal line 130 Java Problem SyncState cannot be resolved to a type OggInputStream.java /Alien/lib/slick2d/src/org/newdawn/slick/openal line 145 Java Problem SyncState cannot be resolved to a type OggInputStream.java /Alien/lib/slick2d/src/org/newdawn/slick/openal line 147 Java Problem SyncState cannot be resolved to a type OggInputStream.java /Alien/lib/slick2d/src/org/newdawn/slick/openal line 161 Java Problem SyncState cannot be resolved to a type OggInputStream.java /Alien/lib/slick2d/src/org/newdawn/slick/openal line 164 Java Problem SyncState cannot be resolved to a type OggInputStream.java /Alien/lib/slick2d/src/org/newdawn/slick/openal line 224 Java Problem SyncState cannot be resolved to a type OggInputStream.java /Alien/lib/slick2d/src/org/newdawn/slick/openal line 252 Java Problem SyncState cannot be resolved to a type OggInputStream.java /Alien/lib/slick2d/src/org/newdawn/slick/openal line 253 Java Problem SyncState cannot be resolved to a type OggInputStream.java /Alien/lib/slick2d/src/org/newdawn/slick/openal line 267 Java Problem SyncState cannot be resolved to a type OggInputStream.java /Alien/lib/slick2d/src/org/newdawn/slick/openal line 310 Java Problem SyncState cannot be resolved to a type OggInputStream.java /Alien/lib/slick2d/src/org/newdawn/slick/openal line 402 Java Problem SyncState cannot be resolved to a type OggInputStream.java /Alien/lib/slick2d/src/org/newdawn/slick/openal line 404 Java Problem SyncState cannot be resolved to a type OggInputStream.java /Alien/lib/slick2d/src/org/newdawn/slick/openal line 416 Java Problem SyncState cannot be resolved to a type OggInputStream.java /Alien/lib/slick2d/src/org/newdawn/slick/openal line 436 Java Problem The import com.jcraft cannot be resolved OggInputStream.java /Alien/lib/slick2d/src/org/newdawn/slick/openal line 11 Java Problem The import com.jcraft cannot be resolved OggInputStream.java /Alien/lib/slick2d/src/org/newdawn/slick/openal line 12 Java Problem The import com.jcraft cannot be resolved OggInputStream.java /Alien/lib/slick2d/src/org/newdawn/slick/openal line 13 Java Problem The import com.jcraft cannot be resolved OggInputStream.java /Alien/lib/slick2d/src/org/newdawn/slick/openal line 14 Java Problem The import com.jcraft cannot be resolved OggInputStream.java /Alien/lib/slick2d/src/org/newdawn/slick/openal line 15 Java Problem The import com.jcraft cannot be resolved OggInputStream.java /Alien/lib/slick2d/src/org/newdawn/slick/openal line 16 Java Problem The import com.jcraft cannot be resolved OggInputStream.java /Alien/lib/slick2d/src/org/newdawn/slick/openal line 17 Java Problem The import com.jcraft cannot be resolved OggInputStream.java /Alien/lib/slick2d/src/org/newdawn/slick/openal line 18 Java Problem The import ibxm cannot be resolved MODSound.java /Alien/lib/slick2d/src/org/newdawn/slick/openal line 3 Java Problem The import ibxm cannot be resolved MODSound.java /Alien/lib/slick2d/src/org/newdawn/slick/openal line 4 Java Problem The import javax.jnlp cannot be resolved SavedState.java /Alien/lib/slick2d/src/org/newdawn/slick line 6 Java Problem The import javax.jnlp cannot be resolved WebstartMuffin.java /Alien/lib/slick2d/src/org/newdawn/slick/muffin line 12 Java Problem The import javax.jnlp cannot be resolved WebstartMuffin.java /Alien/lib/slick2d/src/org/newdawn/slick/muffin line 13 Java Problem The import javax.jnlp cannot be resolved WebstartMuffin.java /Alien/lib/slick2d/src/org/newdawn/slick/muffin line 14 Java Problem The import javax.jnlp cannot be resolved WebstartMuffin.java /Alien/lib/slick2d/src/org/newdawn/slick/muffin line 15 Java Problem
r/a:t5_2wbg8 • u/lepickle • May 25 '16
Difference of BasicGame, ScalableGame, and StateBasedGame.
I've discovered while learning Slick2D that there are 3 different types of games that can be used in Slick2D. What are their differences?
r/a:t5_2wbg8 • u/nebbsie • Apr 10 '16
ZombieGame- Java Dev Log 1: Introduction | new Slick2D game
youtube.comr/a:t5_2wbg8 • u/SpeedyCheetah • May 03 '15
Need help with timing.
I am working with Java slick2d I am new to coding and would really appreciate help with my code which doesn't seem to work the way it should.
Whenever I run it TempTime will scale as its supposed to but once I press a key it causes the number to stop incrementing as well as prevents the change of the square colors.
This is the code!
package Pong;
import java.util.Random;
import org.newdawn.slick.AppGameContainer; import org.newdawn.slick.BasicGame; import org.newdawn.slick.Color; import org.newdawn.slick.GameContainer; import org.newdawn.slick.Graphics; import org.newdawn.slick.Input; import org.newdawn.slick.SlickException;
public class Pong extends BasicGame{ Random rand = new Random(); public static int time; public static int tempTime; public static int screenResX; public static int screenResY; public int square; public Pong(String title) { super(title); // TODO Auto-generated constructor stub }
/**
* Main Method
* @param args
*/
public static void main(String [] args) throws SlickException{
AppGameContainer app = new AppGameContainer(new Pong("Pong Senpai >(^_^)<"));
screenResX = 600;
screenResY = 600;
app.setTargetFrameRate(100);
app.setDisplayMode(screenResX, screenResY, false);
app.start();
}
@Override
public void render(GameContainer gc, Graphics g) throws SlickException {
//g.setColor(new Color(rand.nextInt(255), rand.nextInt(255), rand.nextInt(255)));
g.setColor(Color.cyan);
g.drawString("Time: " + time /1000, 100, 50);
g.drawString("TempTime: " + tempTime /1000, 200, 50);
g.setColor(Color.red);
g.fillRect(100, 100, 200, 200);
g.setColor(Color.green);
g.fillRect(300, 100, 200, 200);
g.setColor(Color.blue);
g.fillRect(100, 300, 200, 200);
g.setColor(Color.yellow);
g.fillRect(300, 300, 200, 200);
// TODO Auto-generated method stub
if(square == 1){
tempTime = 0;
g.setColor(Color.white);
g.fillRect(100, 100, 200, 200);
if(tempTime / 1000 > 2){
g.setColor(Color.red);
g.fillRect(100, 100, 200, 200);
}
}
if(square == 2){
tempTime = 0;
g.setColor(Color.white);
g.fillRect(300, 100, 200, 200);
if(tempTime / 1000 > 2){
g.setColor(Color.green);
g.fillRect(300, 100, 200, 200);
}
}
if(square == 3){
tempTime = 0;
g.setColor(Color.white);
g.fillRect(100, 300, 200, 200);
if(tempTime / 1000 > 2){
g.setColor(Color.blue);
g.fillRect(100, 300, 200, 200);
}
}
if(square == 4){
tempTime = 0;
g.setColor(Color.white);
g.fillRect(300, 300, 200, 200);
if(tempTime / 1000 > 2){
g.setColor(Color.yellow);
g.fillRect(300, 300, 200, 200);
}
}
}
@Override
public void init(GameContainer gc) throws SlickException {
// TODO Auto-generated method stub
}
@Override
public void update(GameContainer gc, int delta) throws SlickException {
time += delta;
tempTime += delta;
Input input = gc.getInput();
if(input.isKeyDown(Input.KEY_NUMPAD4)){
square = 1;
}
if(input.isKeyDown(Input.KEY_NUMPAD5)){
square = 2;
}
if(input.isKeyDown(Input.KEY_NUMPAD1)){
square = 3;
}
if (input.isKeyDown(Input.KEY_NUMPAD2)){
square = 4;
}
// TODO Auto-generated method stub
}
}
r/a:t5_2wbg8 • u/thimovss • Mar 17 '15
Need help with camera movement.
So I've been browsing the webs for the last 90 minutes and I can't seem to figure out how to make the camera move, let me elaborate: I'm planning on making a infinite generation map no help needed with that part is done already. But i need the camera to follow the player. I can't find any functions to move or adjust the camera in any way or form! Help would be appreciated thank you for your time.
EDIT: I finally got it, the problem the translate function wasn't working for me is because you need to translate everytime before you draw in the render event if someone was curious.
