Java-Gaming.org    
Featured games (79)
games approved by the League of Dukes
Games in Showcase (477)
Games in Android Showcase (107)
games submitted by our members
Games in WIP (534)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1] 2
  ignore  |  Print  
  Pipe Extreme  (Read 37921 times)
0 Members and 1 Guest are viewing this topic.
Offline timfoden

Junior Member


Projects: 2



« Posted 2007-01-18 12:40:51 »

Hi All,

Just submitted Pipe Extreme.  Hopefully it'll be a bit more popular than my previous (boring) Space Inversion entry! Smiley

I'm still making changes to PE (submitted version is 0.9).  I still plan to add another level or 2, and to add some more square colours and maybe another effect.

I'm a bit concerned that it may not run quickly enough on slower machines.  If you have any problems in this regard, or have any comments at all, please post them here, and I'll see what I can do (still have 100 bytes or so Smiley )

Cheers, Tim.

Pipe Extreme (v0.9)

Jump and roll your way along the pipe. Score points for speed and for "picking up" yellow squares. Watch out for those other coloured squares though (and the holes)!

Webstart: http://javaunlimited.net/games/launch.php?type=jnlp&id=131

Download: http://javaunlimited.net/games/launch.php?type=file&id=131

Controls.

* Left - Accelerate left.
* Right - Accelerate right.
* Up - Accelerate forwards.
* Down - Accelerate backwards.
* Control - Jump.
* 1 - Start playing.
* Escape - Exit from game.

Screen shot:
 

Try Pipe Extreme -- can you get to the end of the pipe?
Offline nva225

Junior Member





« Reply #1 - Posted 2007-01-18 17:33:06 »

Wow, that's pretty cool. Runs plenty fast on a core duo e6400 at least Smiley

Are you just using graphics.fillArc() or implementing your own methods through pixel editing? Either way you've implemented it pretty well, no complaints graphically at all.

The game is a little difficult to control however (first impression, maybe it will get easier for me?) and I have yet to have been able to get through that loop. It's a bit easy to make (or neglect to make) sudden movements that will then result in your losing or slowing down. Maybe shorten the red distance required for those jumps and widen that loop a little?
Offline appel

JGO Wizard


Medals: 50
Projects: 4


I always win!


« Reply #2 - Posted 2007-01-18 17:44:37 »

Very nice 3D stuff. Too hard to enjoy Sad

Check out the 4K competition @ www.java4k.com
Check out GAMADU (my own site) @ http://gamadu.com/
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline timfoden

Junior Member


Projects: 2



« Reply #3 - Posted 2007-01-18 17:53:23 »

... Runs plenty fast on ...

Well, I don't think that counts as a "slower computer", but it's nice to know. Smiley

... Are you just using graphics.fillArc() ...

graphics2d.fill( new generalPath(...) );

... difficult to control ... yet to have been able to get through that loop. ... sudden movements ...

OK, I'll consider toning it down a bit.  it's tricky as I wanted to be able to jump from left to right without landing in the middle 3 squares (not used in a level yet, but I was planning to).

The loop is possible, or you can cop out, and simply jump the gap. Smiley  Perhaps I should move this to a higher level though.

Thanks for your comments, Tim.

Try Pipe Extreme -- can you get to the end of the pipe?
Offline timfoden

Junior Member


Projects: 2



« Reply #4 - Posted 2007-01-18 17:54:53 »

Very nice 3D stuff. Too hard to enjoy Sad

Thanks for your comment.  As I replied to nva255, I'll look at making it a bit easier (and more fun too, I hope).

Cheers, Tim.

Try Pipe Extreme -- can you get to the end of the pipe?
Offline woogley
« Reply #5 - Posted 2007-01-18 18:06:55 »

I really like this game.. a great improvement to "Tube Blazer" (from one of the very first contests). the only thing that strikes me as odd is the control. like when the ball is at the top of the pipe, I would expect pressing the RIGHT arrow key would make the ball move LEFT.. but direction seems kinda.. absolute?

also, increase the speed! (speed-up squares even?) Smiley
Offline timfoden

Junior Member


Projects: 2



« Reply #6 - Posted 2007-01-18 18:21:53 »

... pressing the RIGHT arrow key would make the ball move LEFT.. but direction seems kinda.. absolute?

My first version did as you expected... but then what would you expect while the ball was in the air?  tricky I thought, so I changed it to function this way.

also, increase the speed! (speed-up squares even?) Smiley

I'll think about it.  So far people have said it's too hard, and making it even faster would make it harder still.  Speed squares that speed up for a short time would be good I guess (you don't have to go on them Smiley ).

Cheers, Tim.

Try Pipe Extreme -- can you get to the end of the pipe?
Offline toasten

Junior Member





« Reply #7 - Posted 2007-01-18 18:32:59 »

Nice graphics  Shocked
Litlle bit hard to play, but maybejust a thing of "training".

The Highscore is hard to read.

My Highscore is: 15608280   
Don't know if thats good, but i got when i replayed the first level 3 timnes, as i always died in the end Grin
Offline woogley
« Reply #8 - Posted 2007-01-18 18:49:07 »

... but then what would you expect while the ball was in the air?

yeah i thought about that after i posted, there's not many ways around it. i'll just have to get used to it Wink
Offline ulfjack

Junior Member





« Reply #9 - Posted 2007-01-18 21:09:36 »

Here is how it looks on my machine:



Seems like you found another bug in sun's jvm.  Sad

Other than that, the game is pretty cool, except...
- I always die on the loop, even when I try to jump it, which is totally frustrating, because I have to start all over again.
- more speed!!!

It reminds me of the old sonic the hedgehog games - there was one game where you have to run down that pipe and collect coins - and you could go faster and faster.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Orangy Tang

JGO Kernel


Medals: 56
Projects: 11


Monkey for a head


« Reply #10 - Posted 2007-01-18 21:34:20 »

Looks really slick, but far, far too hard to be fun IMHO. I think it's that the momentum of the ball is so high, you end up pressing left and right for ages just to get it to start to move, and you always overcompensate and end up swinging back and forth. Undecided Tighter, snappier controls and it'd be great to play.

[ TriangularPixels.com - Play Growth Spurt, Rescue Squad and Snowman Village ] [ Rebirth - game resource library ]
Offline jojoh

JGO Knight


Medals: 5
Projects: 7


games4j.com


« Reply #11 - Posted 2007-01-19 01:33:40 »

Nice and cool looking game!
also, increase the speed! (speed-up squares even?) Smiley
I'll think about it.  So far people have said it's too hard, and making it even faster would make it harder still.
I don't really think it will make it harder, since you just give the player the ability to go faster. That doesn't mean that the player has to go flat out all the time. Have a look at trailblazer. That was quite fast if I remember correct.
Pretty much agree with all previous posters. Would also be nice to have a few restart points in each track, so one won't have to restart from very beginning. Levels are quite short, so maybe not a must if controlls and levels get a bit easier. Lvl 1 was hard, lvl 2 way too hard way too early, then I gave up...

Make it easier for a few more levels and I'll definitely will play it some more  Cheesy

Offline timfoden

Junior Member


Projects: 2



« Reply #12 - Posted 2007-01-19 10:01:08 »

Nice graphics  Shocked

Thanks.

Litlle bit hard to play, but maybejust a thing of "training".

I've made some changes to the levels now, for v0.91.  They're a bit easier.

The Highscore is hard to read.

I've changed the font to be bigger, and moved the scores to the corners.  Hopefully this will make them easier to read.

My Highscore is: 15608280   
Don't know if thats good, but i got when i replayed the first level 3 timnes, as i always died in the end Grin

It is possible to get around the corkscrew... but it seems that people do find it a little hard... so I've moved it to level 4 now.  There's now an easier version of it (where you can't fall off Smiley ) in level 2.

Cheers, Tim.

Try Pipe Extreme -- can you get to the end of the pipe?
Offline nullterm

Senior Newbie





« Reply #13 - Posted 2007-01-19 10:01:27 »

Wow, slick game.  I'm really impressed with the creativity and simplicity of the design.
Offline timfoden

Junior Member


Projects: 2



« Reply #14 - Posted 2007-01-19 10:04:35 »

yeah i thought about that after i posted, there's not many ways around it. i'll just have to get used to it Wink

I think it may work if you can't control the ball while in the air at all, with the change that you can control how hard it jumps.  I'm going to try to add this jumping control anyway, so once that's done, I'll try the other control method again and see what I think.

Cheers, Tim.

Try Pipe Extreme -- can you get to the end of the pipe?
Offline timfoden

Junior Member


Projects: 2



« Reply #15 - Posted 2007-01-19 10:09:02 »

Here is how it looks on my machine...

I guess that there are 2 problems here:
1.  The score and level info is obscured by the Java banner.  This is 'cause I'm drawing directly on the Frame I guess.  I'll have a think about it and see if I can work out a way around it.
2.  There are black dots where the tiles touch.  This is a graphics glitch that I guess I'm probably not going to bother with trying to fix.

- I always die on the loop ...  more speed!!!

Loop is gone now (well, moved to L4 anyway).  I'll look at the more speed thing over the weekend.

It reminds me of the old sonic the hedgehog games ...

Me too.  I used to play them a lot (on my old Sega 16 Smiley ).

Cheers, Tim.

Try Pipe Extreme -- can you get to the end of the pipe?
Offline timfoden

Junior Member


Projects: 2



« Reply #16 - Posted 2007-01-19 10:13:20 »

Looks really slick, but far, far too hard to be fun IMHO.

I've made the 1st couple of levels a bit easier now.  I'm still working on the later levels.

I think it's that the momentum of the ball is so high... Tighter, snappier controls and it'd be great to play.

It's probably feels that way as the right/left control is acceleration based.  Maybe if they were a little more speed based it would be better.  I'll look into this over the weekend.

Thanks for your comments, Tim.

Try Pipe Extreme -- can you get to the end of the pipe?
Offline timfoden

Junior Member


Projects: 2



« Reply #17 - Posted 2007-01-19 10:18:40 »

I don't really think it will make it harder, since you just give the player the ability to go faster.

A good point.  Smiley  I'll change this over the weekend.

Would also be nice to have a few restart points in each track

I've thought about it... but I'm counting those bytes. Smiley  I'll try to fit something like this in.

Levels are quite short

Space, space, space Smiley  I'd love to have longer levels, but as you say, short ones are ok if it gives a restart point.

Lvl 1 was hard, lvl 2 way too hard way too early, then I gave up...

OK, OK.  Smiley

I've made the 1st 2 levels eaiser now.

Thanks for your comments, Tim.

Try Pipe Extreme -- can you get to the end of the pipe?
Offline ulfjack

Junior Member





« Reply #18 - Posted 2007-01-19 11:21:08 »

I've switched my own game to use JComponent (inherit JComponent).
JComponent already gives you double-buffering, so you don't need to implement it yourself.
Dunno if it works for fast games (my aichess4k is round-based).
Offline ulfjack

Junior Member





« Reply #19 - Posted 2007-01-19 11:28:21 »

The new levels are pretty cool!  Grin
After training the loop in (dunno, level 3?) I actually made it through the more difficult one where tiles are missing.
However, let me suggest you do the levels in a different order. First the really easy, short ones, and later the longer and more difficult ones.

Btw. do you happen to know Trackmania Nations? It's actually available for free, so grab it and try it if you want.
Trackmania Nations is a stunt car racer and the levels are kind of similar to yours. TM starts of with a really simple straight road. Then it adds a curve. Then it adds a jump. Then you get more complicated jumps. And so on.
Offline timfoden

Junior Member


Projects: 2



« Reply #20 - Posted 2007-01-19 12:13:28 »

I've switched my own game to use JComponent (inherit JComponent).
JComponent already gives you double-buffering, so you don't need to implement it yourself.
Dunno if it works for fast games (my aichess4k is round-based).

You don't have to implement it yourself on Frame either... well you don't need to get a back buffer, and then copy it.

I guess your comment about real time is relevant.  In a real-time game you want to take control of when screen updates happen, rather than invalidating then waiting for the system to ask you to draw.

The main loop in PE looks something like this:

class G extends Frame
{
   public static void main(String args[])
   {
      G   game = new G();
      game.createBufferStrategy(2);
      BufferStrategy   bs = game.getBufferStrategy();

      // setup some stuff.

      for( ; ; )
      {
         // move some stuff.

         if( catching-up )
            continue;

         Graphics2D   g2 = (Graphics2D)bs.getDrawGraphics();

         // draw some stuff.

         g2.dispose();

         while( !time-to-display )
            sleep-some();

         bs.show();
      }
   }
}

Cheers, Tim.

Try Pipe Extreme -- can you get to the end of the pipe?
Offline timfoden

Junior Member


Projects: 2



« Reply #21 - Posted 2007-01-19 12:21:16 »

However, let me suggest you do the levels in a different order. First the really easy, short ones, and later the longer and more difficult ones.

The later ones are only short (and easy) because I haven't yet made them up... but point taken. Smiley

Try Pipe Extreme -- can you get to the end of the pipe?
Offline woogley
« Reply #22 - Posted 2007-01-19 12:51:56 »

how are you storing the levels by the way? is it like one chunk of map data for each level? if so.. you might can save some space by paritioning the levels by "features." for example.. each level has specific features.. the red ring, the loop, etc.

let's say the red ring is feature #1, the loop is #2, and ordinary greenspace is #3.

then, map data could be stored like:
1  
int level1[] = new int[] {3,3,3,1,3,3,1,2};


and you'd load it like..
1  
2  
3  
4  
5  
6  
7  
8  
for (int j = 0;j < level1.length;j++) {
   switch (level1[j]) {
      case 1: genRedRing(); break;
      case 2: genLoop(); break;
      case 3: genSpace(); break;
      default: break;
   }
}


so what I'm trying to say is.. procedural (or hey, even random) level generation. something tells me you're doing something similiar.. because, i mean, these levels are kind of long Smiley just a thought though
Offline timfoden

Junior Member


Projects: 2



« Reply #23 - Posted 2007-01-19 13:50:16 »

how are you storing the levels by the way? is it like one chunk of map data for each level?

Nope. Smiley

1  
int level1[] = new int[] {3,3,3,1,3,3,1,2};


It's pretty much like this... but using an array in this way is horribly expensive in byte use.  Try it and see.  Each entry takes 6 bytes!  It took me ages to figure out why.  Smiley  (hint: the compiler actually writes the bytecode to stuff the value into each individual array entry... yuk!)

So it's more like:
1  
level[x] = new String("\03\03\03\01\03\03\01\02");

So it's block procedural, with some random elements.

Cheers, Tim.

Try Pipe Extreme -- can you get to the end of the pipe?
Offline nva225

Junior Member





« Reply #24 - Posted 2007-01-19 14:34:29 »

Ooo I'm liking the level changes. I could actually get through level one after a few tries.  Smiley

Much more fun now. Also I really like the loopy thing on level 2.
Offline ulfjack

Junior Member





« Reply #25 - Posted 2007-01-19 14:40:04 »

You don't have to implement it yourself on Frame either... well you don't need to get a back buffer, and then copy it.

I guess your comment about real time is relevant.  In a real-time game you want to take control of when screen updates happen, rather than invalidating then waiting for the system to ask you to draw.

That's what I mean. However, if you do invalidate and wait for the system, that can save quite a bit of space. You are referencing BufferStrategy as well as createBufferStrategy and getBufferStrategy. That means three strings containing exactly that are part of your classes constant pool. If you just call repaint instead, that can save quite a bit.

And you know that you should do:
1  
level[x] = "\03\03\03\01\03\03\01\02";

don't you?


Oh, and I really like the short levels. Cheesy I'd rather put them at the beginning.
Offline timfoden

Junior Member


Projects: 2



« Reply #26 - Posted 2007-01-19 14:53:11 »

That's what I mean. However, if you do invalidate and wait for the system, that can save quite a bit of space. You are referencing BufferStrategy as well as createBufferStrategy and getBufferStrategy. That means three strings containing exactly that are part of your classes constant pool. If you just call repaint instead, that can save quite a bit.

But then you instead have another class: JComponent, plus a reference to JComponent.repaint(), plus you have to override paintComponent(), and, most significantly, all the variables that are required in order to paint need to be class members rather than local vars.

Here's my "minimal game" program.  I wrote it to try various idea out about how to make the smallest possible game loop that has all the support I wanted.  If you can make  a version which has all the same functionality, and can have the drawing separate to the game loop, then I'd be glad to use it (in fact this is an older version, I've got a slightly smaller one now but I don't have the source with me.)

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  
import java.awt.AWTEvent;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Frame;
import java.awt.Graphics2D;
import java.awt.Insets;
import java.awt.event.KeyEvent;
import java.awt.event.WindowEvent;
import java.awt.image.BufferStrategy;

class G extends Frame
{
   public static void main( String args[] )
   {
      G   game = new G();

      game.setTitle( "Minimal Game" );
      game.setVisible( true );//show();
//      Insets   insets = game.getInsets();
//      game.setSize( new Dimension(640 + insets.left + insets.right,
//                           480 + insets.top  + insets.bottom) );
     game.setSize( new Dimension(640, 480) );
      game.setLocationRelativeTo( null );
      game.createBufferStrategy(2);
      game.enableEvents( -1 );   // enable all events
/*
      {
         System.out.println( "insets " + game.getInsets() );
         System.out.println( "getSize " + game.getSize() );
         System.out.println( "getBounds " + game.getBounds() );
      }
*/

      BufferStrategy   bs = game.getBufferStrategy();

      int      count = 0;
      for(;;)
      {
         Graphics2D   g2 = (Graphics2D)bs.getDrawGraphics();

         Dimension   d = game.getSize();
//         g2.translate( insets.left, insets.top );
//         d.width  -= insets.left + insets.right;
//         d.height -= insets.top  + insets.bottom;
 
         g2.setColor(Color.black);
         g2.fillRect(0, 0, d.width, d.height);
   
         g2.setColor( Color.green );

         int   x = (count % 100) * d.width  / 100;
         int   y = (count % 100) * d.height / 100;
         g2.drawLine( x, 0, d.width - x, d.height );
         g2.drawLine( 0, d.height - y, d.width, y );
         g2.drawLine( 0, 0, d.width, d.height );
   
         g2.setColor( Color.cyan );
         g2.drawString( "MINIMAL GAME", d.width / 2 - 50, d.height / 2 );

         try { Thread.sleep( 10 ); } catch( Exception e ) {}

         bs.show();

         g2.dispose();

         count++;
      }
   }

   public void processEvent( AWTEvent e )
   {
      switch( e.getID() )
      {
         case WindowEvent.WINDOW_CLOSING:
         {
            System.exit( 0 );
         }

         case KeyEvent.KEY_PRESSED:
         {
            int   code = ((KeyEvent)e).getKeyCode();
            m_keysDown[code] = true;
            if( code == KeyEvent.VK_ESCAPE )
               System.exit( 0 );
            break;
         }

         case KeyEvent.KEY_RELEASED:
         {
            int   code = ((KeyEvent)e).getKeyCode();
            m_keysDown[code] = false;
         }
      }
   }

   private boolean[]   m_keysDown = new boolean[256];
}


And you know that you should do:
1  
level[x] = "\03\03\03\01\03\03\01\02";

don't you?

Yes... slip of the typing fingers.  Smiley


Oh, and I really like the short levels. Cheesy I'd rather put them at the beginning.

Smiley[/code][/code]

Try Pipe Extreme -- can you get to the end of the pipe?
Offline woogley
« Reply #27 - Posted 2007-01-19 16:48:02 »

the compiler actually writes the bytecode to stuff the value into each individual array entry... yuk!

well yes, just an example Wink

you should release your source code. I bet you *almost* anything I can throw it back to you with smaller bytecode.. ask anyone here (appel, kevglass, etc), I've been doing this waaaay too long. and there are others here who are even more insane than me!
Offline timfoden

Junior Member


Projects: 2



« Reply #28 - Posted 2007-01-19 17:40:08 »

you should release your source code. I bet you *almost* anything I can throw it back to you with smaller bytecode.. ask anyone here (appel, kevglass, etc), I've been doing this waaaay too long. and there are others here who are even more insane than me!

Well I may do later.  I don't have the source here with me at work ATM anyway.

I've not completely run out of space yet, but I'm always mindful of the way that adding extra stuff uses it up.  Smiley

It goes like this.... I add some code... now the progs to big... so I go through it and try to remove some code without losing functionality ... prog is now smaller ... goto loop.  Smiley  I've still got some ideas for things I can chop out (for example, I've got 3-d vectors in there... it may be possible to get away with 2-d ones in many cases.  The code is still fairly 3-d generalised... the ball could go ahead down the pipe and still be rendered ok... this could probably be simpified a little, etc.).

 I currently push the code through proguard and joga, and then bjwflate it.  I've experimented with the internal pack200 stuff, and that'd save some space too, but at the moment I don't need it, so it's not in there (BTW I got the header class for decompressing the pack200 down to 1045 bytes -- although I haven't tested that it actually works! Smiley )

Cheers, Tim.

Try Pipe Extreme -- can you get to the end of the pipe?
Offline woogley
« Reply #29 - Posted 2007-01-19 17:45:49 »

ah, so you're not out of space yet Wink

well if you're desperate, you know what to do! there's people on these forums that know 4K secrets that I could ever imagine.. it's scary. (and handy)

looking forward to your updates!
Pages: [1] 2
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

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 (35 views)
2014-07-24 01:59:36

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

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

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

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

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

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

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

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

Riven (56 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!