Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (541)
Games in Android Showcase (133)
games submitted by our members
Games in WIP (603)
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] 2
1  Game Development / Game Play & Game Design / Re: Resolving the outcome of a collision between 2 sprites on: 2013-01-30 10:10:47
A rough example:
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
public class CollisionDetector {
   public void addCollisionHandler(CollisionHandler handler);
}

public interface CollisionHandler {
   onCollision(...);
}

public class PlayerCollisionHandler implements CollisionHandler {
...
}


Ahh, I like your thinking Smiley
2  Game Development / Game Play & Game Design / Resolving the outcome of a collision between 2 sprites on: 2013-01-30 08:36:19
Hey Crew,

This isn't another 'How do I do collision detection?'. This more a question of how to resolve the outcome once a collision has been detected.

For Example, I normally have the flow:

  • Update Player Sprite
  • Update Enemy Sprites
  • Check collision between Player & Enemies

But then this is when my thinking gets blurred. The player will have rules on what do to if hit by a enemy and an enemy will have rules if hit by the player, I am just not sure on where the rules should live. Ideally in each class of sprite, but then I can't figure out how to share it.

Is anyone doing anything funky I am not aware of?

Cookie
3  Game Development / Game Play & Game Design / Re: Initial Sprite Location on: 2013-01-09 09:27:31
Hmm - You make a good point, never thought about that.

Perhaps the tilemap soln mixed with your idea. So there is a process at build stage that rips out the enemy tile layer and produces a type -> x,y file.
4  Game Development / Game Play & Game Design / Re: Initial Sprite Location on: 2013-01-08 16:20:27
Interesting idea, personally thought I would prefer the tile map approach as then you can easily see placement and have the pre-processing take care of the precise X&Y coordinates of the sprite.

Thanks for the input though Smiley
5  Game Development / Game Play & Game Design / Re: Initial Sprite Location on: 2013-01-08 09:51:58
Awesome, thanks.

Always best to check before ploughing on!
6  Game Development / Game Play & Game Design / Initial Sprite Location on: 2013-01-08 09:01:59
Hey People

Hope everyone is well!

Question for the floor.

Previously in my platform games I have always used another tilemap layer as a way of placing sprites in game (e.g. enemies, player starting location) then pre-processed it on load of a level to place things.

My question is, is there a better of doing this? Have I done this completely the wrong way?

Cookie
7  Games Center / Archived Projects / Re: Beta Max on: 2011-11-04 21:51:26
I have taken this off Facebook now, due to them moving to SSL and moving the goal posts but I couldn't really bothered to keep pace with them..

But for people who wanted to play it but didn't want to log into Facebook.

http://www.cj-games.co.uk/

Cookie
8  Games Center / Archived Projects / Re: Beta Max on: 2011-07-05 22:12:34
Ah the classic FF + OSX issue. Bah! I think it is to do with the plugin it uses...

Glad you liked Smiley
9  Game Development / Newbie & Debugging Questions / Re: Quick loading of applet on: 2011-07-05 13:20:26
Check this out:

http://www.java-gaming.org/topics/applet-custom-download-progress-screen/23926/msg/199383/view.html#msg199383

This is what I used..
10  Game Development / Newbie & Debugging Questions / Re: Applet KeyListener Not responding on: 2011-07-05 08:59:52
The applet has focus because you have to click on it to start...

Then click again in them menu

So not entirely convince that is the solution.
11  Games Center / Archived Projects / Re: Beta Max on: 2011-07-05 08:49:57
I tried it on Firefox and it works fine, too. Previously I played it on IE8.

When I get to the end of the rack and hit "go back to map" it still gives me the Oops page. Still. Is there only the one level?

It might be nice to restart back at the beginning rather than in the middle. It definitely slows things down to have to go backwards to collect everything when you are rescuscitated in the middle.

I was having fun jumping on top of the little critters. Sorry I keep forgetting their names. Toki! That was it, right? (short for Tooth Decay, right?  Wink ) But I died a lot as a consequence and kept getting restarted in the middle of the game. I guess that is fine. I think the game is a winner. It's not something I'd normally play, with the candy theme and all, and I've never been into Mario type games. But it is well done, well designed and I'm finding myself liking it. Wouldn't mind cruising through a few more levels if I could get past the crash.

That is wierd. There are 18 levels, so not sure why it is dieing at the end of that level for you. I will check the logs later when I get home and see if there is anything serverside..
12  Games Center / Archived Projects / Re: Beta Max on: 2011-07-05 07:04:20
Worked good for me

The controls speed a little finicky and overy expediated.  I personally hate using spacebar, if I have to use it a LOT. you should, if there isnt already, an altnerative control. The spacebar for many keyboards has too move vertical up and down movement for it to be a great "rapid press key" in my opinion.  

Also it feels weird holding down jump, and he repetitively jumps.

I like everything, I am just not the right audience to really enjoy the candy land with an afro atmosphere I guess.


edit: also facebook tutorial, text or video or anything would be super awesome!



 I personally hate using spacebar, if I have to use it a LOT.

Then use the UP key   Wink   . I put spacebar in as my artist wanted it.

I should really do a game tutorial page....  Roll Eyes
13  Games Center / Archived Projects / Re: Beta Max on: 2011-07-04 22:43:15
Very smooth animation! It works quite well for me. I don't see that there is anything I to suggest adding or changing, except maybe having some music would be nice. And sound effects. (Chimes/bells for the captures--probably more appropriate than swallowing sounds. A polite belch here or there could be funny and OK.) Do you have provisions for music/sound? Is this something still in the works?

I did have to reboot when I completed Lollipop Lane. I had lost two lives and was on my third life upon completion. When I arrived at the goal, I was able to see some stats, and then got a message: something unforeseen happened -- please refresh.

When I first bring up the program, Enter does not select the first world which is highlighted. I have to arrow key to the right and then back to the first item. Only then does the Enter key work. I might have to redo this to check if I am reporting this accurately.

Ack, it happened again. This time I got all the sweets (but somehow missed a cookie?) and when I selected "Go to Map" after the completion, i got the "Oops" screen again. Also, the graphics are not refreshing at this point (on the error message screen). The browser I'm using is IE8. I've had problems with this browser on Java games before. What was the last time??? Ah, the "Time for Words" game. http://www.java-gaming.org/topics/time-for-words/24399/view.html

Maybe you've only released the single level so far?

Discovery process: once I found out that headbumping the stripped cubes tended to make them disappear without giving me any points, I stopped doing so, and instead used them only for getting to higher cubes. But one cube I hit from below not only brought up a goody, it brought up 7 of them after repeated headbumps. I was surprised by this, but I think it is a good thing, to have some variety in the behavior of the world's objects that promotes searching. Also, it gives an element (potentially, though it didn't occur in this first wave) of having to do things in a correct order.

I'm guessing that it is possible to jump over the little critters. I haven't tried this yet, as it has been pretty easy to just wait them out.

Very cool! Are you still working on a title for the game as well? Nice job of sticking to the theme/concept.

Hey,

Thanks for the feedback. I will try and answer your questions as best I can

1. Do you have provisions for music/sound? Is this something still in the works?

I do have an idea on the music, unfortunately my musician is only able to output to MP3 atm and I really want MIDI, apparently Apple want extra on the licence for their studio project to do this. That being said, I do know stats from some online games that say >90% of people turn music off on the game. So it is a decision on do I spend time & money on something <10% of my user base is going to bother with.

2. message: something unforeseen happened -- please refresh.

If you have been playing the last half hour or so, I must apologise. I was deploying an update and I missed a setting which caused some down time. It should be stable now.

3. When I first bring up the program, Enter does not select the first world which is highlighted. I have to arrow key to the right and then back to the first item. Only then does the Enter key work. I might have to redo this to check if I am reporting this accurately.


This sounds strange, however I am currently experiencing some keyboard input issues with certain Java configurations. This isn't what should be expected, it is something I am actively fixing.

4. I'm guessing that it is possible to jump over the little critters. I haven't tried this yet, as it has been pretty easy to just wait them out.

..Or you can jump on them Wink

5. Are you still working on a title for the game as well?

Yes and no, the game is still in development. There are 3 full worlds to be unlocked and my artist has just finished the 4th. So as the game evolves anything is possible.

Thank for some excellent feedback Smiley

Cookie
14  Games Center / Archived Projects / Re: Beta Max on: 2011-07-04 16:59:52
Appel, that is a perfectly valid thing to do.

Here is a youtube link with some in-game footage:

http://www.youtube.com/watch?v=5RRvA8dmBEE
15  Games Center / Archived Projects / Re: Beta Max on: 2011-07-04 16:51:04
Ah Shame on the flickering.. Sorry!

What browser are you using? I have had similar complaints when it is a Mac FF combination.

But then it could also be a GFX card clash. I generally get mixed results from Mac OSX..
16  Games Center / Archived Projects / Re: Beta Max on: 2011-07-04 16:02:45
Wow, you really think so? Thank you  Grin

I can do some tutorials on the Facebook integration if people are genuinely interested in putting their applications into the Social eco-sphere.
17  Games Center / Archived Projects / Beta Max on: 2011-07-04 14:44:08
Hi all,

Here is my attempt at platformer:

http://apps.facebook.com/beta_max

Sorry it does require you to log in with your Facebook account (Sorry non.fb users Sad ) But I need an id to save your progress with.

Cookie
18  Game Development / Newbie & Debugging Questions / Applet KeyListener Not responding on: 2011-07-04 10:09:16
Hey All,

I have just put my game live (http://apps.facebook.com/beta_max) but I have had reports from people that key presses aren't being registered. I have found someone I work with who has had the issue and it was resolved by clicking off the applet and back on again. Thing is, it doesn't seem consistent with OS/Java Plugin Ver/Browser, as I have seen people on Linux/Mac/Windows all experiencing it..

Anyone else found this?

Cheers

Cookie
19  Java Game APIs & Engines / OpenGL Development / Re: [SLICK] clampTexture on: 2011-06-19 22:29:51
Thanks!

Was kinda hoping for a better explanation. E.g. in a 2D environment it is a performance killer etc (it may not be )

Cookie
20  Java Game APIs & Engines / OpenGL Development / [SLICK] clampTexture on: 2011-06-19 15:59:05
Hi,

Hope I can post in this one about slick (based on the fact it is a LWJGL wrapper)

I was just wondering, I did try Google first, what is meant by clampTexture on the spritesheet class.

The underlying code is:

1  
2  
3  
4  
5  
6  
7  
if (GLContext.getCapabilities().GL_EXT_texture_mirror_clamp) {
        GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_S, EXTTextureMirrorClamp.GL_MIRROR_CLAMP_TO_EDGE_EXT);
        GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T, EXTTextureMirrorClamp.GL_MIRROR_CLAMP_TO_EDGE_EXT);
} else {
         GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_S, GL11.GL_CLAMP);
         GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T, GL11.GL_CLAMP);
}


What does it do and why is it needed?

Cheers

Cookie
21  Game Development / Performance Tuning / Re: Images and Memory Usage on: 2011-06-07 13:23:14
Yes that is very true... You can't profile images out of existence.

Streaming is a great idea, I already logically group my images in different jars to a;low for caching..

I guess moving on to my other hotspots Smiley
22  Game Development / Performance Tuning / Re: Java2D vs LWJGL on: 2011-06-07 11:12:25
Thanks!

Have been looking at both Slick and LWJGL lately. It is nice to see some good encapsulation over creating a texture. That stuff is mind blowing otherwise!

I am just weighing up the pro's and con's of porting across.

Will plough (would be a pun if MineCraft let you do that) some tutorials later.
23  Game Development / Performance Tuning / Re: Images and Memory Usage on: 2011-06-07 11:09:39
Yeah, looks that way.

Also as a side thing, wouldn't it be more than 7*150KB as the BufferedImage object would contain an uncompressed byte[], post decode, of the image? - I will profile again later looking for byte[]
24  Game Development / Performance Tuning / Java2D vs LWJGL on: 2011-06-07 09:25:26
I have a 2D platform game, Applet-based. Currently I am using Java2D - However I have read conflicting reviews on whether using LWJGL would be worthwhile as the game is a 2D game - I am aware of Slick 2D, so there must be something in it.

However bear in mind I am in an Applet. What issues does this have regarding the native lib install, I would like to keep user interaction with regards to install a minimum.

Also, what is LWJGL like for Android?

Cookie
25  Game Development / Performance Tuning / Images and Memory Usage on: 2011-06-07 07:31:50
Hi People...

Just wanted to get a handle on a preferred way of handling images. In my game I currently have 8 different backgrounds I use at various stages during my game, at the moment I currently create a cache of the 8 images (752x512 JPG ~ 150KB) at start up. But I am beginning to think, convinced by profiling, that I am eating up unnecessarily large amounts of ram - Some of the images aren't going to be used (should I use lazy-loading perhaps?).

So my question is, should I switch to loading the image when I require it in the game?
Thus only having 1 buffered image at anyone time for the background? A pause in the game whilst it loads the image, for the level, is fine. I am just thinking - with this method I am going to incur more GC's due to rotation of different backgrounds.

Anyone have any thoughts? Or is this just a straight trade off?

Cookie
26  Game Development / Newbie & Debugging Questions / Re: Applet upgrade procedure on: 2011-03-08 19:14:29
From a development perspective yes Rivens way is perfectly useful. But I am thinking along the lines of a live environment, I really don't want my players to have to open up the Java console every time I deploy.
27  Game Development / Newbie & Debugging Questions / Re: Applet upgrade procedure on: 2011-03-08 09:21:30
Thanks ra4king that's what I thought was going to be the case. Off the top of your head when they refresh the page would this cause a separate java process to spin up?

Riven, thanks for your input, but that requires input from the end user. I really don't want them to go through a potential 4 step procedure when I update.
28  Game Development / Shared Code / Applet custom download progress screen on: 2011-03-07 23:52:06
Hey Guys,

I had was poking about the JDK documentation looking for how to do a custom download progress for an applet. I personally found it wasn't straight forward and seeing as it turned out to be simple in the end, I thought I would share the results to save others some pain.

First Create your class that extends the DownloadServiceListener class. E.g.

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  
114  
115  
116  
117  
118  
119  
package com.monsterofcookie.progress;

import javax.jnlp.DownloadServiceListener;
import java.awt.Container;
import java.net.URL;
import java.applet.AppletStub;
import java.awt.Canvas;
import java.awt.Graphics2D;
import java.awt.RenderingHints;
import java.awt.image.BufferStrategy;

public class DownloadProgress implements DownloadServiceListener {

    private Container surfaceContainer = null;
    private AppletStub appletStub = null;
//
    private Canvas canvas = null;
    private BufferStrategy bufferStrategy = null;
//
    private final int CANVAS_WIDTH;
    private final int CANVAS_HEIGHT;
//

    public DownloadProgress(Object surface) {
        this(surface, null);
    }

    public DownloadProgress(Object surface, Object stub) {
        this((Container) surface, (AppletStub) stub);
    }

    private DownloadProgress(Container surface, AppletStub stub) {
        surfaceContainer = (Container) surface;
        appletStub = (AppletStub) stub;
        CANVAS_WIDTH = Integer.parseInt(appletStub.getParameter("width"));
        CANVAS_HEIGHT = Integer.parseInt(appletStub.getParameter("height"));
        initUI();
    }

    @Override
    public void downloadFailed(java.net.URL url, java.lang.String version) {
    }

    @Override
    public void progress(URL url, String version, long readSoFar, long total, int overallPercent) {
        updateProgressUI(overallPercent);
    }

    @Override
    public void upgradingArchive(URL url, String version, int patchPercent, int overallPercent) {
        updateProgressUI(overallPercent);
    }

    @Override
    public void validating(URL url, String version, long entry, long total, int overallPercent) {
        updateProgressUI(overallPercent);
    }

    private void initUI() {

        surfaceContainer.setIgnoreRepaint(true);
        surfaceContainer.setLayout(null);
        surfaceContainer.setBounds(0, 0, CANVAS_WIDTH, CANVAS_HEIGHT);
        canvas = new Canvas() {

            @Override
            public void addNotify() {
                super.addNotify();
                this.createBufferStrategy(2);
                bufferStrategy = this.getBufferStrategy();
            }

            @Override
            public void removeNotify() {
                super.removeNotify();
                bufferStrategy.dispose();
                bufferStrategy = null;
            }
        };
        surfaceContainer.add(canvas);
        canvas.setIgnoreRepaint(true);
        canvas.setSize(CANVAS_WIDTH, CANVAS_HEIGHT);
        canvas.setLocation(0, 0);

    }

    private void updateProgressUI(int overallPercentage) {
        if (bufferStrategy != null) {
            if (!bufferStrategy.contentsLost()) {
                bufferStrategy.show();
            }
            Graphics2D graphics2D = getGraphics2D();
            if (graphics2D != null) {
               
                try {

                    // TODO YOUR LOADING DRAWING

                } finally {
                    graphics2D.dispose();
                }
            }
        }
    }

    private Graphics2D getGraphics2D() {
        Graphics2D rtn = null;
        if (bufferStrategy != null) {
            rtn = (Graphics2D) bufferStrategy.getDrawGraphics();
            rtn.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY);
            rtn.setRenderingHint(RenderingHints.KEY_COLOR_RENDERING, RenderingHints.VALUE_COLOR_RENDER_QUALITY);
            rtn.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
            rtn.setRenderingHint(RenderingHints.KEY_ALPHA_INTERPOLATION, RenderingHints.VALUE_ALPHA_INTERPOLATION_QUALITY);
            rtn.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
            rtn.setClip(0, 0, CANVAS_WIDTH, CANVAS_HEIGHT);
        }
        return rtn;
    }
}


You will need to add the javaws.jar and plugin.jar to your classpath for compiling.

Finally (I did this with a jnlp file) amend your jnlp file (bet you didn't see that coming  Wink ) with the following lines

1  
2  
3  
4  
5  
6  
7  
<resources>
        <j2se version="1.6+" href="http://java.sun.com/products/autodl/j2se" />
   <jar href="AppletProgress.jar"  download="progress" />
// Other JARS
</resources>
<applet-desc progress-class="com.monsterofcookie.progress.DownloadProgress" /* other params */>
</applet-desc>


And voila.. I hope this helps out someone else. TBH what will prolly happen is I will forget and find this in a Google search int 6 months time

Cookie


29  Game Development / Newbie & Debugging Questions / Applet upgrade procedure on: 2011-03-07 23:42:29
Hey All.

Quick question with regarding applet binary upgrades.

If I want to release a new version of my applet, I assume it is best to release it with the jar name containing the version number to force the JRE to pull it down and ignore the other. Is this correct? Is there a way I can tell the JRE to invalidate the previous build and use the new one without having the user to change and local settings?

If this is possible, what are the knock on effects, if any, with regards to the classloader in currently running JRE? (if they are viewing the applet currently and refresh the page)

Cheers

James
30  Game Development / Newbie & Debugging Questions / Re: javaDeploy.js on: 2011-02-23 20:36:52
Thanks for the info peeps. It's a shame Sun/Oracle never nailed this...
Pages: [1] 2
 

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

The first screenshot will be displayed as a thumbnail.

Mr.CodeIt (24 views)
2014-12-23 03:34:11

rwatson462 (55 views)
2014-12-15 09:26:44

Mr.CodeIt (45 views)
2014-12-14 19:50:38

BurntPizza (89 views)
2014-12-09 22:41:13

BurntPizza (112 views)
2014-12-08 04:46:31

JscottyBieshaar (83 views)
2014-12-05 12:39:02

SHC (92 views)
2014-12-03 16:27:13

CopyableCougar4 (100 views)
2014-11-29 21:32:03

toopeicgaming1999 (160 views)
2014-11-26 15:22:04

toopeicgaming1999 (159 views)
2014-11-26 15:20:36
Resources for WIP games
by kpars
2014-12-18 10:26:14

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