Java-Gaming.org    
Featured games (79)
games approved by the League of Dukes
Games in Showcase (475)
Games in Android Showcase (106)
games submitted by our members
Games in WIP (530)
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: What is a Sample? (Samplemodel - BufferedImage) on: 2013-07-10 10:41:53
Well, while not exactly what I asked for, this certainly does seem interesting. I'll be watching his videos a bit to see what I can learn.

Thanks!
2  Game Development / Newbie & Debugging Questions / What is a Sample? (Samplemodel - BufferedImage) on: 2013-07-01 19:03:14
So, I'm trying to create some kind of pixel-perfect collision for a 2D game (as I can't think of any other good way of creating exact or close to exact hitboxes for hand-drawn sprites).

To this I do of course need to learn a bit about how images work, where and how the data is stored etc. I've been trying to read and learn about this in the java docs, reading up on the BufferedImage and SampleModel to name a few. I've also been looking through tutorials and guides I've found. While everything is somewhat confusing, lots of things, atleast when it comes to the SampleModel, seems to revolve around "samples" that contain information about pixels in the picture.

However, I do not know at all how these samples work or how I can use them. Google is not being very helpful due to "sample" apparently being a very commonly used term. Therefore, could someone explain to me what these "samples" are, or link me to some good site on the matter? =)
3  Game Development / Newbie & Debugging Questions / How to internally save objects properly (this subject might be misdirecting) on: 2013-05-16 18:36:09
Hello!

I'm pretty much just starting out with java, but I've learnt most basics by now. I think.

Anyways, I've just started out on a somewhat simple RPG-style game in which the player is supposed to be able to do  rpg-generic things like moving and fighting. Now, I've drafted some kind of basic layout for the program. One part handles drawing and one handles the actual game data. In the part that is supposed to handle the object-object interaction I've run into somewhat of a problem, and it's this problem that forms my slightly confused question:

How do I create objects and save them to be able to paint them later on while still retaining full control of specific objects?

To clarify what I mean, my last project involved a ball and a few lines. I essentially 'saved' internally them like this:
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
private Ball ball;
private MyLine[] line = new line[10]

public ConstructorOfThisClass(){

ball = new Ball(position, size)
line[0] = new MyLine(x1, y1, x2, y2)
line[1] = new MyLine(x1, y1, x2, y2)
line[2] = ...
}


To draw this I just had to call the ball's draw method as well as the draw method of line[ i ] in a loop cycling through all lines for every frame.

In this rpg, there must be more than 2 kinds of things. For example I may want a few trees, the player, a house, a couple of stones and an enemy. All of these things can of course subclass some kind of overall WorldObject class and then get their unique properties in their own class files. But how is it advised that I handle them? I kinda feel that manually (or in a loop with random values) creating a whole lot of tree instances and saving them to a list somewhere is not such a good solution. Perhaps some kind of grid?

I feel that I want to be able to refer to any one object at any time as well as being able to handle them all at once, mostly for drawing them.

So, yeah, anyone got any tips or any guides it might be worthwhile for me to look at? If you want me to clarify something, please tell, as it is obvious that I might not have made my point quite clear.

Cheers!
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.

pw (11 views)
2014-07-24 01:59:36

Riven (9 views)
2014-07-23 21:16:32

Riven (11 views)
2014-07-23 21:07:15

Riven (12 views)
2014-07-23 20:56:16

ctomni231 (42 views)
2014-07-18 06:55:21

Zero Volt (38 views)
2014-07-17 23:47:54

danieldean (32 views)
2014-07-17 23:41:23

MustardPeter (34 views)
2014-07-16 23:30:00

Cero (49 views)
2014-07-16 00:42:17

Riven (50 views)
2014-07-14 18:02:53
HotSpot Options
by dleskov
2014-07-08 03:59:08

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:58:24

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:47:22

How do I start Java Game Development?
by ra4king
2014-05-17 11:13:37

HotSpot Options
by Roquen
2014-05-15 09:59:54

HotSpot Options
by Roquen
2014-05-06 15:03:10

Escape Analysis
by Roquen
2014-04-29 22:16:43

Experimental Toys
by Roquen
2014-04-28 13:24:22
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!