Java-Gaming.org Hi !
Featured games (81)
games approved by the League of Dukes
Games in Showcase (513)
Games in Android Showcase (119)
games submitted by our members
Games in WIP (576)
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  Discussions / Miscellaneous Topics / Re: Toys from your childhood..... on: 2005-04-17 06:38:14
my main memories from been a kid was my bike as we used to end up all over the place on it!
also a fav 'toy' was fishtanks, as my mates and me used to be well into collecting things like frogsspawn, newts etc  Roll Eyes
One toy i REALLY wanted was when i was about 8 and in the local toy shop they had a radio controlled R2D2 and I pestered my mum to get meit for xmas for AGES but never got one  Cry

my uncle had the dark tower game and we loved playing it!
just found this on the net so thought id pop it on for you dark tower fans (not played it YET so not sure how good it is)

http://www.aanimation.com/Dark_Tower/
2  Java Game APIs & Engines / Java Sound & OpenAL / Re: Java MOD/XM Playback on: 2005-04-08 16:11:25
as you know, im using micromod in my (still very early) game, and as a test I stuck it in the actual game loop to test if it made any noticable diff to the speed, and with 640x480 parallax scrolling (32x32 tiles 2 layers, 1 opaque and the foreground bitmasked) with a 96x64 player sprite, upto about 8 or so bullets and had 10 84x124 (i think!  :-/) 'enemy' dudes wandering about (not that there will be THAT many enemies on screen at once at that size in the actual game!) it still ran lovely! even got a few sound effects playing over the top when the lil fella walks and fires etc!

(MicroMod V 0.98kX is the one im using)

so even micromod gets the BIG Thumbs up from me! well chuffed with it!
3  Game Development / Newbie & Debugging Questions / Re: Need Notepad Alternative on: 2005-04-06 18:42:17
definately recommend Gel, its totally free and a nice simple IDE, dosnt seem overloaded like some can!
4  Java Game APIs & Engines / Java 2D / Re: super mario hill-problem.. on: 2005-04-06 18:38:00
another thing would be which direction your travelling as to know if to slow you down (going uphill) or speed you up (going down hill)

a way i was thinking of doing it myself (as im just using a simple map array and checking on values of the tiles to tell me what they are (ie first 100 tiles for EG are background, 100-15 say are walkable/wall types etc etc)

what I was planning on doing for some diagonals was to say have a couple for the each slope direction, then when we read the tile value for our collision, is to see if its a slope, then depending on the direction were moving, is to either erduce or increase the players speed and then move him accordingly in the appropriate diagonal direction. (hope you understood all that as I sometimes find it hard to describe what it is im getting at!  :-/)

edit: just realised its basically what was just said above  Embarrassed Roll Eyes

5  Java Game APIs & Engines / Java 2D / Re: bufferstrategy or opengl? on: 2005-04-06 08:45:48
you should get some pretty good speed with Java2D as im cuurently writing a game and have got 640x480 fullscreen parallax scrolling built from 32x32 tiles with a main player sprite of 96x64 and as a test stuck on 50 84x124 animated sprites too and all running at a smooth 75fps (oh and with a mod playing with Martin Camerons micromod player)

even on our laptop it runs great at 60fps (fps locked to the refresh rate) and thats got a crusty on board gfx card so we occasionally get a bit of slowdown bit in general it runs nice on that too (1.1 gig celeron)
6  Game Development / Newbie & Debugging Questions / Re: Shall I move the world or the character? on: 2005-04-04 06:53:09
Also it depends on how you build your worlds, as if you never reach the exact edges of the map, then just moving the 'camera' is best definately.
Im currently writing a side scrolling platform game and with been able to goto the very edges, I had to write it so the lil guy dosnt move when hes not by the edge etc, but when the map limits are reached, change to move the actual character and not the bg. Took me a good few days tweeking it to get it all working nicely as I had it working lovely, then I added a slide to the characters movement and that kinda threw things off a bit!   Huh but its now working lovely.
I could have just padded out the map so we never got right to the edge, but then you'd end up with a load of wall tiles etc half filling the screen etc.

7  Games Center / Archived Projects / Re: AnacondaNet (pre-alpha test) on: 2005-03-25 16:41:06
wouldnt it be better to build your background out of small tiles to create a tile map?
as you could create as big a map as you liked then and the image file for the tiles would be a LOT smaller than a huge bitmap, and even the map data would be a fraction of the size too!

just a thought.

Even if you created 3 or even 4 512x512 tilemaps to give you lots of variations etc in the tiles, it would be simple to grab the relevant tile from whichever map its on etc.

HTH's
8  Java Game APIs & Engines / Java Sound & OpenAL / Re: Java MOD/XM Playback on: 2005-03-25 16:10:16
Thanks Martin, just about to download the jar file!

Fingers crossed the game will get finished (first EVER game on the PC so its a REALLY slow process hehehe)
so you'll be able to see your name in lights (well, lots of phosphor dots anyway! hehehe) with the mod player credit!  Grin

PS. Just downloaded it! nice music! hehe.. takes me back to the mid 70's when i was a teeny tiny kid! haha..

PPS! works great! thanks m8! much appreciated!
9  Java Game APIs & Engines / Java Sound & OpenAL / Re: Java MOD/XM Playback on: 2005-03-25 08:56:07
Got the classloader getting the file path etc, but just cant fathom out how to then pass the info to the:
1  
module = ModuleLoader.read(new RandomAccessFile(modFile, "r"));


as it keeps throwing an error no matter how i try to pass the url to it (even converting to a String it lets it compile, but then get a NullPointerException  :-/)
10  Java Game APIs & Engines / Java Sound & OpenAL / Re: Java MOD/XM Playback on: 2005-03-24 20:22:18
Look forward to a new version!
ive currently got your micromod libraries working in some *VERY* early game code and the mods play great......until I try to put everything into a jar file and then my code just dies as with a previous members post, couldnt fathom out how to get the mod file loaded from within the jar file etc.!
Searched for more info on the RandomAccessFile to see if I could get it working but no luck (still a newbie so some of the docs may as well be written in Swahili  Cheesy)

PS. great to be able to hear some classic Amiga mods again!
11  Discussions / General Discussions / Re: BEST GAME EVER on: 2005-03-20 06:36:50
ahhh the 'good ole days'  Grin Its weird how most games now dont hold my interest as long as they used to (even typing this shows my age as with every key press its my fingers making clicking noises and not the keys!  :-/ hehe)

I remember playing WC 1 on a really crusty pc and actually its probably one of the ONLY games I played all the way through!.

I love looking at the old C64 games as that was the machine of my day (well school days!)  and recently been looking at loads of the old games to give me insiration for a game in Java (nothing like a good old game to help learn a new language! hehe)
I thought about converting one (or more) of my uncles C64 games he wrote which may still happen if I cant find any of my old favs! ( I did convert his first ever C64 game to the atari ST many years ago! (moon crystals btw)

Best game hmmm.... not a great fan of the 3d games of today! Prefer the good old 2D platform games or shoot em ups!
12  Games Center / Archived Projects / Re:  my 2d engine first public test (java 5.0 on: 2005-03-18 09:15:20
AMd 2200+ 512meg ram geforce 4 mx runs lovely!
13  Game Development / Newbie & Debugging Questions / Re: Problems using ImageIO on: 2005-03-16 19:18:30
Just reading this and its got me wondering,

im just sorting out a scroll bg that uses tiles (32x32) and with seeing this about cutting the tiles into thier own buffers, does that mean that by creating individual buffers for each tile, they blit faster than how I currently do it via:

calculate the tile position in the tile image, then in my g.drawImage i set the destinations x,y width height and also the source width height etc etc.

and that then gets blitted onto the backbuffer screen.

heres the code :
(tilex & tiley are the offsets into the image containing the tiles)
(twidth & theight are the tile sizes (32x32 in this instance)

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
      int tilex = map[world_X_offset+tx][ty+world_Y_offset]%20;
      int tiley = map[world_X_offset+tx][ty+world_Y_offset]/20;

        int dx = tx*twidth-(int)scroll_X_offset;
        int dy = ty*theight-(int)scroll_Y_offset;
        int dw = tx*twidth+32-(int)scroll_X_offset;
        int dh = ty*theight+32-(int)scroll_Y_offset;
        int sx =tilex*32;
        int sy = tiley*32;
        int sw = sx+32;
        int sh = sy+32;
        g.drawImage(title,dx,dy,dw,dh,sx,sy,sw,sh,null);


it is a long winded way to do it, so was wondering how to streamline it, and it looks like the cut tiles into individual buffers sounds like a good plan. just thought id ask about the difference and what ppl thought.

TIA
14  Java Game APIs & Engines / Java 2D / Re: Fullscreen Slowness on: 2005-03-01 10:30:42
hehehe just been and he gave me a good slapping and told me not to do it again!  Grin
have since changed the naming and looks a lot neater now  Embarrassed but still not sorted out the fullscreen/vsync prob though!

15  Java Game APIs & Engines / Java 2D / Re: Fullscreen Slowness on: 2005-02-28 20:41:07
just to add to this thread, im just playing with a scroll etc in fullscreen, yet if I replace the gagetimer with a Thread.yield(); its showing as over 100fps even when im 'supposed' to be in 640x480 fullscreen mode.
using the gagetimer, im capping the redrawing at 60fps (also have set the display mode to 60Hz too as to remove any jitters etc)

I thought that when you go into fullscreen mode, it automatically locks the refresh to the vsync? also ive noticed im getting the raster scan slowly going up the screen which also leads me to believe that its not locked to the vsync as if it was, then the screen would be redrawn when the raster scanline is off the bottom of the screen.

does it make a difference if you start in a window mode first? as i tried to make it call my swap screen routine once it set the window up etc, but still get the same results.

here is my fullscreen swapper routine just in case im missing something obvious! (quite possible with me! hehe)
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
protected void swap_view()
{
      if(FULL_SCREEN==0)
      {
            if ( DEVICE.isFullScreenSupported() )
            {
                  DEVICE.setFullScreenWindow(this);
                  if (DEVICE.isDisplayChangeSupported())
                    {
                    
                        DEVICE.setDisplayMode(new DisplayMode( WIDTH, HEIGHT,BPP,Hz));
                 }
            }
            keys[KeyEvent.VK_F1&0xff] =0;
            FULL_SCREEN=1;
      }
      else
      {
            Thread.yield();
            DEVICE.setFullScreenWindow(null);
            setVisible(true);
            toFront();
            FULL_SCREEN=0;
      }
}


when in fullscreen, it is in 640x480 as the cursor is bigger than it is in my normal desktop (1280x1024) so I know its not just stretching the window and filling my desktop with a window.
16  Game Development / Newbie & Debugging Questions / Re: OutOfMemoryError on: 2005-02-27 06:44:28
hehe I WAS wondering why whenever I ran the code my machine sounded like it was crying!  Grin

as you can probably tell from my code, im more used to been sat in front of photoshop and 3ds max rather than writing code! but I thought id expand and learn Java to get a break from the gfx stuff for a bit.

been scanning through this forum and reading up a fair bit and it is gradualyl sinking in (honest!  Wink)

17  Game Development / Newbie & Debugging Questions / Re: OutOfMemoryError on: 2005-02-26 20:12:45
doh! scuse me while I wipe the egg from my face!  Embarrassed   Grin

as I said, im a total newbie to Java, and still trying to get my head round all this stuff! so total cockups are pretty common here at the mo! hehe...

the reason i had the extends fscreen in the stars.java file was I was trying to be lazy and not having to pass over some of the 'global' variables (ie the WIDTH & HEIGHT)

I see what you was getting at with the constant calling one, then the other calling the first again etc in a never ending loop!

Will go and have a read up a bit more on the constructors etc as with having so many things to look at, its hard to work out what you NEED to look at FIRST!

thanks for the help guys! much appreciated!







18  Game Development / Newbie & Debugging Questions / Re: OutOfMemoryError on: 2005-02-26 18:45:28
Thanks.

i checked the code, but even if I remove the calls to the class ive built it still does it.
It seems to be the mystars = new stars(); that is the prob for some strange reason!  Huh

here's all the code so far (basically not a lot as just using it to get to grips with working in Java etc!)

The main file (fscreen.java):
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
27  
28  
29  
30  
31  
32  
33  
34  
35  
36  
37  
38  
39  
40  
41  
42  
43  
44  
45  
46  
47  
48  
49  
50  
51  
52  
53  
54  
55  
56  
57  
58  
59  
60  
61  
62  
63  
64  
65  
66  
67  
68  
69  
70  
71  
72  
73  
74  
75  
76  
77  
78  
79  
80  
81  
82  
83  
84  
85  
86  
87  
88  
89  
90  
91  
92  
93  
94  
95  
96  
97  
98  
99  
100  
101  
102  
103  
104  
105  
106  
107  
108  
109  
110  
111  
112  
113  
import javax.swing.*;
import javax.imageio.*;
import java.awt.*;
import java.awt.event.*;
import java.awt.image.*;
import java.io.*;
import java.util.*;

public class fscreen extends JFrame implements KeyListener
{

public static final int WIDTH = 800, HEIGHT = 600;
protected static final GraphicsDevice DEVICE = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice();
protected static final GraphicsConfiguration CONFIG = DEVICE.getDefaultConfiguration();
protected static final DisplayMode DISPLAY = DEVICE.getDisplayMode();

private int       keys[];

BufferStrategy      bstrat;
Canvas                  cs;
stars                   mystars;

    public fscreen()
    {
            super("Stars test",CONFIG);
            setSize(new Dimension(WIDTH,HEIGHT));
            setDefaultCloseOperation(EXIT_ON_CLOSE);
        setUndecorated(true);
            setIgnoreRepaint(true);

            cs = new Canvas(CONFIG);
            cs.addKeyListener(this);
            cs.setSize(WIDTH,HEIGHT);
            getContentPane().add(cs,BorderLayout.CENTER);
            pack();
            show();

            keys = new int[256];

        cs.createBufferStrategy(2);
        bstrat = cs.getBufferStrategy();

// This seems to be the problem line! as both other refernces to init and draw the stars are commented out yet this causes the error !

//-----------------------------------------

            mystars = new stars();

//-----------------------------------------

           //Commented out to show that the error occurs in the above line
            //mystars.init();

        loop();
    }

protected void loop()
{

      while(true)
      {
            if(keyDown(KeyEvent.VK_ESCAPE))
            {
                  System.exit(0);
            }

          Graphics2D g = (Graphics2D) bstrat.getDrawGraphics();

          g.setColor(Color.black);
          g.fillRect(0,0,WIDTH,HEIGHT);
            // Star update
            //mystars.update_stars(g);
            g.setColor(Color.red);
            g.drawString("hello",10,10);
            g.dispose();
            bstrat.show();
          
      }
}



// Main

    public static void main(String[] args)
    {
        fscreen fscreen = new fscreen();
    }


// Key routines

protected boolean keyDown(int key)
{
      return (keys[key&0xff] != 0);
}

public void keyPressed(KeyEvent e)
{
      keys[e.getKeyCode()&0xff] = 1;
}

public void keyReleased(KeyEvent e)
{
      keys[e.getKeyCode()&0xff] = 0;
}

public void keyTyped(KeyEvent e)
{
}


}


and the stars.java file:
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
27  
28  
29  
30  
31  
32  
33  
34  
35  
36  
37  
38  
39  
40  
41  
42  
43  
44  
45  
46  
47  
48  
49  
50  
51  
52  
53  
54  
55  
56  
57  
58  
59  
60  
61  
62  
63  
64  
65  
66  
67  
68  
69  
70  
import java.util.Random;

import java.awt.*;

public class stars extends fscreen
{

// Create random numbers
      private Random lpd_rnd=new Random();

// Number of stars
      protected static final int num_stars = 200;

// Arrays for the star positions

      private int[] sx;
      private int[] sy;
      private int[] sz;

// Speed of the starsystem
      private double   SPEED = 2;

// Initialise the stars.
public  void init()
{

// Create the star coord arrays
      sx = new int[num_stars];
      sy = new int[num_stars];
      sz = new int[num_stars];

// Fill the arrays with random positions
      for(int i=0; i<num_stars-1; i++)
       {
          sx[i] = (lpd_rnd.nextInt(WIDTH)+1) - WIDTH/2;
          sy[i] = (lpd_rnd.nextInt(HEIGHT)+1) - HEIGHT/2;
          sz[i] = lpd_rnd.nextInt(256)+1;
       }

}

// Move and draw the stars
public void update_stars(Graphics mg)
{

//Temp store for current star
      int tmpx,tmpy;

      for(int i=0; i<num_stars-1; i++)
      {
               tmpx = ((sx[i]*256)/sz[i]) + WIDTH/2;
               tmpy = ((sy[i]*256)/sz[i]) + HEIGHT/2;
               if(tmpx >=0 || tmpx <=WIDTH || tmpy >=0 || tmpy <=HEIGHT)
               {
                int tsize = (256/sz[i]);
                   mg.setColor(Color.white);
                   mg.fillOval(tmpx,tmpy,tsize,tsize);
                   sz[i]-=SPEED;
               }
   // If the star is past our 'camera' then reset the star
               if(sz[i] <= 0)
               {
                 sx[i] = (lpd_rnd.nextInt(WIDTH)+1) - WIDTH/2;
                 sy[i] = (lpd_rnd.nextInt(HEIGHT)+1) - HEIGHT/2;
                 sz[i] = 256;
               }

       }
}
}


hope someone can help as its really puzzling me! (probably something REALLY simple but I jsut cant see it! hehe)
19  Game Development / Newbie & Debugging Questions / OutOfMemoryError on: 2005-02-26 17:11:14
Hi everyone!

im getting into learning Java, and its slow going, but im gradually getting there with it etc, but im stumped at the mo!

ive got a project that has 2 files, 1 is the main file, and the other is a seperate class (for a starfield)

the problem is the 2nd file (a class) as whenever I run the main program, i get a java.lang.OutOfMemoryError
error  Cry

my main class is this:
1  
public class fscreen extends JFrame implements KeyListener


my stars class is this:
1  
public class stars extends fscreen


and for my star file I do this which worked on other projects (where the extends was Canvas etc unlike this project) I set it up like this:

1  
2  
3  
4  
5  
// This is in the 'global' area
stars mystarfield;

//In the fscreen bit
mystarfield = new stars();


Now as SOON as I try to do the mystarfield = new stars(); thats when i get the memory error! I cant see whats wrong with it, apart from the only thing im trying different is the extends JFrame bit as with looking at other code etc, found more ppl use that than things like extends Canvas etc (tried that in a previous project, and i had probs trying to get the keylistener working!)

sorry to sound like a complete Newbie, but thats me!  Roll Eyes Cheesy

PS. If i copy the whole stars class into the main .java file and remove the class info and make them  functions the program works fine!

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.

Longarmx (45 views)
2014-10-17 03:59:02

Norakomi (36 views)
2014-10-16 15:22:06

Norakomi (27 views)
2014-10-16 15:20:20

lcass (31 views)
2014-10-15 16:18:58

TehJavaDev (61 views)
2014-10-14 00:39:48

TehJavaDev (61 views)
2014-10-14 00:35:47

TehJavaDev (51 views)
2014-10-14 00:32:37

BurntPizza (67 views)
2014-10-11 23:24:42

BurntPizza (39 views)
2014-10-11 23:10:45

BurntPizza (81 views)
2014-10-11 22:30:10
Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

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