Show Posts
|
|
Pages: [1] 2
|
|
2
|
Game Development / Newbie & Debugging Questions / Re: Theoretical Solitaire Design Questions :)
|
on: 2013-03-02 02:09:13
|
Not sure why my drag controller class is working  If someone could help me out that would be AWESOME!!!  (made a test project to play around with the drag controller class) EDIT: Sorry for the double post! MAIN SOLITAIRE CLASS: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
| import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.RenderingHints; import java.util.ArrayList;
import javax.swing.JFrame; import javax.swing.JPanel;
public class Solitaire extends JPanel {
private static final long serialVersionUID = 1L; private final static int GAME_WIDTH = 900; private final static int GAME_HEIGHT = GAME_WIDTH / 16 * 9; private JFrame frame; private Card card; private ArrayList<Card> cards = new ArrayList<Card>(); public Solitaire() { this.setPreferredSize(new Dimension(GAME_WIDTH, GAME_HEIGHT)); this.setFocusable(true); this.setVisible(true); frame = new JFrame(); card = new Card(); } protected void paintComponent(Graphics g) { super.paintComponent(g); Graphics2D g2d = (Graphics2D)g; g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); card.draw(g2d); } public static void main(String[] args) { Solitaire game = new Solitaire();
game.frame.setResizable(false); game.frame.add(game); game.frame.pack(); game.frame.setLocationRelativeTo(null); game.frame.setVisible(true); game.frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); }
} |
CARD CLASS: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
| package com.eternalgames.javasolitaire;
import java.awt.Color; import java.awt.Dimension; import java.awt.Graphics2D;
import javax.swing.JComponent;
public class Card extends JComponent{ private static final long serialVersionUID = 1L;
private DragController dragController; private final int CARD_WIDTH = 100; private final int CARD_HEIGHT = 150; public int x = 0; public int y = 0; public Card() { dragController = new DragController(this); } public void draw(Graphics2D g2d) { g2d.setColor(Color.red); g2d.fillRect(x, y, CARD_WIDTH, CARD_HEIGHT); }
public void setCardPos(int x, int y) { this.x = x; this.y = y; } @Override public Dimension getSize() { return new Dimension(CARD_WIDTH, CARD_HEIGHT); } } |
DRAG CONTROLLER CLASS: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
| package com.eternalgames.javasolitaire;
import java.awt.Point; import java.awt.Rectangle; import java.awt.event.MouseEvent;
import javax.swing.event.MouseInputAdapter;
public class DragController extends MouseInputAdapter { private Card card; private Point offset = new Point(); private boolean dragging = false; public DragController(Card card) { this.card = card; card.addMouseListener(this); card.addMouseMotionListener(this); }
public void mousePressed(MouseEvent e) { Point p = e.getPoint(); Rectangle r = new Rectangle(card.getSize()); if (r.contains(p)) { offset.x = p.x - r.x; offset.y = p.y - r.y; dragging = true; } } public void mouseReleased(MouseEvent e) { dragging = false; } public void mouseDragged(MouseEvent e) { if (dragging) { int x = e.getX() - offset.x; int y = e.getY() - offset.y; card.setCardPos(x, y); } } } |
|
|
|
|
|
3
|
Game Development / Newbie & Debugging Questions / Re: Theoretical Solitaire Design Questions :)
|
on: 2013-03-01 09:58:10
|
I'd hold each card in a stack in an array. And for each card within the stack, calculate its 'visible/clickable extent', i.e. the top of the card poking out from within the stack, which could be stored as a Rectangle (this may be constant, or adjust dependant on the number of cards in the stack).
When you click on a stack, check which card's visible extent contains the click, by iterating through the cards in the stack array.
You could then use its array index to handle all cards above it. I.e. if a stack contains 13 cards, where stack[0] is the card at the bottom of the stack, and stack[12] is the topmost card, if your click detection determined you've clicked on stack[8], then you apply the drag event to all cards from stack[8] through to stack[12].
Yeah man, I was thinking that too (the clickable top rectangle), it seems like the most logical solution. You could handle the clickable areas sort of like tabs within the stack group, and like you said, they would lead the movement of the remainder of the stack. I think I might go with this solution unless anyone else has a more efficient approach  Plan to post the source code here when it's done (hopefully over the weekend). Yay programming! 
|
|
|
|
|
4
|
Game Development / Newbie & Debugging Questions / Theoretical Solitaire Design Questions :)
|
on: 2013-03-01 03:30:21
|
Hi guys! In my spare time I have been designing the classes for a Solitaire game I am hoping to program on the weekend. However I'm stuck on a particular problem. Does anyone have any suggestions as to how to implement the 'drag-ability', of the solitaire cards, more how to distinguish between a card on the top of the stack, versus a card lower down the stack. Basically I'm stuck on how to deal with each card individually according to their position within the solitaire stack. My initial solution was to have the Card class extend JComponent so I could determine when the mouse was within each component, or 'card', then handle them appropriately according to the mouse movement. There must be a simpler way? If anyone has any suggestions I would be very very appreciative
|
|
|
|
|
6
|
Game Development / Newbie & Debugging Questions / Weird swing/JPanel problem!
|
on: 2012-10-18 10:19:34
|
|
I'm have a very strange bug within my program and can't seem to trace it.
When I run my sudoku puzzle game nothing is displayed in the JFrame, but as soon as I resize the JFrame the puzzle and all Swing elements 'pop' or appear into the frame.
Also when I minimize/maximize the frame, the problem is rectified. (Where's the emoticon of the guy hitting himself in the head with a hammer?)
Has anyone ever experienced this sort of swing bug?
|
|
|
|
|
7
|
Game Development / Newbie & Debugging Questions / Re: Quick question regarding the GridBagLayout manager
|
on: 2012-10-16 14:41:26
|
At a guess, because the JTable inside your JScrollPane has no size? Try setMinimumSize() or setPreferredSize()? And why are you calling a table a label?! If you want to hand-code layouts I'd recommend MigLayout, or quite frankly anything that isn't GridBagLayout!  You have no idea how many times I have contemplated throwing my laptop out of the window in frustration trying to get Layout managers to behave. The last two days have been a nightmare!  Thank you for that link, that looks like it is going to solve all of my problems!
|
|
|
|
|
8
|
Game Development / Newbie & Debugging Questions / Quick question regarding the GridBagLayout manager
|
on: 2012-10-16 12:46:18
|
I'm pulling my hair out trying to learn these layout managers. Does anyone know what may be the problem here? This is what I'm getting:  This is what I'm trying to create:  Here's the code: 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
| public void createPanel() { this.setVisible(true); GridBagConstraints gbc = new GridBagConstraints(); gbc.insets = new Insets(4, 4, 4, 4); JTable puzzleLabel = new JTable(null); JLabel usersLabel = new JLabel("Sudoku"); JPanel southPanel = new JPanel(); JPanel westPanel = new JPanel();
JPanel detailsPanel = new JPanel(); detailsPanel.setLayout(new GridBagLayout()); gbc.gridx = 0; gbc.gridy = 0; detailsPanel.add(new JButton("Button"), gbc); gbc.gridx = 0; gbc.gridy = 1; detailsPanel.add(new JButton("Button"), gbc); gbc.gridx = 0; gbc.gridy = 2; detailsPanel.add(new JButton("Button"), gbc); gbc.gridx = 0; gbc.gridy = 0; this.add(westPanel, gbc); gbc.gridx = 1; gbc.gridy = 0; gbc.anchor = GridBagConstraints.WEST; this.add(usersLabel, gbc); gbc.gridx = 1; gbc.gridy = 1; this.add(new JScrollPane(puzzleLabel), gbc); gbc.gridx = 1; gbc.gridy = 2; this.add(southPanel, gbc); gbc.gridx = 2; gbc.gridy = 1; this.add(detailsPanel, gbc);
} |
|
|
|
|
|
9
|
Game Development / Newbie & Debugging Questions / Re: Is there a better way to do this?
|
on: 2012-10-15 15:16:20
|
Have you looked at CardPanel?
As for instantiating game state objects I actually have a class called GameState that holds everything I need regarding the game. Then I instantiate it and hold a reference within my main frame instance. Thus it's accessible wherever I need it.
Naturally the GameState class doesn't include GUI code, loading/saving, etc... just the raw data that represents the guts of the game itself.
My golden rule is "get it working first". Then refactor if it smells really bad or if you think of a better way to do it later on.
Cheers for the response Loom!  I have had a look at the CardPanel layout manager earlier tonight, but I think after working on this for like 10 hours straight my ability to retain any sort of information is very limited! haha I manage to get everything working, then look at the code, and re-do the code to make it more readable and cleaner, which is a endless cycle. I think I have to study more good examples of class structure? (Am I even making sense?) haha, I think it's bed time.
|
|
|
|
|
10
|
Game Development / Newbie & Debugging Questions / Is there a better way to do this?
|
on: 2012-10-15 08:50:16
|
I'm trying to come up with a type of 'menu screen' system, but really have no idea how to go about it. What I have so far is a JPanel that receives user information, then hides itself when it has done so. The idea is to hide and reveal JPanels as they are needed. Also in the game I'm having trouble figuring where is the best place to create objects, especially the user and puzzle objects. Should I design a specific class that does all object creation? Or should I just create them on the fly? Class design and structure has definitely been my Achilles heel in learning OO programming!  Game Frame 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
| public class GameFrame extends JFrame { public static final int GAMEWIDTH = 640; public static final int GAMEHEIGHT = 480; public GameFrame() { super("Sudoku || Calkuro"); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); setSize(GAMEWIDTH, GAMEHEIGHT); setResizable(false); addPanel(new TitlePanel(), BorderLayout.CENTER); } public void addPanel(GamePanel panel, String layout) { add(panel, layout); panel.createPanel(); setVisible(true); } } |
Game Panel 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
| public class TitlePanel extends GamePanel implements ActionListener { private static final long serialVersionUID = 1L; public static final int PANEL_WIDTH; public static final int PANEL_HEIGHT; public InputManager input; private JPanel dataInput; private JLabel titleLabel, userLabel, puzzleLabel, difficultyLabel; private JTextField userTextField, puzzleTextField; private JButton userLoginButton; private JComboBox puzzlesBox, difficultiesBox;
static { PANEL_WIDTH = GameFrame.GAMEWIDTH; PANEL_HEIGHT = GameFrame.GAMEHEIGHT; }
public TitlePanel(){ String[] puzzles = {"Sudoku", "Calkuro"}; String[] difficulties = {"Easy", "Medium", "Hard"}; puzzlesBox = new JComboBox(puzzles); difficultiesBox = new JComboBox(difficulties); dataInput = new JPanel(); input = new InputManager(); titleLabel = new JLabel(); userLabel = new JLabel(); puzzleLabel = new JLabel(); difficultyLabel = new JLabel(); puzzleTextField = new JTextField(); userTextField = new JTextField(" "); userLoginButton = new JButton("Login"); } public void createPanel() { titleLabel.setFont(new Font("arial", Font.BOLD, 50)); titleLabel.setForeground(Color.white); titleLabel.setText("SUDOKU || CALKURO"); userLabel.setText("Username: "); userLabel.setForeground(Color.white); puzzleLabel.setText("Puzzle:"); puzzleLabel.setForeground(Color.white); difficultyLabel.setText("Difficulty:"); difficultyLabel.setForeground(Color.white); userLoginButton.addActionListener(this); this.setSize(PANEL_WIDTH, PANEL_HEIGHT); this.setBackground(Color.DARK_GRAY); this.add(titleLabel); dataInput.setBackground(Color.DARK_GRAY); dataInput.setLayout(new GridLayout(5, 5)); dataInput.add(userLabel); dataInput.add(userTextField); dataInput.add(puzzleLabel); dataInput.add(puzzlesBox); dataInput.add(difficultyLabel); dataInput.add(difficultiesBox); dataInput.add(userLoginButton);
this.add(dataInput); }
@Override public void actionPerformed(ActionEvent e) { Loader.createUser(userTextField.getText()); Loader.createPuzzle(puzzlesBox.getSelectedItem().toString(), difficultiesBox.getSelectedItem().toString()); this.setVisible(false); }
@Override public void update() {}
@Override public void handleInput() {} } |
The "Loader" Class - (Is this even logical?) 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
| public class Loader {
private static Puzzle sudokuPuzzle; private static Puzzle calkuroPuzzle; private User user;
public static void createPuzzle(String puzzleName, String difficulty) { if (puzzleName.equals("Sudoku")) sudokuPuzzle = new SudokuPuzzle(difficulty); if (puzzleName.equals("Calkuro")) calkuroPuzzle = new CalkuroPuzzle(difficulty); }
public static void createUser(String userName) { User user = new User(userName); } } |
|
|
|
|
|
13
|
Game Development / Newbie & Debugging Questions / Help with Java Calkuro!
|
on: 2012-10-11 02:50:18
|
Hey guys was wondering if anyone could help me out with a problem I am having. I am trying to build a Calkuro game similar to the one found here: http://www.youplay.com/games/play/83/170482/At the moment I'm trying to come up with ideas as to how to 'Group' the cages of numbers on the game grid, (if you follow that earlier link this will make sense). So far the only solution I can come up with is to hard code in all the possible cage combinations, but there must be an easier way!  Any suggestions as to how I could go about creating this would be very appreciated. Thanks heaps!
|
|
|
|
|
14
|
Discussions / General Discussions / Re: 2D Game Engine Development [Youtube Tutorials]
|
on: 2012-10-03 13:43:59
|
Hey mate, have been following these tutorials so far they have been great! Awesome work. Just some feedback from a relatively new Java coder, (I assume this is the target audience you're aiming for). Some of your explanations are very quick, making it hard to grasp the concept before the video moves onto another topic, although being a video it's easy to go back and replay. An example being where you explain how the colour class works by reading in the RGB values from the sprite map, had to watch that a few times for it to sink it. I'm really just nick picking, but I thought you'd appreciate some feedback from someone who has watched your videos. OK, gotta go watch video 6! 
|
|
|
|
|
15
|
Game Development / Newbie & Debugging Questions / Re: Help with class design / general software design
|
on: 2012-09-10 09:55:05
|
What the previous poster said: experience is the best teacher. Beyond very expensive textbooks, there's not a lot out there that covers design aspects, but one I can recommend is Head First Design Patterns which is a somewhat more modernized and streamlined take on the original. One thing I really need to stress about design patterns is that they are descriptive, not prescriptive. As in, they're about naming and cataloging existing best practices, but you don't want to force your program to use them if they're not an obvious natural fit. Nothing's worse than seeing a program unnecessarily blown up to use Facades of Factories of Strategies of Visitors of blahdeblah etc ad nauseum. But a program that uses patterns properly can be a thing of beauty. Another really biblical text in the design area is Bertrand Meyer's Object-Oriented Software Construction. Meyer loves to explain everything in terms of Eiffel, a language that frankly only continues to exist for Meyer's books and papers, but most of the ideas in there should apply to any language. What little theory OO has to offer is worth reviewing, and two in particular are: - Law of Demeter - Only talk to your "neighbor" interfaces
- Liskov Substitution Principle - The difference between subtypes and subclasses
(but remember that a subclass may add interfaces, so don't take it too strictly)
What a great response!! Thank you so much, will definitely check out that material. Thanks for the advice ra4king and ags1!
|
|
|
|
|
16
|
Game Development / Newbie & Debugging Questions / Help with class design / general software design
|
on: 2012-09-08 06:57:47
|
Hi again guys, quick question for anyone interested  Was wondering if anyone knew of some good tutorials or material that teaches good program design, good OOP design techniques, or code architectural organization. That being the planning and design of classes and class structure. I am becoming very comfortable with the language now, but still struggling with the correct structure of java classes/programs. I have been searching and all I can really find are tutorials on the actual building of classes and the such, none on the design aspect. I hope I'm making sense, only had 2 hours sleep last night! 
|
|
|
|
|
18
|
Game Development / Newbie & Debugging Questions / Re: Mouse wheel scrolling problem.
|
on: 2012-09-07 05:53:48
|
I think the problem is I don't know how to structure classes the correct way. The design behind the class structure and overall program structure. Here's my modified method, which is in a class called "Entity", which basically handles everything that is displayed on the screen. So I thought by "zooming", the entity class all the subclasses and children of that class would be "zoomed" as well. The zoom method just checks to see which way the mouse scroll wheel has been rotated and applies the appropriate scaling. At the moment it only scales 1x. 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
| import java.awt.Graphics2D; import java.awt.geom.AffineTransform;
public class Entity{
protected double x; protected double y; protected Sprite sprite; protected double dx; protected double dy; AffineTransform tx;
public Entity(String ref, int x, int y){ this.sprite = SpriteStore.get().getSprite(ref); this.x = x; this.y = y; tx = new AffineTransform(); }
public void move(int delta) { x += (delta * dx) / 1000; y += (delta * dy) / 1000; }
public void zoom(Graphics2D g, int scrollAmount){ if (scrollAmount > 0){ g.setTransform(tx); g.scale(0.9, 0.9); } else if (scrollAmount < 0){ g.setTransform(tx); g.scale(1.1, 1.1); } }
public void setHorizontalMovement(double dx) { this.dx = dx; }
public void setVerticalMovement(double dy) { this.dy = dy; }
public double getHorizontalMovement() { return dx; }
public double getVerticalMovement() { return dy; }
public void draw(Graphics2D g) { zoom(g, MouseWheelInputHandler.scrollAmount); sprite.draw(g,(int) x,(int) y); }
public int getX() { return (int) x; }
public int getY() { return (int) y; }
public int getHeight(){ return sprite.getHeight(); }
public int getWidth(){ return sprite.getWidth(); } } |
|
|
|
|
|
19
|
Game Development / Newbie & Debugging Questions / Mouse wheel scrolling problem.
|
on: 2012-09-07 05:15:45
|
Hey guys, having trouble with a zoom method, can't seem to wrap my head around how to get this working. If anyone could help me I would be very appreciative!  Here is the method I am using, (I am using AffineTrasnform to achieve the "zoom" effect). 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
| public void zoom(Graphics2D g){ int scale = 1; if (MouseWheelInputHandler.scrollAmount > 0){ g.setTransform(tx); scale *= 0.1; tx.scale(scale, scale); System.out.println("Scroll up"); MouseWheelInputHandler.scrollAmount = 0; } else if (MouseWheelInputHandler.scrollAmount < 0){ g.setTransform(tx); scale *= -0.1; tx.scale(scale, scale); System.out.println("Scroll down"); MouseWheelInputHandler.scrollAmount = 0; } } |
|
|
|
|
|
22
|
Game Development / Newbie & Debugging Questions / Re: Isometric Tiling and General Object Oriented Woes
|
on: 2012-07-19 07:40:34
|
Nice to see some healthy discussion happening on this thread!  Thanks for all your helpful and knowledgeable advice! However, from what I've read so far you're confusing the issue slightly. What jdgamedev said is correct: You should be attempting to separate your objects/classes into logical components that do their job and only their job. But, take this one step further, you need separate your concepts between "Logic/Backend" and "Graphics/Frontend". The class that you're using to store the data about the tiles should probably not know anything about how it's going to be drawn. It shouldn't even know that it is going to be drawn. Instead, it should probably know enough information that you could write several different renders (ASCII, sprite-based isometric, sprite-based isometric 30-degree, 3d, etc.) to draw it.
I think I'm at the stage in my programming where I can understand how object oriented programming works, but am confused with when I should use it. However, what UprightPath said really hit home to me and helped me to understand the logical aspects of a object oriented structure. (Thank you!) The more I study source code, the more it is making sense to me also. I'm glad someone else is feeling the same way as I am!  I am the point now where I understand simple OOP structure, but when it starts to get larger and more complex I'm totally lost. We can do it!  Hey, I'd love to hear your input on the stuff I've put on my blog. It'll be good to hear from someone around my skill level. If you get a chance check it out. Link is in the signature. I'm actually working on tile maps for my game right now. We can probably learn some stuff from each other. Also, if you have any requests for helpful tips or tutorials let me know. Thanks! Nice blog jdgamedev, very cool idea! It's inspiring to see someone just as enthusiastic as I am to get into game development! I will be sure to follow your blog! 
|
|
|
|
|
23
|
Game Development / Newbie & Debugging Questions / Re: Isometric Tiling and General Object Oriented Woes
|
on: 2012-07-18 04:31:40
|
I'm in a similar boat for learning to program but I hope I can give you a few tips.
As far as creating a separate class, I would definitely recommend it. Usually the answer for me is yes anytime I ask myself if I should create another class. It is good OOP and helps a ton with keeping things organized. The fewer classes I have, the harder I find it to remember what each one does haha. When you separate them logically, it's easy to remember each class's function and to remember what you plan with each part.
Also, if you want to get a good idea of how to organize your game, I HIGHLY recommend looking at other game developers' source. I've got a couple projects set up in my Eclipse that Notch wrote for Ludum Dare. They might not be a perfect example because they were done in 48 hours, but they still help guide me through the process.
Best of luck man, good to see someone doing the same thing as me. MORE GAMES!!!
I'm glad someone else is feeling the same way as I am!  I am the point now where I understand simple OOP structure, but when it starts to get larger and more complex I'm totally lost. We can do it!  There's a link to the source of that thing beside the applet ( http://jonjavaweb.orgfree.com/IsoWorldSource.zip ). Iirc it just stores the objects/blocks in a big 2d array of ArrayLists. The database of how to handle the objects is really nothing special, it's just that the view is "warped" to look isometric when the game is drawn. Thank you so much for the source code, so awesome! I may or may not have a few questions for you in the future if you'd be willing to help me out
|
|
|
|
|
24
|
Game Development / Newbie & Debugging Questions / Isometric Tiling and General Object Oriented Woes
|
on: 2012-07-17 16:22:50
|
Hey guys, recently I have been getting into a lot of Java game development after a semester course on Java at university. I'm doing everything in my own spare time and sometimes it's hard to wrap my head around the more technical aspects of the language. I have been experimenting with the Slick2D library and have been having a lot of fun making small games based off this Entity Engine Tutorial --> http://slick.cokeandcode.com/wiki/doku.php?id=entity_tutorialNow the problem I have at the moment is creating a isometric "board" built by separate diamonds. What would be the best way for me to do this? Rather, what would be the most efficient way to do this? I know how I can store the tiles in a 2 dimensional array based on this --> http://www.java-gaming.org/topics/drawing-isometric-tiles-inside-a-screen/24922/view.htmlHowever what I don't understand is how I should go about implementing this code. Should I create a new TileMap class that builds the map in another class? If so how do I go about re-using the one image over and over without creating a new entity every time? I think I've hit a bit of a wall, and am getting confused with the complexity of some object oriented aspects of coding in general, I am very new! Any help would be very appreciated! ( Sorry if I'm rambling, I REALLY want to get this stuff!!!  )
|
|
|
|
|
26
|
Game Development / Newbie & Debugging Questions / Re: Suggest a project to the new guy!
|
on: 2012-07-11 15:44:02
|
Sweet screenshot! How did you do that deterioration of the shields effect?
Concerning Slick2D, it's a wrapper over LWJGL. It has an API very similar to Java2D but it uses LWJGL underneath. It's mainly for people who want to make games with full hardware acceleration but don't want to get into the specifics of OpenGL.
Thanks man!  For the deterioration effect I just had 4 different sprites loaded into an array, (no damage, little damage, little more damage, and really damaged). Then depending on the "health" of the shields an appropriate sprite was displayed. That makes total sense now, thanks for explaining that.
|
|
|
|
|
28
|
Game Development / Newbie & Debugging Questions / Re: Suggest a project to the new guy!
|
on: 2012-07-11 13:51:47
|
Hi guys, still been working away at my little Java 2D project and have had a million ideas for a more in depth game. I can finally see how it's possible to build games from my own imagination now, which is exciting!  Like you guys suggested I'm going to start becoming familiar with OpenGL and the JLWGL. I'm under the impression that the only way to use the JLWGL is through Slick2D? I'm a little confused, are JLWGL and Slick2D just 2 different libraries? How do they work together? If I wanted to user the JLWGL and Slick2D for my next project, where should I start? ( where/how to learn ). Here's a little screen of what I've been working on. 
|
|
|
|
|
|
Add your game by posting it in the WIP section,
or publish it in Showcase.
The first screenshot will be displayed as a thumbnail.
|
|