• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.

Mr Purple

  • Content count

  • Joined

  • Last visited

Community Reputation

126 Neutral

About Mr Purple

  • Rank
  1. Thanks!   I have managed to get this working within one thread!
  2. I am hoping this will help you to understand my library. This is where the games heart and soul lies. It goes through the objects and should check what commands were given from other objects, such as a key press mouse click, if one is found run the action. I can seem to grasp how to preform actions that need to run longer than an event. Most events have actions that only need to happen on one iteration of the loop, while others need to happen on multiple iterations of the loop. The multiple iteration thing is where I am kinda stumped.   So, when I loop through each game object, how would I know that moveToY is attached to that game object and it still needs to move to the position?   package JGame.Room; import JGame.Game.Game; import JGame.GameObject.GameObject; import JGame.Util.KeyboardMap; import JGame.Util.Mapping; import JGame.Util.MouseMap; import java.awt.Color; import java.awt.Graphics; import java.awt.Image; import java.net.URL; import java.util.ArrayList; import java.util.Iterator; import java.util.Map; import javax.swing.ImageIcon; import javax.swing.JPanel; public class Room extends JPanel implements Runnable{ protected Image bg; ArrayList<GameObject> gameObjects = new ArrayList<>(); protected int width = Game.width, height = Game.height; public static int CENTERX = 0, CENTERY = 0; protected int roomSpeed = 5; /* * This runs the main thread for the current room. * * run() tests for key presses and Mouse Events, it then runs its set method * if a key press or mouse click is activated. */ @Override public void run(){ try{ while(true){ // Check for key press events Iterator actions = KeyboardMap.map.entrySet().iterator(); while(actions.hasNext()){ Map.Entry ap = (Map.Entry)actions.next(); Mapping mp = (Mapping)ap.getValue(); if(mp.pressed){ mp.run(); } } // Check for mouse events Iterator actions2 = MouseMap.map.entrySet().iterator(); while(actions2.hasNext()){ Map.Entry ap = (Map.Entry)actions2.next(); Mapping mp = (Mapping)ap.getValue(); if(mp.pressed){ mp.run(); } } for(GameObject go : gameObjects){ // If An object isn't allowed to leave the screen don't let it leave if(!go.getLeaveScreen()){ int goWidth = go.getWidth(); int goHeight = go.getHeight(); int goX = go.getX(); int goY = go.getY(); int gameWidth = Game.width; int gameHeight = Game.height; if(goX + goWidth >= gameWidth){ go.setX(gameWidth - goWidth); } if(goX <= 0){ go.setX(0); } if(goY + goHeight >= gameHeight){ go.setY(gameHeight - goHeight); } if(goY <= 0){ go.setY(0); } } } this.repaint(); Thread.sleep(roomSpeed); } }catch(Exception e){ } } public Room(){ Thread thread = new Thread(this); thread.start(); } /** * * @param speed * * Sets the room speed; this tells the thread how long it should sleep for. * * The higher the number the slower the room becomes. */ public void setRoomSpeed(int speed){ this.roomSpeed = speed; } /** * * @param width * @param height * * Sets the size of a room. */ public void setRoomSize(int width, int height){ this.width = width; this.height = height; Room.CENTERX = (int)(this.width / 2.0); Room.CENTERY = (int)(this.height / 2.0); } /** * * @param color * * Sets a color to be the background a room */ @Override public void setBackground(Color color){ super.setBackground(color); } /** * * @param filename * * Sets an image to be the background of a room */ public void setBackground(String filename){ URL loc = this.getClass().getResource(filename); ImageIcon imgIcon = new ImageIcon(loc); bg = imgIcon.getImage(); } /** * * @param gameObject * @param x * @param y * * Adds a GameObject to the room at a particular location */ public void addGameObjectAt(GameObject gameObject, int x, int y){ gameObject.setX(x); gameObject.setY(y); gameObjects.add(gameObject); } /** * * @param go * * Removes a known GameObject from the room */ public void removeGameObject(GameObject go){ gameObjects.remove(go); System.gc(); } /** * * @param g * * Draws out all of the GameObjects in the room */ @Override public void paintComponent(Graphics g){ try{ g.drawImage(bg, 0, 0, this); for(int i = 0; i < gameObjects.size(); i++){ GameObject go = gameObjects.get(i); g.drawImage(go.getSprite(), go.getX(), go.getY(), this); } }catch(Exception e){ } } /** * * @return * * Gets the room's width */ @Override public int getWidth(){ return this.width; } /** * * @return * * Gets the room's height */ @Override public int getHeight(){ return this.height; } }     Here is then how I attach actions to an object (very basic Moves the ship +X to move it to the right):   keyboard.keyPress("RIGHT", new Runnable(){ @Override public void run(){ move.moveX(Ship.this, shipSpeed); } });     Something a little more complex, this listens for the space bar, if pressed: create a laser image, and move it vertically to the top of the screen, once it gets to it's designation destroy it:   keyboard.keyPress("SPACE", new Runnable(){ TimeRegulator tr = new TimeRegulator(200); @Override public void run(){ if(!tr.checkTime()){ return; } MoveAction move = new MoveAction(); CollisionEvent colide = new CollisionEvent(); Sprite sprite = new Sprite("/media/images/laser.png"); final GameObject laser = create.create( sprite, (Room)Ship.this.room, Ship.this.getX() + (Ship.this.getWidth() / 2) - 3, Ship.this.getY()); move.moveToY(laser, 0 - sprite.getHeight(), 1, new AbstractAction(){ @Override public void actionPerformed(ActionEvent evt){ DestroyAction destroy = new DestroyAction(); destroy.destroyGameObject((Room)Ship.this.room, laser); } }); } });
  3. The problem is, I need to somehow know which objects need to have an updated position, and how much to move them. Since this is a Game Library/Engine, not all games are built the same so I need to know is moveToY() attached to that object if so move it.... Maybe I am just over thinking this.
  4. Okay, so I have a method called moveToY() what it does is move an object to a Y point, so if your at (0, 200) and you do   moveToY(myObject, 0, 5, myAction); // Object, Y, Speed, AbstracAction   The object will move to point 0. in my library what I currently have is this:   public void moveToY(GameObject obj, int y, int amount, AbstractAction complete){ this.obj = obj; this.endY = y; this.moveAmount = amount; this.complete = complete; thread = new Thread(this); thread.start(); } public void run(){ try{ boolean run = true; while(run){ int objY = obj.getY(); if(objY > this.endY){ obj.setY(obj.getY() - 1); }else if(objY < this.endY){ obj.setY(obj.getY() + 1); }else{ run = false; this.actionComplete(); } thread.sleep(moveAmount); } }catch(Exception e){ } }   I have been told doing that is a bad idea, but I am not really sure how to take that and move it into my main game's thread.
  5. I am currently writing a library, and this library currently has 1 Main game thread, and it gets started by creating an instance of a Room:  Room room1 = new Room1();   Well, what other types and how many threads should a game have?   package SpaceShooters; import JGame.Game.Game; import JGame.Room.Room; import SpaceShooters.Rooms.Room1; import javax.swing.JFrame; public class Main extends JFrame{ public static void main(String[] args){ Game game = new Game("Test Game"); game.startWindowed(800, 600); // This starts the main game thread by extending "Room" // It tests for key pressings mouse clicks, and repaints the screen Room room1 = new Room1(); game.setRoom(room1); } }    
  6. I am not very good at making 3d models, so is there any software out there that makes it easy and quick for people like me?
  7. Is there anything that combines both into one?
  8. I would like to learn Blender (For my graphics), and Python (To make the game). So My question is, does anyone know of any good information as how to work with these? I am still a beginner, and I don't know much about this, and I can't find any books about this either. I would like a tutorial that walks a user through a basic game, with step by step instructions for creating the object in blender, then using Python to import the object to be used in the game and be controlled in the game. Thanks!
  9. Something like this: SELECT * FROM items WHERE type='c' GROUP BY datelisted
  10. I am just starting to program, I know PHP very well, but I would like to start programming some games (Computer). I don't want to do text based games, I would like to use graphics. So, I would like to get some questions answered if you don't mind. 1. What language would be best to start with? 2. What are some good tutorials to read for that language? 3. Extra information here.
  11. Basically anything that a game could use the internet for.
  12. What would be some good reasons for an online server? A few things I can think of are: - High Scores - Game Updates Is there anything else? I would like to make a list, so I can make a free server for those who can't afford one.
  13. Someone made an extension that does this: Quote:Anyway, for those of you who don't know, the current_time variable in GM, while it does measure milliseconds, only gets updated about 60 times per second. So you can only really measure times to the nearest 16 ms. This is terrible resolution even if your game is only running at 30 FPS. So, this extension allows you to measure times which are accurate to the ­µs and possibly higher (it depends on the frequency of the performance counter). That's 1 millionth of a second, or 16000 times higher resolution than current_time. Does this actually improve the quality? He called it "High Resolution Timer". I used it, and either it didn't work, or I had no idea how to use it.
  14. I was looking to extend my C++ knowledge by extending Game Maker 7, with a better graphics (engine?) currently it uses D3D functions to make 3D shapes.
  15. D3D doesn't seem like it supports very good graphics, what is an engine that does support good graphics?