Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (481)
Games in Android Showcase (110)
games submitted by our members
Games in WIP (548)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
   Home   Help   Search   Login   Register   
  Show Posts
Pages: [1]
1  Game Development / Newbie & Debugging Questions / Re: trouble importing bitmap on: 2004-11-03 19:58:00
Yes, that makes sense. Thank you; I'll give that a try.

UPDATE: Another quick question: what type of object do I need to call my paint method using the dot operator?
2  Discussions / Miscellaneous Topics / Re: 2d Java? on: 2004-11-02 21:34:25
Thank you very much, and I'll remember that.
3  Game Development / Newbie & Debugging Questions / Re: trouble importing bitmap on: 2004-11-02 21:33:24
sure:


package central;

import javax.swing.JFrame;
import javax.imageio.ImageIO;

import java.awt.Graphics;
import java.awt.image.BufferedImage;
import java.net.URL;



public class Master
{
     public static final int WIDTH = 1024;
     public static final int HEIGHT = 768;
     
     public Master()
     {
           JFrame DC = new JFrame ("Destiny Crystal");
           DC.setBounds(0,0, WIDTH, HEIGHT);
           DC.setVisible(true);
     }
     
     
   public BufferedImage loadImage(String name)
   {

       URL url = null;
       
       try
           {
             url = getClass().getClassLoader().getResource(name);
             return ImageIO.read(url);
       }
       
       catch (Exception e)
           {
             System.out.println("Cannot load image " + name +" from "+url);
             System.out.println("The error was : "+e.getClass().getName()+" "+e.getMessage());
             System.exit(0);
             return null;
         }
       }

     public void paint(Graphics g)
     {
           BufferedImage oil = loadImage("oil.bmp");
           
           g.drawImage(oil, 800, 600, this);
     }
     
     public static void main(String[] args)
     {
           Master DC = new Master();
     }
}
4  Discussions / Miscellaneous Topics / 2d Java? on: 2004-11-02 20:35:22
Why, oh why has no one posted in the 2D JAVA board lately! I really need help, but there aren't any new posts in that board....  :-/
5  Game Development / Newbie & Debugging Questions / trouble importing bitmap on: 2004-11-02 19:08:56
Alright, I'm trying to import a bitmap to display using JFrame. Here's my paint method:

public void paint(Graphics g) {
     BufferedImage oil = loadImage("oil.bmp");
           
           g.drawImage(oil, 800, 600, this);
     }

My compiler is telling me that the draw Image method can't take in a BufferedImage...am I doing something wrong?


Oh, yeah, and here's what I'm importing:

import javax.swing.JFrame;
import javax.imageio.ImageIO;

import java.awt.Graphics;
import java.awt.image.BufferedImage;
import java.net.URL;
6  Game Development / Newbie & Debugging Questions / Re: a JAVA RPG? on: 2004-11-02 16:48:05
I do know a bit of JAVA, but I'm still learning.

I do know how to create a main  :-/ I just thought there may be a different decleration to make it an application, like an exe.
7  Game Development / Newbie & Debugging Questions / Re: a JAVA RPG? on: 2004-11-02 16:34:05
I'd perfer it to run as an application: do you know where I can find a tutorial on that, or how would I do it?
8  Java Game APIs & Engines / Java Sound & OpenAL / Re: file format options for applets on: 2004-11-02 16:16:49
How do you actaully import, play, etc. music in JAVA?
9  Game Development / Newbie & Debugging Questions / a JAVA RPG? on: 2004-11-02 16:13:56
Hello, though I am new to creating games with JAVA, I'm not new to game creation or Java.  Tongue

My goal is to create a 2D RPG using JAVA. I'm not exactly sure how to go about it, so far I've just been working on my class hierarchies.

I've got a few questions:

-Can you/ how can you save data in such a game?

-Should I use an applet to run this?

-how do I begin to go about setting up 2d graphics?


I have a bit of experience with 2D graphics using C++; I've just never done it in JAVA.
Pages: [1]
 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

atombrot (26 views)
2014-08-19 09:29:53

Tekkerue (24 views)
2014-08-16 06:45:27

Tekkerue (23 views)
2014-08-16 06:22:17

Tekkerue (14 views)
2014-08-16 06:20:21

Tekkerue (20 views)
2014-08-16 06:12:11

Rayexar (59 views)
2014-08-11 02:49:23

BurntPizza (38 views)
2014-08-09 21:09:32

BurntPizza (30 views)
2014-08-08 02:01:56

Norakomi (37 views)
2014-08-06 19:49:38

BurntPizza (67 views)
2014-08-03 02:57:17
List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!