[Frogger2D] *closed*

Hello JGO, wanted to start out this topic by saying thanks to all the members for helping me accumulate knowledge of Java Programming during my time here.

This is something I thought of today, so it’s not really 100% planned or thought through yet, I just figured it would be easy :D.

Updates Done:
Sound Clips + AudioClass added.
Basic Map setup rendering (No cars/logs/pads).
Added a (Stream, Log, Frog) to the main menu, can hop around on the log while it floats).
Sounds for movement/death added.
Full Screen available.
Sounds added: (Hopping, dying/loosing a life, falling in the water, time running out, extra life, coin sounds)
Toggle sound.
Level time / Lives rendered.
Game Over screen.
1 car added + movement, and collision detection etc.

Bugs:
When changing sprites during movement, on keyPressed = jumping Image, and on keyReleased = normal Image, (So the problem here is you can just hold down right (or any direction), and just jump that whole distance while still on the jumping Image) so I need some info there, might of explained it poorly if i did ill post some code :emo:.

Things Needed from the community / Questions:
Question: Is Frogger a ‘Tile Based Game’ as in a tile grid system?
Question: Has there been a Frogger remake in Java? (Thinking so…)
Question: What is the time limit/How does the timer work in Frogger?
Question: How can I disable the ‘mouseDragged’ method in Java? tried a simple ‘return;’ :-\ It freezes the whole game: (http://www.java-gaming.org/topics/frogger2d/26157/msg/228167/view.html#msg228167)

Pictures:
Main Menu: (Updated with a temp frog to play with on the log)

Map Update: (A little more added)

Any suggestions would be great, or feedback of any sort (Improvements / fixes).

Good luck with it, I hope to see more soon :smiley:

Question: Is Frogger a ‘Tile Based Game’ as in a tile grid system?

That´s a way to do it, but not the only one. Try to keep it simple, if you can make it title-like, go for it. Later, why not make it again with other libraries, like “myFrogGame 2” and then “myFrogGame 3” and trying different ways of making it :slight_smile:

Thanks.
Well it’s definitively going to take some thought towards the game mechanics, such as variables moving and interacting to bring it together.

I wouldn’t call Frogger “tile based”, no. The only coarse movement is vertical, and it still detects collisions while transitioning between levels.

Go download MAME and play frogger yourself and you’ll see exactly how the various mechanics work.

If you google “java frogger” this is the first thing that comes up: http://www.reinhardtfamily.com/Paul/Frogger/

I think a game like Frogger is a great game to start out with.

An easy way to implement the game timer is with a Thread. You can have it sleep for, say, 1000 ms (1 second) and decrement a counter variable until it hits 0.

To disable the mouseDragged method, just leave its body blank.

For your game mechanics, I’d make some sort of collection (probably an ArrayList) of cars and logs, give each car/log their own direction variable (Enumerations are great for this) and speed. For collision detection, the game is simple enough that you can have all obstacles check to see if they hit the frog every time they move. I hope this helps.

All i did was let my Input class implement all the MouseListening/KeyListening classes, than added all the methods.
Still even with a blank body in the mouseDragged method, if you click the mouse and drag it, it freezes the game, doesn’t render the actual mouse ‘X, Y’ coords anymore, but it still renders the FPS, map, etc.?


	@Override
	public void mouseDragged(MouseEvent m) {
		if (canDrag) {
			// method to repaint.
			game.GameProcess(2);
		} else {
			return;
		}
	}

You’d be better off only using keyboard input to control the game. A mouse would be hard to use to control a frog. If you remove the mouse listener and stick with only the key listener, this will go away. I don’t know much about the mouseDragged method; I’ve never used it. If you really want to use the mouse, I think the LWJGL might have the capability you’re looking for.

Thanks mate, meaning to update the picture of the main menu.
Now it’s using buttons instead of waiting for keyboard input to start the game.

(I hope I’m not talking utter bullshit since I’m quite new to Java myself… can’t blame me for trying :p)

If you are getting the X,Y - coordinates of the Mouse in your mouseMoved() Method you could simply call it in your mouseDragged() Method like so…


	@Override
	public void mouseDragged(MouseEvent m) {
		if (canDrag) {
			// method to repaint.
			game.GameProcess(2);
		} else {
			mouseMoved(m);
		}
	}

… and it will act like you just moved your Mouse. Hope that helps. :slight_smile:

Thanks mate, will give it a try soon.