Results 1 to 4 of 4
  1. #1
    augustas656 is offline Senior Member
    Join Date
    Apr 2014
    Location
    United Kingdom
    Posts
    103
    Rep Power
    0

    Question Java 2.5D Game, Don't Understand Some Things

    Hello There,

    This is my very first post on these forums, I enjoy minecraft and therefore I also use minecraftforums to talk about java, but I usually go to the off-topic section which most people there don't know about java. So I thought, why not join a very nice, java-programming based forum. Okay, I've learnt java from my bring-back, I watched up to half the unit 1 tutorials because after that it was no longer coding but more of java utils and stuff like JFrame.

    Note: I use eclipse for my programming.

    So, I want to make a Java 2.5D game, it's technically two dimensional but you can do things like allow the character to jump you can see shadows, and different layers, a 2D based game, simulating three dimensions. Now, my goal is to make my own java 2D game engine, where I use the LEAST of any java utils, awt or any libraries as such. I want to make everything from scratch to the highest extent possible.

    I would like some help and maybe others help me understand a few things, okay. Is it possible for me to re-create my own version of the code in JFrame / Canvas. As I said I want to build everything from scratch to the highest extend, and is it possible by using JUST java coding, for me to create an engine that doesn't use JFrame or Canvas, instead has it's own code for creating a window?

    The game I'd like to make would be downloadable, where you either install it, or just run a .jar or .exe file, and it literally plays everything I designed it to do. Is it possible to re-create my own version of JFrame / JPanel, where it shows a window by just using java?

    Thank You
    Augustas

  2. #2
    pj6444 is offline Senior Member
    Join Date
    Jan 2013
    Posts
    164
    Rep Power
    2

    Default Re: Java 2.5D Game, Don't Understand Some Things

    You could try and create your own window and graphics system, but for someone who is a beginner, I would recommend just using the JFrame and Canvas already built into Java. There is no point in spending all the extra time to make your own JFrame when you could use what is already built for you.

  3. #3
    augustas656 is offline Senior Member
    Join Date
    Apr 2014
    Location
    United Kingdom
    Posts
    103
    Rep Power
    0

    Default Re: Java 2.5D Game, Don't Understand Some Things

    Well, I want to make my own because I want to understand everything and not have to learn new built-in features of swings and awts such as JFrame. Okay, so I have tried making a JFrame and a JPanel, and draw a single pixel using a method I made inside a Display class which is used to initiate most things.

    I believe I will have MANY faults in this, but this way I understand it, you can help me tidy it up if you can and show me where I'm wrong, thanks:
    My Main Class (Game): [Java] package pack.script.game; public class Game { public static final Str - Pastebin.com
    My Display Class (Display): [Java] package pack.script.game; import java.awt.Color; import java.awt.Graphics; - Pastebin.com
    My Panel Class (Panel): [Java] package pack.script.game; import java.awt.Color; import java.awt.Graphics; - Pastebin.com

  4. #4
    pj6444 is offline Senior Member
    Join Date
    Jan 2013
    Posts
    164
    Rep Power
    2

    Default Re: Java 2.5D Game, Don't Understand Some Things

    That actually looks ok. I would use the paintComponent(Graphics g) method, not the paint() method. But instead of drawing on the actual JFrame itself, you should draw onto the JPanel.

Similar Threads

  1. Why does Java process things very long?
    By Tawi in forum New To Java
    Replies: 52
    Last Post: 02-20-2014, 07:44 PM
  2. Replies: 8
    Last Post: 02-20-2014, 01:30 PM
  3. Replies: 1
    Last Post: 07-14-2012, 10:57 AM
  4. Replies: 6
    Last Post: 03-23-2011, 06:53 PM
  5. May someone explain what these things means in Java
    By quickfingers in forum New To Java
    Replies: 2
    Last Post: 01-26-2008, 05:45 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •