Page 4 of 4 FirstFirst ... 234
Results 46 to 56 of 56
  1. #46
    LightzOut's Avatar
    Join Date
    Oct 2009
    Gender
    male
    Posts
    185
    Reputation
    11
    Thanks
    25
    Quote Originally Posted by DeezNutzX View Post
    looks like a c+p to me
    Your a fucking idiot. I've been taking Computer Science for 3 years learning Java.

  2. #47
    Kanye's Avatar
    Join Date
    Dec 2009
    Gender
    male
    Location
    Niggerville
    Posts
    3,294
    Reputation
    136
    Thanks
    217
    My Mood
    Breezy
    Quote Originally Posted by LightzOut View Post
    Your a fucking idiot. I've been taking Computer Science for 3 years learning Java.
    proof or gtfo

    still looks c+p

  3. #48
    LightzOut's Avatar
    Join Date
    Oct 2009
    Gender
    male
    Posts
    185
    Reputation
    11
    Thanks
    25
    Quote Originally Posted by DeezNutzX View Post
    proof or gtfo

    still looks c+p
    K try searching for that code on the internet. It won't come up anywhere. Or ask me what all the shit does, it's pretty basic applet programming.

  4. #49
    whatup777's Avatar
    Join Date
    May 2010
    Gender
    male
    Location
    CA Source Code Section
    Posts
    4,030
    Reputation
    147
    Thanks
    351
    My Mood
    Dead
    Searched and it did come up.
    Quotes I live by.


    A foolish person learns from his mistakes, I wise person learns from others.
    Quote Originally Posted by AVGN View Post



    mhm

    i live in texas

    i was at the grocery store with my son. He saw a mexican guy, and he said "Look daddy! a mower man!"

    he's 4 yrs old

  5. #50
    LightzOut's Avatar
    Join Date
    Oct 2009
    Gender
    male
    Posts
    185
    Reputation
    11
    Thanks
    25
    Quote Originally Posted by whatup777 View Post
    Searched and it did come up.
    Lier. (short)

  6. #51
    whatup777's Avatar
    Join Date
    May 2010
    Gender
    male
    Location
    CA Source Code Section
    Posts
    4,030
    Reputation
    147
    Thanks
    351
    My Mood
    Dead
    But Its not that exact same. I dunno Java soz...
    Quotes I live by.


    A foolish person learns from his mistakes, I wise person learns from others.
    Quote Originally Posted by AVGN View Post



    mhm

    i live in texas

    i was at the grocery store with my son. He saw a mexican guy, and he said "Look daddy! a mower man!"

    he's 4 yrs old

  7. #52
    LightzOut's Avatar
    Join Date
    Oct 2009
    Gender
    male
    Posts
    185
    Reputation
    11
    Thanks
    25
    Quote Originally Posted by whatup777 View Post
    But Its not that exact same. I dunno Java soz...
    ... Well I doubt there are that many different ways to code Pong. It's a simple game.

    The only c/p part of that entire code was the xhair function I found last year on the internet for my shooter game.

  8. #53
    Kanye's Avatar
    Join Date
    Dec 2009
    Gender
    male
    Location
    Niggerville
    Posts
    3,294
    Reputation
    136
    Thanks
    217
    My Mood
    Breezy
    either way, idgaf, still looks c+p

  9. #54
    LightzOut's Avatar
    Join Date
    Oct 2009
    Gender
    male
    Posts
    185
    Reputation
    11
    Thanks
    25
    And here is my shooter game I started way back for school. I quit working on it a long time ago, to work on other projects, so it's no where near finished.

    Shooter class:
    Code:
    import java.awt.event.*;
    import java.awt.*;
    import java.awt.Color;
    import java.applet.*;
    import java.awt.Image;
    
    public class Shooter extends Applet implements MouseListener, MouseMotionListener, KeyListener
    {
    	Image bgImg;
    	Image mission1;
    	Image bgLvl1;
    	Image enemy1;
    	Image healthPack;
    	Image menu;
    	Image heli;
    	AudioClip shoot;
    	private int ammo;
    	private int reload;
    	private int clips;
    	private int health;
    	private int level;
    	private int kills;
    	private int numEnemy;
    	private int x;
    	private int y;
    	private int menuClick;
    	private int xHeli;
    	private int yHeli;
    	private int xHealth;
    	private int yHealth;
    	private int xOffset;
    	private int yOffset;
    	private int[] enemyCounter;
    	private int[] heliCounter;
    	private boolean[] shot;
    	private boolean[] healthShot;
    	private boolean[] ammoShot;
    	private boolean[] heliShot;
    	private boolean mouseDown;
    	private boolean startReload;
    	private boolean startLevel1;
    	private Waiter shootWait = new Waiter(110);
    	private Waiter reloadWait = new Waiter(800);
    	private Waiter enemyWait = new Waiter(500);
    	private Waiter heliWait = new Waiter(500);
    	private Graphics backg;
    	private Image backbuffer;
    	
    	public void init()
    	{
    		clips = 60;
    		ammo = 30;
    		health = 100;
    		level = 1;
    		numEnemy = 10;
    		xOffset = 4;
    		yOffset = 3;
    		xHealth = 0;
    		yHealth = 100;
    		xHeli = 300;
    		yHeli = 50;
    		shot = new boolean[10];
    		healthShot = new boolean[10];
    		ammoShot = new boolean[10];
    		enemyCounter = new int[10];
    		heliCounter = new int[10];
    		heliShot = new boolean[10];
    		for(int i = 0; i < shot.length; i++)
    		{
    			shot[i] = false;
    			healthShot[i] = false;
    			ammoShot[i] = false;
    			heliShot[i] = false;
    			enemyCounter[i] = 0;
    			heliCounter[i] = 0;
    		}
    		mouseDown = false;
    		startReload = false;
    		startLevel1 = false;
    		menuClick = -1;
    		setBackground(Color.black);
    		addKeyListener(this);
    		addMouseListener(this);
    		addMouseMotionListener(this);
    		backbuffer = createImage(getSize().width, getSize().height); 
    		backg = backbuffer.getGraphics();
    		bgImg = getImage(getCodeBase(), "blackBG.png");
    		mission1 = getImage(getCodeBase(), "mission1.png");
    		bgLvl1 = getImage(getCodeBase(), "lvl1.jpg");
    		enemy1 = getImage(getCodeBase(), "terrorist.png");
    		healthPack = getImage(getCodeBase(), "healthPack.png");
    		menu = getImage(getCodeBase(), "menu.png");
    		heli = getImage(getCodeBase(), "heli.png");
    		//shoot = getAudioClip(getDocumentBase(), "shoot.au");
       		//shoot.play();
    		System.out.println(getCodeBase());
    	}
    	public void paint(Graphics g)
    	{
    		update(g);
    	}
    	public void update(Graphics g)
    	{
    		map();
    		status();
    		shoot();
    		enemy();
    		healthPack();
    		ammoPack();
    		helicopter();
    		crosshair();
    		buttons();
    		if(startReload == true && !reloadWait.isWaiting())
    		{
    			reload();
    			startReload = false;
    		}
    		g.drawImage(backbuffer, 0,0, this); 
    		try {
    			Thread.sleep(10);
    		} catch(InterruptedException e) {}
    		repaint();	
    	}
    	public void map()
    	{
    		if(level == 1)
    		{
    			backg.drawImage(mission1, 0, 0, 1200, 800, this);
    			if(startLevel1)
    			{
    				backg.drawImage(bgImg, 0, 0, 1200, 800, this);
    				backg.setColor(Color.WHITE);
    				backg.drawString("Saudi Arabia!", 560, 20);
    				backg.drawImage(bgLvl1, 0, 40, 1200, 730, this);
    			}
    		}
    	}
    	public void status()
    	{
    		if(startLevel1)
    		{
    			backg.setColor(Color.WHITE);
    			backg.drawString("Health: " + health, 1100, 20);
    			backg.drawString("Ammo: " + ammo + "/" + clips, 1100, 785);
    			backg.drawString("Level: " + level, 10, 20);
    			backg.drawString("Kills: " + kills, 10, 785);
    			backg.setColor(Color.RED);
    			backg.drawLine(100, 770, 100, 800);
    			backg.drawLine(1075, 0, 1075, 30);
    			backg.drawLine(1075, 770, 1075, 800);
    			backg.drawLine(100, 0, 100, 30);
    		}
    	}
    	public void shoot()
    	{
    		if(mouseDown == true && startLevel1 == true && ammo > 0 && menuClick == -1 && y >= 40 && y <= 770 && !shootWait.isWaiting())
    		{
    			ammo--;
    			shootWait.startWaiting();
    		}
    	}
    	public void enemy()
    	{
    		if(level == 1 && health > 0 && menuClick == -1 && startLevel1 == true)
    		{
    			if((shot[0] == false || shot[1] == false || shot[2] == false) && !enemyWait.isWaiting())
    			{
    				health -= 5;
    				enemyWait.startWaiting();
    			}
    			if(shot[0] == false)
    			{
    				backg.drawImage(enemy1, 810, 645, 60, 125, this);
    			}
    			if(x >= 810 && x <= 870 && y >= 645 && y <= 770 && ammo > 0 && shot[0] == false)
    			{
    				enemyCounter[0] += 1;
    				if(enemyCounter[0] == 3)
    				{
    					shot[0] = true;
    					kills++;
    				}
    			}
    			if(shot[1] == false)
    			{
    				backg.drawImage(enemy1, 360, 665, 50, 100, this);
    			}
    			if(x >= 360 && x <= 410 && y >= 665 && y <= 765 && ammo > 0 && shot[1] == false)
    			{
    				shot[1] = true;
    				kills++;
    			}
    			if(shot[2] == false)
    			{
    				backg.drawImage(enemy1, 150, 434, 40, 80, this);
    			}
    			if(x >= 150 && x <= 190 && y >= 434 && y <= 514 && ammo > 0 && shot[2] == false)
    			{
    				shot[2] = true;
    				kills++;
    			}
    		}
    		repaint();
    	}
    	public void reload()
    	{
    		reload = 30 - ammo;
    		clips -= reload;
    		ammo += reload;
    		if(clips < 0)
    		{
    			clips = -clips;
    			ammo -= clips;
    			clips = 0;
    		}
    	}
    	public void healthPack()
    	{
    		if(level == 1 && health > 0 && menuClick == -1 && startLevel1 == true)
    		{
    			if(kills >= 3 && healthShot[0] == false)
    			{
    				xHealth += xOffset;
    				yHealth += yOffset;
    				if(xHealth < 0 || xHealth > 160)
    					xOffset = -xOffset;
    				if(yHealth < 40 || yHealth > 400)
    					yOffset = -yOffset;
    				backg.drawImage(healthPack, xHealth, yHealth, 60, 30, this);
    			}
    			if(x >= xHealth && x <= xHealth + 60 && y >= yHealth && y <= yHealth + 30 && healthShot[0] == false)
    			{
    				healthShot[0] = true;
    				health += 30;
    				if(health > 100)
    					health = 100;
    			}
    		}
    	}
    	public void ammoPack()
    	{
    		
    	}
    	public void helicopter()
    	{
    		if(level == 1 && health > 0 && menuClick == -1 && startLevel1 == true)
    		{
    			if(kills >= 3 && heliShot[0] == false)
    			{
    				xHeli += xOffset;
    				if(xHeli < 300 || xHeli > 900)
    					xOffset = -xOffset;
    				backg.drawImage(heli, xHeli, yHeli, 100, 80, this);
    			}
    			if(x >= xHeli && x <= xHeli + 100 && y >= yHeli && y <= yHeli + 80 && heliShot[0] == false)
    			{
    				heliCounter[0] += 1;
    				if(heliCounter[0] == 8)
    				{
    					heliShot[0] = true;
    				}
    			}
    		}
    	}
    	public void crosshair()
    	{
    		Frame browserFrame;
    		Component parentComponent;
    		parentComponent = getParent();
    		while ( parentComponent != null && 
    		         !(parentComponent instanceof Frame)) {      
    		  parentComponent = parentComponent.getParent();
    		}
    		browserFrame = (Frame) parentComponent;         
    		browserFrame.setCursor(Frame.CROSSHAIR_CURSOR);
    		/*
    			 -:CURSOR OPTIONS:-
    			 CROSSHAIR_CURSOR, DEFAULT_CURSOR, 
    			 E_RESIZE_CURSOR, HAND_CURSOR
    			 MOVE_CURSOR, N_RESIZE_CURSOR, 
    			 NE_RESIZE_CURSOR, NW_RESIZE_CURSOR;
    			 S_RESIZE_CURSOR,SE_RESIZE_CURSOR, 
    			 SW_RESIZE_CURSOR, TEXT_CURSOR,
    			 W_RESIZE_CURSOR, WAIT_CURSOR
    		 */
    	}
    	public void buttons()
    	{
    		if(!startLevel1)
    		{
    			backg.setColor(Color.BLACK);
    			backg.fillRect(970, 720, 150, 45);
    			backg.setColor(Color.WHITE);
    			backg.drawString("Start!", 1028, 745);
    		}
    		// Menu
    		if(startLevel1)
    		{
    			backg.setColor(Color.RED);
    			backg.fillRect(561, 776, 80, 25);
    			backg.setColor(Color.WHITE);
    			backg.drawRect(559, 774, 83, 27);
    			backg.drawString("Menu", 585, 790);
    			if(menuClick == 1)
    			{
    				backg.drawImage(menu, 350, 500, 500, 273, this);
    				backg.drawString("Controls", 400, 600);
    				backg.drawLine(400, 603, 445, 603);
    				backg.drawString("R - Reload", 400, 620);
    				backg.drawString("Left Mouse - Shoot", 400, 640);
    				backg.drawString("M - Menu", 400, 660);
    				backg.drawString("S - Start Over", 400, 680);
    			}
    		}
    	}
    	public void mouseClicked(MouseEvent e)
    	{
    		int xPos = e.getX();
    		int yPos = e.getY();
    		if(xPos >= 560 && xPos <= 640 && yPos >= 775 && yPos <= 800)
    			menuClick = -menuClick;
    		if(xPos >= 970 && xPos <= 970 + 120 && yPos >= 720 && yPos <= 765)
    			startLevel1 = true;
    	}
    	public void mouseEntered(MouseEvent e)
    	{
    		
    	}
    	public void mouseExited(MouseEvent e)
    	{
    		
    	}
    	public void mousePressed(MouseEvent e)
    	{
    		x = e.getX();
    		y = e.getY();
    		mouseDown = true;
    	}
    	public void mouseReleased(MouseEvent e)
    	{
    		mouseDown = false;
    	}
    	public void mouseMoved(MouseEvent e)
    	{
    	}
    	public void mouseDragged(MouseEvent e)
    	{
    		x = e.getX();
    		y = e.getY();
    		e.consume();
    	}
    	public void keyPressed(KeyEvent e)
    	{
    		char c = e.getKeyChar();
    		if(health > 0 && clips > 0 && ammo < 30 && menuClick == -1 && startLevel1 == true)
    		{
    			if(c == 'r' || c == 'R')
    			{
    				startReload = true;
    				reloadWait.startWaiting();
    			}	
    		}
    	}
    	public void keyReleased(KeyEvent e)
    	{
    		
    	}
    	public void keyTyped(KeyEvent e)
    	{
    		char c = e.getKeyChar();
    		if(c == 'm' || c == 'M')
    			menuClick = -menuClick;
    		if(c == 's' || c == 'S')
    		{
    			startLevel1 = false;
    		}
    	}
    }
    Waiter class:
    Code:
    public class Waiter
    {
    	private long t0, t1;
    	private long wait;
    	
    	public Waiter(int waittime)
    	{
    		wait = waittime;
    	}
    	public void startWaiting()
    	{
    		t0 =  System.currentTimeMillis();
        }
        public boolean isWaiting()
        {
             t1 = System.currentTimeMillis();
          	 return (t1 - t0) < wait;
        }	
    }
    Quote Originally Posted by DeezNutzX View Post
    either way, idgaf, still looks c+p
    Well then thank you.. for complimenting my coding style.
    Last edited by LightzOut; 09-15-2010 at 06:10 PM.

  10. #55
    Beatz's Avatar
    Join Date
    Jul 2009
    Gender
    male
    Location
    In your head.
    Posts
    2,119
    Reputation
    66
    Thanks
    321
    My Mood
    Stressed
    Learn C++ first. Then move on too hooking and D3D.
    Don't Talk If You Can't Do.


  11. #56
    NOOBJr's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Location
    in NOOB
    Posts
    1,426
    Reputation
    112
    Thanks
    693
    You should probably learn English, but that's just a suggestion.

Page 4 of 4 FirstFirst ... 234

Similar Threads

  1. What kind of tutorials should i learn for gfx?
    By melias54 in forum General
    Replies: 11
    Last Post: 08-28-2010, 07:58 PM
  2. What should i learn now?
    By 258456 in forum C++/C Programming
    Replies: 14
    Last Post: 07-02-2010, 03:34 PM
  3. What should i learn?
    By -Jerry™ in forum General
    Replies: 22
    Last Post: 07-22-2009, 08:21 AM
  4. [POLL] what programming language should I learn 1st?
    By aswhooper in forum C++/C Programming
    Replies: 26
    Last Post: 07-19-2009, 12:05 AM
  5. What song should I learn?
    By SheGotIt in forum Spammers Corner
    Replies: 8
    Last Post: 10-29-2008, 06:20 PM