Search Results

Search found 10 results on 1 pages for 'kdavis8'.

Page 1/1 | 1 

  • Effectively implementing a game view using java

    - by kdavis8
    I am writing a 2d game in java. The game mechanics are similar to the Pokémon game boy advance series e.g. fire red, ruby, diamond and so on. I need a way to draw a huge map maybe 5000 by 5000 pixels and then load individual in game sprites to across the entirety of the map, like rendering a scene. Game sprites would be things like terrain objects, trees, rocks, bushes, also houses, castles, NPC's and so on. But i also need to implement some kind of camera view class that focuses on the player. the camera view class needs to follow the characters movements throughout the game map but it also needs to clip the rest of the map away from the user's field of view, so that the user can only see the arbitrary proximity adjacent to the player's sprite. The proximity's range could be something like 500 pixels in every direction around the player’s sprite. On top of this, i need to implement an independent resolution for the game world so that the game view will be uniform on all screen sizes and screen resolutions. I know that this does sound like a handful and may fall under the category of multiple questions, but the questions are all related and any advice would be very much appreciated. I don’t need a full source code listing but maybe some pointers to effective java API classes that could make doing what i need to do a lot simpler. Also any algorithmic/ design advice would greatly benefit me as well. example of what i am trying to do in source code form below package myPackage; /** * The Purpose of GameView is to: Render a scene using Scene class, Create a * clipping pane using CameraView class, and finally instantiate a coordinate * grid using Path class. * * Once all of these things have been done, GameView class should then be * instantiated and used jointly with its helper classes. CameraView should be * used as the main drawing image. CameraView is the the window to the game * world.Scene passes data constantly to CameraView so that the entire map flows * smoothly. Path uses the x and y coordinates from camera view to construct * cells for path finding algorithms. */ public class GameView { // Scene is a helper class to game view. it renders the entire map to memory // for the camera view. Scene scene; // Camera View is a helper class to game view. It clips the Scene into a // small image that follows the players coordinates. CameraView Camera; // Path is a helper class to game view. It observes and calculates the // coordinates of camera view and divides them into Grids/Cells for Path // finding. Path path; // this represents the player and has a getSprite() method that will return // the current frame column row combination of the passed sprite sheet. Sprite player; }

    Read the article

  • Thread safe double buffering

    - by kdavis8
    I am trying to implement a draw map method that will draw the tiled image across the surface of the component. I'm having issue with this code. The double buffering does not seem to be working, because the sprite flickers like crazy; my source code: package myPackage; import java.awt.Color; import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.Image; import java.awt.Toolkit; import java.awt.image.BufferStrategy; import java.awt.image.BufferedImage; import javax.swing.JFrame; public class GameView extends JFrame implements Runnable { public BufferedImage backbuffer; public Graphics2D g2d; public Image img; Thread gameloop; Scene scene; public GameView() { super("Game View"); setSize(600, 600); setVisible(true); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); backbuffer = new BufferedImage(getWidth(), getHeight(), BufferedImage.TYPE_INT_RGB); g2d = backbuffer.createGraphics(); Toolkit tk = Toolkit.getDefaultToolkit(); img = tk.getImage(this.getClass().getResource("cage.png")); scene = new Scene(g2d, this); gameloop = new Thread(this); gameloop.start(); } public static void main(String args[]) { new GameView(); } public void paint(Graphics g) { g.drawImage(backbuffer, 0, 0, this); repaint(); } @Override public void run() { // TODO Auto-generated method stub Thread t = Thread.currentThread(); while (t == gameloop) { scene.getScene("dirtmap"); g2d.drawImage(img, 80, 80,this![enter image description here][1]); } } private void drawScene(String string) { // TODO Auto-generated method stub // g2d.setColor(Color.white); // g2d.fillRect(0, 0, getWidth(), getHeight()); scene.getScene(string); } } package myPackage; import java.awt.Color; import java.awt.Component; import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.Image; import java.awt.Toolkit; public class Scene { Graphics g2d; Component c; boolean loaded = false; public Scene(Graphics2D gr, Component co) { g2d = gr; c = co; } public void getScene(String mapName) { Toolkit tk = Toolkit.getDefaultToolkit(); Image tile = tk.getImage(this.getClass().getResource("dirt.png")); // g2d.setColor(Color.red); for (int y = 0; y <= 18; y++) { for (int x = 0; x <= 18; x += 1) { g2d.drawImage(tile, x * 32, y * 32, c); } } loaded = true; } }

    Read the article

  • how to assign web server and domain a public ip adress

    - by kdavis8
    i have installed an ISO image of windows server 2008 r2 onto my VMware workstation, as a virtual server. I am trying to host my own web server for testing purposes.I have Internet service with sprint and i called them to obtain my public ip address. Now that i have my public ip address how to i assign it to my server? I also have a web domain name that i would like to point it at that web server. Do i give it the public ip address or do i give it the name of the server?

    Read the article

  • how to double buffer in multiple classes with java

    - by kdavis8
    I am creating a Java 2D video game. I can load graphics just fine, but when it gets into double buffering I have issues. My source code package myPackage; import java.awt.Color; import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.Image; import java.awt.Toolkit; import java.awt.image.BufferStrategy; import java.awt.image.BufferedImage; import javax.swing.JFrame; public class GameView extends JFrame { private BufferedImage backbuffer; private Graphics2D g2d; public GameView() { setBounds(0, 0, 500, 500); setVisible(true); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); backbuffer = new BufferedImage(getHeight(), getWidth(), BufferedImage.TYPE_INT_BGR); g2d = backbuffer.createGraphics(); Toolkit tk = Toolkit.getDefaultToolkit(); Image img = tk.getImage(this.getClass().getResource("cage.png")); g2d.setColor(Color.red); //g2d.drawString("Hello",100,100); g2d.drawImage(img, 100, 100, this); repaint(); } public static void main(String args[]) { new GameView(); } public void paint(Graphics g) { g2d = (Graphics2D)g; g2d.drawImage(backbuffer, 0, 0, this); } }

    Read the article

  • what is the simplest 3d software for unity?

    - by kdavis8
    Ive heard a lot about Daz studio, Poser, Maya, K-3d, Anim8or, Blender, and all the rest. My question is which one is the best choice in terms of simplicity and quality. price is not an issue really. I'm programming games in java for android mobile devices at the moment but i will eventually move onto larger platforms. I would like to utilize unity3d for the game programming itself and utilize a 3d modeling software just to create the game objects. I just need to know the best one to get started with from scratch or should i use a combination of multiple ones? Any insight for this would be great, thanks!

    Read the article

  • How do I set up a double domain like domain2.mydomain.com and mydomain.com?

    - by kdavis8
    I would like to set up a server similar to Google's. Their domain acts like a double domain, like you can use these URLS, "play.Google.com" or "apps.Google.com", to go to different sites.. For example, my domain would now be "my_domain.com" but i would like another one to be "domain2.my_domain.com". My question is,what is this officially called and how do i set it up? I'm not sure if you need two servers or just 1;

    Read the article

  • how do I set up a double domain?

    - by kdavis8
    I would like to set up a server similar to Google's. Their domain acts like a double domain, like you can use these URLS, "play.Google.com" or "apps.Google.com", to go to different sites.. For example, my domain would now be "my_domain.com" but i would like another one to be "domain2.my_domain.com". My question is,what is this officially called and how do i set it up? I'm not sure if you need two servers or just 1;

    Read the article

  • When should one use the Abstract, Implements, or extends keywords?

    - by kdavis8
    I'm just now moving from a beginner to intermediate level android programmer in the java language. i can successfully write a game framework of classes that work together to accomplish a task beyond basic things, like hello world. but i'm having issues with some pretty basic OOP concepts; When should i derive from an abstract class? When is it more efficient to use an Interface instead of simply sub classing a parent? Basically, between extends, implements, and the abstract keywords, which keywords should be used instead of the others? i'm not looking for a basic definition, as i know them. i need to no when and why i should apply them to my code? what advantages does one have over the other? which is best for game development?

    Read the article

  • php+mysql account management software?

    - by kdavis8
    I need an account system added to my website as a plugin to all of my HTML pages. The account system plugin needs to,register new users, log in current users, remove users who want to disconnect service, and manipulate all of these things via database on my web server. However, I do not know how to program in the PHP language or create and manipulate MySQL databases. I want a program that can create and manipulate the MySQL database automatically for my website and handle also PHP calls automatically. Are there any open source freeware programs out there that i can use? If so what are the names of these freeware?

    Read the article

  • i keep getting a 403 forbidden permission error on my fedora server through my local network

    - by kdavis8
    Trying to view a javascript file on my home server I get the following error: Forbidden You don't have permission to access /jquery-1.8.2.js on this server. Apache/2.2.22 (Fedora) Server at 192.168.1.3 Port 80 I have given all users access to the file like this: sudo chmod -R 777 /var/www/html/jquery-1.8.2.js I have even gone as far as changing the user & group properties in the httpd.conf file.

    Read the article

1