Problems with WallTile in JAVA - java

I'm trying to create a Game Engine in java, as a way of learning in a course I'm attending, and now I'm learning how to program collisions between the player and a wall. But there's one problem I haven't seen anyone having, that basically my character runs into a wall and he just stops responding. And the way I say it, it's not like the program stopped responding, it's more like leaning against a wall the controls stop working, because even though everything seems to be stopped, the FPS keeps counting.
Here are screenshots of the parts I think are most important to show for this specific issue:
enter image description here
enter image description here
Here's the file and codes on github for a deeper look:
https://github.com/TheAwesomeCake/Game-Engine.git

Related

Confusion on how to finish a new program?

I am currently doing a project for my java class and im a total beginner so apologies because i'm sure the answer is quite obvious. A few weeks back I made a program called TravelExpenses which calculated how much a trip would cost. Now, I must make a new program that is completely different. After coding and pressing play, The same window pops up from my previous program, how do I get rid of it? Photo
In the package explorer, right click your new class and choose run as.. java program
The next time you press play it will launch the recent one.

How do I add a timer to a Jframe based Memory game in Netbeans?

I'm making a Memory-like game in Java using Netbeans.
I'm using Jframes for this.
I'm wondering how I would go about making a timer? It would start at 00:00 and count up seconds and minutes until all the couples have been found.
I'm still relatively new at Java. All the images in my game are made or edited by me. I don't own the character depicted and I'm not looking to sell it or something. It's just a fun little side project to learn Java a bit better.
I know my program is missing other features, but for now I'm only looking for help far this particular part of my game.
My game so far looks like this:
http://puu.sh/gkBlp/899525b31e.png
http://puu.sh/gkBA7/a1e75a5682.jpg

Slick2D game launches then immediately closes

I've been working with Slick2D and Kryonet to create a pretty basic multi-player RPG. While the server portion and database have been literally just plug and play it seems I'm having trouble with the graphics. Essentially when launch the client I connect to the server just fine, upon a successful connection the actual Game launches. There is no error in particular but it launches to a black screen very briefly before terminating the client.
I was having trouble getting the code to format properly so below is a link to pastebin that contains the code. There are no errors thrown or anything along those lines so I'm not 100% sure what to look for.
Link to source
Error with my TiledMap file. Needed to edit the image sources for the tile sets.
Thanks to JNYRanger for suggesting debugging, took a couple tries but was eventually able to catch what was going on.

Java applet sound in HTML

Just a quick question about a program I've been working on. I've made an applet that has several sounds that play depending on the users input that all work fine when I run it through Eclipse. The problem is when I have the code embedded into the HTML, one of the sounds that should run for about 2secs when user completes the game, instead cuts out almost immediately.
What might be causing this?

Java Robot key activity seems to stop working while certain software is running

I'm writing a Java application to automate character actions in an online game overnight (specifically, it catches fish in Final Fantasy XI). The app makes heavy use of java's Robot class both for emulating user keyboard input and for detecting color changes on certain parts of the screen. It also uses multithreading and a swing GUI.
The application seems to work perfectly when I test it without the game running, just using screenshots to trigger the apps responses into notepad. But for some reason, when I actually launch FFXI and start the program, all of my keyboard and mouse manipulations just stop working altogether. The program is still running, and the Robot class is still able to read pixel colors. But Robot.keyPress, Robot.keyRelease, Robot.mouseMove, Robot.mousePress and Robot.mouseRelease all do nothing. It's the strangest thing-- to test it, I wrote a simple loop that just keeps typing letters, and focused notepad. I'd then start the game, refocus notepad, and it would do nothing. Then I'd exit the game, and it'd start working again immediately.
Has anyone else come across something like this, where specific software will stop certain functions of java from working?
Also, to make this more interesting-- Last year I wrote a very similar program using the same classes and programming techniques to automate healing a party in the game as they fight. Last year, this program worked perfectly. After running into these problems I dug up that old program, ran it without making any changes, and found that it too was having the same problems. The only differences between now and when it was working: I was running Windows Vista and now I'm running Windows 7, and several new Java versions as well as FFXI versions have been released.
What the hell is going on? (if anyone needs to see my source code, email me at mikejturley#gmail.com. I'm trying to keep it to myself.)
FFXI has code to prevent cheating. Quite effectively, it would seem.
If possible, try it in WinXP. I myself have also written a bot for an online game that uses much of the same concepts (i.e. using Java Robot to read pixel colors and simulate key-presses and mouse-clicks).
Under WinXP:
Bot works as intended in all cases.
Under Win7:
Outside of the game, bot works as intended. Ingame, simulated input failed (pixel reads were okay, I think).

Categories

Resources