December 26, 2024, 04:13:23 am

Author Topic: Last Person To Reply Wins  (Read 23763 times)

0 Members and 3 Guests are viewing this topic.

NotABronie

  • Full Member
  • *
  • Posts: 233
    • View Profile
Re: Last Person To Reply Wins
« Reply #45 on: December 29, 2012, 12:04:40 am »
whats farcry 3 about
Sincerely,
NotABronie
(click to show/hide)
Quote from: CaveJohnson
We're not banging rocks together here, we know how to put a body back together :D

gavin1928374655

  • Sexy Mermaid
  • Hero Member
  • **
  • Posts: 850
    • View Profile
Re: Last Person To Reply Wins
« Reply #46 on: December 29, 2012, 03:46:04 am »
me

Chief149

  • Hero Member
  • **
  • Posts: 646
  • Oppan Gangnam Style
    • View Profile
Re: Last Person To Reply Wins
« Reply #47 on: December 29, 2012, 04:25:05 am »
Anyone interested in making their own game in java?

Code: [Select]
public class CraftMine
{
     public static void main(String [] args)
     {
          Game g = new Game(); //make the game object
          g.run(); //run the game
          System.exit(0); //exit and close all threads when the game is ready to close (isRunning is set to false)
     }
}

(had to use quote tag since code tag didnt display the entire thing)
Quote
//this class does nothing but provide you with a blank window to fill in with your game objects

import javax.swing.*;
import java.awt.*;

public class Game extends JFrame
{
     private boolean isPlaying = true;

     //fps settings
     private final int DEFAULT_FPS = 60;
     private int fps = DEFAULT_FPS;

     //window dimensions settings
     private int windowWidth = 640;
     private int windowHeight = 480;

     ///place any other global objects you may need below



     public static void main(String [] args) //ignore this
     {
     }

     public run()
     {
          boolean isPlaying = true;

          initialize(); //call the initialization logic
          
          while(isPlaying)
          {
               long startTime = System.currentTimeMillis();

               update();
               draw();

               long endTime = System.currentTimeMillis();

               //keep the framerate from going above the specified fps (default fps is 60)
               if((endTime - startTime) > (1000/fps))
               {
                    try {Thread.sleep((endTime - startTime) - (1000/fps));}
                    catch (Exception e) {}
               }
          }
     }

     public void initialize()
     {
          setSize(windowWidth, windowHeight); //sets the screen dimensions

          //TODO:  place initialization logic here! Set other JFrame settings as well
     }

     public void update()
     {
          //TODO:  place update logic here! Include user input. To make the program
          //stop, simply set isRunning to false to make the while loop exit and consequently, the whole program
     }
    
     public void draw()
     {
          BufferedImage bb = new BufferedImage(windowWidth, windowHeight, BufferedImage.TYPE_INT_RGB);
          
          Graphics buffer = getGraphics(); //get the graphics object (from the JFrame)
          Graphics backbuffer = bb.getGraphics(); //get the graphics object (from the backbuffer buffered image "bb")
          
          //TODO: place drawing logic here! (draw all of your shapes to the backbuffer object. NOT the buffer object)
          



         //END DRAWING LOGIC

         buffer.drawImage(backbuffer, 0, 0, this); //draw the backbuffer to the screen
         //this is known as double buffering, and this prevents the screen from flickering while performing the draw method
     }
}

Might as well post this little snippet while we're talking about games.
I'm sure cschurz will point out how it's not as efficient or neat as it could be. Well, I'm about to go to bed, so yeah. It's just the basic code. Of course you work your way up by making game objects which do all the lower level work so it makes the developement process easier.
« Last Edit: December 29, 2012, 04:27:59 am by Chief149 »



Best griefer name ^



kagarium

  • Sr. Member
  • **
  • Posts: 492
  • I'm alive, but inactive.
    • View Profile
    • My Website
Re: Last Person To Reply Wins
« Reply #48 on: December 29, 2012, 10:35:03 am »
My English teacher from last year had a book called 'All my Friends are Dead'
IGN: kag1999_ (now kagarium, thanks butter)



Quote from: Nick3306
I saved 100% on car insurance by switching to no car insurance

RuthlessTomato

  • Champion Member
  • ***
  • Posts: 1313
    • View Profile
Re: Last Person To Reply Wins
« Reply #49 on: December 29, 2012, 07:34:22 pm »
My dad likes weird songs. Title of 1: death to my hometown.
Chorus of the other: god is great, beer is good, nd ppl r crazy!

Morrison1996

  • I am the spawn of 2 worlds. I AM SlenderBrine.
  • Sr. Member
  • **
  • Posts: 335
  • Former moderator
    • View Profile
Re: Last Person To Reply Wins
« Reply #50 on: December 30, 2012, 04:30:36 am »
Is it the 31st yet. :o



Pew1998

  • Sr. Member
  • **
  • Posts: 265
    • View Profile
Re: Last Person To Reply Wins
« Reply #51 on: December 30, 2012, 05:16:44 am »
My dad likes weird songs. Title of 1: death to my hometown.
Chorus of the other: god is great, beer is good, nd ppl r crazy!
That song is not weird. I grew up listening to country and the songs have good meanings. Sure, most of them are about love, but that one is not. I know most of you are think that I am crazy for listening to country music, but "God is great, beer is good and people are crazy" :p

Pensfan121

  • Sr. Member
  • **
  • Posts: 396
  • SMP-Trusted
    • View Profile
Re: Last Person To Reply Wins
« Reply #52 on: December 30, 2012, 05:37:38 am »
I am the last to reply right?

NotABronie

  • Full Member
  • *
  • Posts: 233
    • View Profile
Re: Last Person To Reply Wins
« Reply #53 on: December 30, 2012, 05:49:04 am »
no... you aren't
Sincerely,
NotABronie
(click to show/hide)
Quote from: CaveJohnson
We're not banging rocks together here, we know how to put a body back together :D

RuthlessTomato

  • Champion Member
  • ***
  • Posts: 1313
    • View Profile
Re: Last Person To Reply Wins
« Reply #54 on: December 30, 2012, 09:42:25 am »
My dad likes weird songs. Title of 1: death to my hometown.
Chorus of the other: god is great, beer is good, nd ppl r crazy!
That song is not weird. I grew up listening to country and the songs have good meanings. Sure, most of them are about love, but that one is not. I know most of you are think that I am crazy for listening to country music, but "God is great, beer is good and people are crazy" :p
Dont get me wrong i love country. I just think 'death to my hometown' is an odd name. And the other is well, kinda stupid.

SonicHogSpeed

  • Full Member
  • *
  • Posts: 142
    • View Profile
Re: Last Person To Reply Wins
« Reply #55 on: December 30, 2012, 01:24:34 pm »
Is it the 31st yet. :o
I just noticed it's the 30th XD. Depends on his time zone for the 31st

Morrison1996

  • I am the spawn of 2 worlds. I AM SlenderBrine.
  • Sr. Member
  • **
  • Posts: 335
  • Former moderator
    • View Profile
Re: Last Person To Reply Wins
« Reply #56 on: December 30, 2012, 02:17:39 pm »
Lol I posted that on the 29th I just needed something to say.



Pensfan121

  • Sr. Member
  • **
  • Posts: 396
  • SMP-Trusted
    • View Profile
Re: Last Person To Reply Wins
« Reply #57 on: December 30, 2012, 04:43:19 pm »
Nothing for you to say other than Pensfan121 will win

CookieMaster

  • Jr. Member
  • *
  • Posts: 82
    • View Profile
Re: Last Person To Reply Wins
« Reply #58 on: December 30, 2012, 05:19:10 pm »
oh no,
MY BUTT is POOPING Turtles That POOP MEEEEE

NotABronie

  • Full Member
  • *
  • Posts: 233
    • View Profile
Re: Last Person To Reply Wins
« Reply #59 on: December 30, 2012, 09:43:05 pm »
so in essence you are pooping your creator?
Sincerely,
NotABronie
(click to show/hide)
Quote from: CaveJohnson
We're not banging rocks together here, we know how to put a body back together :D