Show Posts
|
|
Pages: [1] 2 3 ... 11
|
|
3
|
Game Development / Newbie & Debugging Questions / Re: How to listen multiple Key presses?
|
on: 2013-03-18 17:45:34
|
Here's the listener that I use. I got it from Notch. 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
| public class Input implements KeyListener {
public List<Key> keys = new ArrayList<Key>(); public Key up = new Key(); public Key down = new Key(); public Key left = new Key(); public Key right = new Key(); public Key exit = new Key(); public Input(Main game) { game.addKeyListener(this); } @Override public void keyPressed(KeyEvent e) { toggle(e, true); }
@Override public void keyReleased(KeyEvent e) { toggle(e, false); }
@Override public void keyTyped(KeyEvent e) { } private void toggle(KeyEvent e, boolean pressed) { if (e.getKeyCode() == KeyEvent.VK_UP) up.toggle(pressed); if (e.getKeyCode() == KeyEvent.VK_DOWN) down.toggle(pressed); if (e.getKeyCode() == KeyEvent.VK_LEFT) left.toggle(pressed); if (e.getKeyCode() == KeyEvent.VK_RIGHT) right.toggle(pressed); if (e.getKeyCode() == KeyEvent.VK_ESCAPE) exit.toggle(pressed); } public void releaseAll() { for (Key key : keys) key.down = false; } public class Key { public boolean down; public Key() { keys.add(this); } public void toggle(boolean pressed) { if (pressed != down) down = pressed; } } } |
|
|
|
|
|
7
|
Java Game APIs & Engines / Java 2D / Re: Fake 3d effect?
|
on: 2013-03-13 16:41:13
|
thanks for the replies... I already was looking on LibGDX and it looks also pretty simple to use. But why do i have to make my own methods? Doesn't libGdx have it? I've seen for example that there is already a orthographic camera coded...
and what about MonkeyEngine? I'm not alone and i could use the help of my brother that is really good on drawing...
I've never used JME, but if that's what you want to try, go for it. There is no perfect solution, no definitive answer to your question. Just try different things and see what works for you.
|
|
|
|
|
8
|
Java Game APIs & Engines / Java 2D / Re: Fake 3d effect?
|
on: 2013-03-13 16:35:00
|
so that game shown on the video is 3d?
It's pretty impractical to try to do 3D rendering in Java2D (hence the name). If you want to do a top-down style 3D game (like GTA 1 and 2) then I would recommend using LibGDX. It sounds like you are looking for a library that will do that style of rendering work for you, but you won't find one. You will still have to program your own model loader, your own renderer, your own collision, etc, etc. A library like LibGDX is your best bet. However, unless you are really experienced in 2D rendering and collision, I would recommend sticking with 2D for the time being. Try and see if you can get the game you are thinking of working in 2 dimensions first, then worry about the third. Trying to dive in and do 3D right off the bat is just asking for failure. Hope this helps.
|
|
|
|
|
11
|
Game Development / Newbie & Debugging Questions / Re: JarSplice - "Error in opening zip file"
|
on: 2013-03-07 03:52:54
|
What would you recommend for distributing programs that use Slick2D?
windows: exe linux: .sh or package like .deb mac: whatever mac does: appbuilder thing has nothing to do with slick, goes for everything you also package a private jvm Thanks, but my issue lies in simply getting a .jar to run that references Slick. I don't know why this is causing me so much trouble, it's worked for me for over a year now with no problems.
|
|
|
|
|
12
|
Game Development / Newbie & Debugging Questions / Re: JarSplice - "Error in opening zip file"
|
on: 2013-03-06 20:40:58
|
Runnable Jars have been working for me  . I should switch to standard jar then. Is "Jar creation failed due to the following exception: error in opening zip file" all the error message says? Yes, that is the only error given. Fat JARs might be opened by the default software handling ZIP archives, WinRAR for example... Please don't use fat JARs, it is not a viable solution.
What would you recommend for distributing programs that use Slick2D?
|
|
|
|
|
14
|
Game Development / Newbie & Debugging Questions / JarSplice - "Error in opening zip file"
|
on: 2013-03-06 05:24:04
|
My current project uses Slick2D. I've never had a problem with using JarSplice to distribute my programs that use Slick up until now. When I go to actually create the "Fat Jar", it gives this message: Jar creation failed due to the following exception: error in opening zip file Like I said, I've never come across this problem before. I know that it isn't the natives or the main class causing the issue. Has anyone ever run into this before? What was causing the issue? Here's my source, if that helps at all. http://www.mediafire.com/?57qee753bpru8d7Thanks.
|
|
|
|
|
15
|
Game Development / Newbie & Debugging Questions / Re: Instances problem
|
on: 2013-03-05 18:56:00
|
never mind fixed it I just need to look it see if the tilelist had nulls in it and then just throw those away, my fault , but thanks anyway
ALWAYS check what exception was thrown first, especially if it's a null pointer. Those are very easy to fix.
|
|
|
|
|
16
|
Game Development / Game Play & Game Design / Proper way to implement vast amounts of character dialogue?
|
on: 2013-03-04 20:04:18
|
|
I've been working on a pretty standard role-playing game for quite a while now. It's coming along nicely, but I still don't have a good solution for a major part of the game: handling large amounts of character dialogue and scripted cutscenes.
The simplest (and least-ideal) solution would be to simply make a new class for each cutscene that contains info on where the camera needs to be looking, who needs to say what, etc etc. This doesn't seem like a very good approach to me.
Another idea would be to have a bunch of XML (or something like XML) files that contain the data.
So, my question to anyone who has tackled this issue in the past: how did you do it? If you haven't done this before, what would you do in this situation?
Thanks a bunch for your time.
|
|
|
|
|
17
|
Game Development / Newbie & Debugging Questions / Re: libGDX - It's so large?
|
on: 2013-02-26 19:10:19
|
There are four of us, and that sort of money arrives at random intervals a few times a year. The rest of the time we make $10 a day to share between us. Cas   I subscribe to the believe that making money is not more important that happiness, but how do you survive off of that? I'm sure it takes a LOT of care and planning, but it seems next to impossible. | Nathan
|
|
|
|
|
18
|
Discussions / General Discussions / Change eclipse code font?
|
on: 2013-02-14 18:20:42
|
On one computer I have a nice lovely font that I've been using since i started programming. However, on the new, evil computer, the font is one that I'm not used. I've looked high and low and can't find the option to change it. Anyone know how? I want my font to look like the image on top. Currently it looks like the image on bottom. http://imgur.com/a/5TyVfThanks!
|
|
|
|
|
23
|
Game Development / Networking & Multiplayer / Game Patcher?
|
on: 2013-02-06 17:57:26
|
|
All I want is to program a simple launcher that will allow players to launch the game and change settings. This launcher will also function as a game patcher.
For this, all I want is for the game to be able to download a new, updated .jar file.
Is there an established way for doing this? Also, how can I track the completion of the download to make a status bar?
Thanks a bunch,
Nathan
|
|
|
|
|
25
|
Game Development / Newbie & Debugging Questions / Create OpenGL Texture from ByteBuffer
|
on: 2012-10-04 02:41:17
|
So, is there a quick-and-easy way to go about this? Here's what I have so far: 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
| public TextureSheet(String path, int id, int tw, int th) { try { sheet = ImageIO.read(TextureSheet.class.getClassLoader().getResourceAsStream(path)); int rows = sheet.getHeight() / th; int cols = sheet.getWidth() / tw; BufferedImage[] sprites = new BufferedImage[rows * cols]; for (int x = 0; x < rows; x++) { for (int y = 0; y < cols; y++) { sprites[x * y] = sheet.getSubimage(x * tw, y * th, tw, th); } } for (int i = 0; i < sprites.length; i++) { BufferedImage image = sprites[i]; int[] pixels = new int[image.getWidth() * image.getHeight()]; image.getRGB(0, 0, image.getWidth(), image.getHeight(), pixels, 0, image.getWidth()); ByteBuffer buffer = BufferUtils.createByteBuffer(image.getWidth() * image.getHeight() * 4); for (int y = 0; y < image.getHeight(); y++) { for (int x = 0; x < image.getWidth(); x++) { int pixel = pixels[y * image.getWidth() + x]; buffer.put((byte) ((pixel >> 24) & 0xFF)); buffer.put((byte) ((pixel >> 16) & 0xFF)); buffer.put((byte) ((pixel >> 8) & 0xFF)); buffer.put((byte) (pixel & 0xFF)); } } buffer.flip(); } } catch (IOException e) { e.printStackTrace(); } } |
I'll keep looking into this on my own and will update this thread with the solution if I find one. Thanks in advance, | Nathan p.s. For some reason the formatting gets messed up when I paste in from Eclipse; it looks perfect in there. Oh well.
|
|
|
|
|
28
|
Games Center / Showcase / Re: Rico - A Tale Of Two Brothers - Android
|
on: 2012-08-20 01:38:40
|
I would like to have a mute music/sound button... Sound volume is not needed here You mean in game? Because you can reach the options menu from the main menu where you can set that... And a little pause button wouldn't be too bad The in game menu is not good enough? Why would you need a dedicated pause function? Lol I have heard of "IMakeGames" before somewhere... I don't know where... Somewhere around reddit in minecraft or starbound? Writing questions for AMAs? Dunno... I played neither minecraft nor starbound very much, let alone be active in the communities... and I don't even know what you mean by AMAs... so I guess I'm somebody else...  And again | Nathan
|
|
|
|
|
29
|
Discussions / Community & Volunteer Projects / Re: [Wanted] Developers, Pixel Artists and Bgfxr
|
on: 2012-08-19 20:25:58
|
im still looking for people i got 2 weeks off cause im making my last year university project but im still coding the game. Nathan (StonePickaxes) seems to have gone , i dont see him anymore, so im still looking for people who are willing to help. The game is updated now it has some not so fancy window GUI as i make the inventory, but more coders would be very very nice. Im moderator of the brazillian Minecraft community, as i posted a shitty demo of this game people went nutz and started to create dumb topics about this game such as this one: http://www.minecraftbr.com/forum/Thread-Tutoriais-KoM-Knights-Of-MONARCHY so i think people liked it lol Sorry; I've been busy with my job. Summer is almost over; once school starts I'll be able to commit a lot more. | Nathan
|
|
|
|
|
|
Add your game by posting it in the WIP section,
or publish it in Showcase.
The first screenshot will be displayed as a thumbnail.
|
|