Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - m1kesanders

Pages: [1] 2 3
1
Game Hacking, Modding & Discussing / Quick Question
« on: December 10, 2014, 08:54:11 pm »
Hey so quick question i'm currently running a team and we're designing a game, however one of the team members wants to get familiar with the engine we're using, but he doesn't have enough graphics/ models does anyone know of a large collection of 3d models and meshes out there? it doesn't have to be good graphics or anything, hell i'd accept half life 1 graphics lol thanks for reading

2
General discussion / Oculus Rift DK2 development kit
« on: October 06, 2014, 02:49:56 pm »
Hey so random question here does anyone know what the approximate waiting time is if your in the U.S. (CA) I looked online and all I found were posts from like June, but as of now is it still 6 to 8 weeks like it says on the site, if so does anyone know of any way to get it faster even from a third party? thanks

3
Projects and Discussion / Looking for help designing Bitcoin mine
« on: June 03, 2014, 09:26:51 am »
Ok I did some research and think I have enough info to get a general idea of what we need, however I would like help with this project anyone who knows assembly very well (I know the basics, but still learning) and someone who knows C# or java (not sure which one we're using yet) anyone interested reply to this thread or message me thanks

4
Projects and Discussion / Re: Bitcoin mining in java
« on: June 01, 2014, 09:53:50 pm »
I know it doesn't work so simply that's why i'd need help from more experienced people in making it work, I mean that's what a hacker does takes something that shouldn't work and finds a way to make it work (well one of the things they do) 

5
Projects and Discussion / Bitcoin mining in java
« on: June 01, 2014, 09:01:41 pm »
Hey i'm looking to create a bitcoin miner, in java i'm fairly proficient in java, I'm just unaware how bitcoin mining works and how I'd go about incorporating it in a java program, I don't want this to be some bullshit mining program my hope is that it's work at high speeds to increase the output anyone willing to help will get a copy of the code of course, even if you just message me and tell me what i'd want to do, thanks

6
I started learning programming last year, and what everyone made seem easy is actually not so easy, and honestly I feel like a complete idiot every time I code, because whenever I create a program or do anything there's always someone who says "you could've made that in 10 lines instead of 25" now don't get me wrong I love and appreciate the help, well I guess my question is how long did it take you until you stopped feeling stupid or did you feel stupid in the first place?

7
So basically I want to play a joke on my little brother and take control of his computer tonight just to mess with him, however I do want to make this a learning experience for me, do you know of any resource or if you can give me a tip on how to write a program in java that does this for me? thanks :)

8
Game Hacking, Modding & Discussing / Looking for a spriter for a game
« on: April 19, 2014, 03:14:48 am »
Well anyway I'm starting an indie game team and all we need is a spriter, maybe someone who wants to put their name on a project or just wants more experience and yes I know this isn't the site for it, but might as well ask anyone in the community before I search other places haha just reply or message me with any questions or interest thanks

Staff note: title changed to a more meaningful one.

9
Java / What's wrong with my gameloop
« on: March 27, 2014, 10:56:30 am »
SO I created a decent game loop and have no idea how to call it properly or what am doing wrong if you can take a look it's be really nice thanks

Code: (javascript) [Select]
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;
import java.util.logging.Level;
import java.util.logging.Logger;

import javax.swing.ImageIcon;


@SuppressWarnings("serial")
public class WizardKeyHandeler extends WizardBattleGrid implements KeyListener, Runnable{
public static boolean isRunning = true;
static Thread thread = new Thread();




protected synchronized static void start(){

if(isRunning)
return;
isRunning = true;
thread = new Thread();
thread.start();
}




protected synchronized static void stop(){
if(!isRunning)
return;

isRunning = false;

try{

thread.join();
}
catch(InterruptedException e){

e.printStackTrace();
}
System.exit(1);

}



public void run() {
long lastTime = System.nanoTime();
final double amountOfTicks = 60.0;
double ns = 1000000000 / amountOfTicks;
double timePassed = 0;
int updates = 0;
int frames = 0;
long timer = System.currentTimeMillis();

while(isRunning){

long currentTime = System.nanoTime();
timePassed += (currentTime - lastTime)/ ns;
lastTime = currentTime;
if(timePassed >= 1){
tick();
updates++;
timePassed--;
}

frames++;

if(System.currentTimeMillis() - timer > 1000){

timer += 1000;
System.out.println(updates + " ticks, fps " + frames);
updates = 0;
frames = 0;
}
}
stop();
}



private void tick(){

WizardCells[getBlueSpell().getx()][getBlueSpell().gety()].setIcon(null);
WizardCells[getBlueSpell().changex(getGoodGuy().getx())][getBlueSpell().changey(getGoodGuy().gety() +1)].setIcon(getBlueSpell().getIcon());


}





@Override
public void keyPressed(KeyEvent e) {
int key = e.getKeyCode();

if(key == KeyEvent.VK_W){

if(getGoodGuy().getx() != 0){

WizardCells[getGoodGuy().getx()][getGoodGuy().gety()].setIcon(null);
WizardCells[getGoodGuy().changex(getGoodGuy().getx()-1)][getGoodGuy().gety()].setIcon(getGoodGuy().getIcon());
}

}

else if(key == KeyEvent.VK_S){

if(getGoodGuy().getx() != 19){

WizardCells[getGoodGuy().getx()][getGoodGuy().gety()].setIcon(null);
WizardCells[getGoodGuy().changex(getGoodGuy().getx()+1)][getGoodGuy().gety()].setIcon(getGoodGuy().getIcon());
}
}

else if(key == KeyEvent.VK_D){

if(getGoodGuy().gety() != 9){

WizardCells[getGoodGuy().getx()][getGoodGuy().gety()].setIcon(null);
WizardCells[getGoodGuy().getx()][getGoodGuy().changey(getGoodGuy().gety()+1)].setIcon(getGoodGuy().getIcon());
}
}

else if(key == KeyEvent.VK_A){

if(getGoodGuy().gety() != 0){

WizardCells[getGoodGuy().getx()][getGoodGuy().gety()].setIcon(null);
WizardCells[getGoodGuy().getx()][getGoodGuy().changey(getGoodGuy().gety()-1)].setIcon(getGoodGuy().getIcon());
}
}

else if(key == KeyEvent.VK_SPACE){


while(getBlueSpell().gety() != 19){
run();
}

WizardCells[getGoodGuy().getx()][getGoodGuy().gety()].setIcon(null);



}

}












@Override
public void keyReleased(KeyEvent e) {
int key = e.getKeyCode();
if(key == KeyEvent.VK_W){
if(getGoodGuy().getx() != 0){

WizardCells[getGoodGuy().getx()][getGoodGuy().gety()].setIcon(null);
WizardCells[getGoodGuy().getx()][getGoodGuy().gety()].setIcon(getGoodGuy().getIcon());
}
}

else if(key == KeyEvent.VK_S){

if(getGoodGuy().getx() != 19){

WizardCells[getGoodGuy().getx()][getGoodGuy().gety()].setIcon(null);
WizardCells[getGoodGuy().getx()][getGoodGuy().gety()].setIcon(getGoodGuy().getIcon());
}
}

else if(key == KeyEvent.VK_D){

if(getGoodGuy().gety() != 9){

WizardCells[getGoodGuy().getx()][getGoodGuy().gety()].setIcon(null);
WizardCells[getGoodGuy().getx()][getGoodGuy().gety()].setIcon(getGoodGuy().getIcon());
}
}

else if(key == KeyEvent.VK_A){

if(getGoodGuy().gety() != 0){

WizardCells[getGoodGuy().getx()][getGoodGuy().gety()].setIcon(null);
WizardCells[getGoodGuy().getx()][getGoodGuy().gety()].setIcon(getGoodGuy().getIcon());
}
}

else if(key == KeyEvent.VK_SPACE){


while(getBlueSpell().gety() != 19){
run();
}

WizardCells[getGoodGuy().getx()][getGoodGuy().gety()].setIcon(null);



}

}



@Override
public void keyTyped(KeyEvent e) {
int key = e.getKeyCode();
if(key == KeyEvent.VK_W){
if(getGoodGuy().getx() != 0){

WizardCells[getGoodGuy().getx()][getGoodGuy().gety()].setIcon(null);
WizardCells[getGoodGuy().changex(getGoodGuy().getx()-1)][getGoodGuy().gety()].setIcon(getGoodGuy().getIcon());

}

}

else if(key == KeyEvent.VK_S){

if(getGoodGuy().getx() != 19){

WizardCells[getGoodGuy().getx()][getGoodGuy().gety()].setIcon(null);
WizardCells[getGoodGuy().changex(getGoodGuy().getx()+1)][getGoodGuy().gety()].setIcon(getGoodGuy().getIcon());
}
}

else if(key == KeyEvent.VK_D){

if(getGoodGuy().gety() != 9){

WizardCells[getGoodGuy().getx()][getGoodGuy().gety()].setIcon(null);
WizardCells[getGoodGuy().getx()][getGoodGuy().changey(getGoodGuy().gety()+1)].setIcon(getGoodGuy().getIcon());
}
}

else if(key == KeyEvent.VK_A){

if(getGoodGuy().gety() != 0){

WizardCells[getGoodGuy().getx()][getGoodGuy().gety()].setIcon(null);
WizardCells[getGoodGuy().getx()][getGoodGuy().changey(getGoodGuy().gety()-1)].setIcon(getGoodGuy().getIcon());
}
}

else if(key == KeyEvent.VK_SPACE){


while(getBlueSpell().gety() != 19){
run();
}

WizardCells[getGoodGuy().getx()][getGoodGuy().gety()].setIcon(null);



}


}













}









10
Java / Re: Making sprite move across screen
« on: March 24, 2014, 09:42:18 am »
Alright so I gave it a try and all it's doing is is automatically setting the icon to the end and then to null, how do I do it so it just goes up by one until it hits the edge of the grid? here's my updated code thanks :)

Code: (javascript) [Select]
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;
import java.util.logging.Level;
import java.util.logging.Logger;

import javax.swing.ImageIcon;


@SuppressWarnings("serial")
public class WizardKeyHandeler extends WizardBattleGrid implements KeyListener, Runnable {
public Thread BlueSpellThread = new Thread(this);
public boolean IsFinished = true;

@Override
public void keyPressed(KeyEvent e) {
int key = e.getKeyCode();

if(key == KeyEvent.VK_W){

if(getGoodGuy().getx() != 0){

WizardCells[getGoodGuy().getx()][getGoodGuy().gety()].setIcon(null);
WizardCells[getGoodGuy().changex(getGoodGuy().getx()-1)][getGoodGuy().gety()].setIcon(getGoodGuy().getIcon());
}

}

else if(key == KeyEvent.VK_S){

if(getGoodGuy().getx() != 19){

WizardCells[getGoodGuy().getx()][getGoodGuy().gety()].setIcon(null);
WizardCells[getGoodGuy().changex(getGoodGuy().getx()+1)][getGoodGuy().gety()].setIcon(getGoodGuy().getIcon());
}
}

else if(key == KeyEvent.VK_D){

if(getGoodGuy().gety() != 9){

WizardCells[getGoodGuy().getx()][getGoodGuy().gety()].setIcon(null);
WizardCells[getGoodGuy().getx()][getGoodGuy().changey(getGoodGuy().gety()+1)].setIcon(getGoodGuy().getIcon());
}
}

else if(key == KeyEvent.VK_A){

if(getGoodGuy().gety() != 0){

WizardCells[getGoodGuy().getx()][getGoodGuy().gety()].setIcon(null);
WizardCells[getGoodGuy().getx()][getGoodGuy().changey(getGoodGuy().gety()-1)].setIcon(getGoodGuy().getIcon());
}
}

else if(key == KeyEvent.VK_SPACE){
if(getBlueSpell().gety() != 19){
IsFinished = false;
run();

}

}

}





@Override
public void keyReleased(KeyEvent e) {
int key = e.getKeyCode();
if(key == KeyEvent.VK_W){
if(getGoodGuy().getx() != 0){

WizardCells[getGoodGuy().getx()][getGoodGuy().gety()].setIcon(null);
WizardCells[getGoodGuy().getx()][getGoodGuy().gety()].setIcon(getGoodGuy().getIcon());
}
}

else if(key == KeyEvent.VK_S){

if(getGoodGuy().getx() != 19){

WizardCells[getGoodGuy().getx()][getGoodGuy().gety()].setIcon(null);
WizardCells[getGoodGuy().getx()][getGoodGuy().gety()].setIcon(getGoodGuy().getIcon());
}
}

else if(key == KeyEvent.VK_D){

if(getGoodGuy().gety() != 9){

WizardCells[getGoodGuy().getx()][getGoodGuy().gety()].setIcon(null);
WizardCells[getGoodGuy().getx()][getGoodGuy().gety()].setIcon(getGoodGuy().getIcon());
}
}

else if(key == KeyEvent.VK_A){

if(getGoodGuy().gety() != 0){

WizardCells[getGoodGuy().getx()][getGoodGuy().gety()].setIcon(null);
WizardCells[getGoodGuy().getx()][getGoodGuy().gety()].setIcon(getGoodGuy().getIcon());
}
}

else if(key == KeyEvent.VK_SPACE){
for(int i=0; i<20; i++){
//IsFinished=false;
//run();
if(getBlueSpell().gety() != 19){

WizardCells[getBlueSpell().getx()][getBlueSpell().gety()].setIcon(null);
WizardCells[getBlueSpell().getx()][getBlueSpell().gety()].setIcon(getBlueSpell().getIcon());

}
else{
WizardCells[getBlueSpell().getx()][getBlueSpell().gety()].setIcon(null);
}
}

}





}
//}



@Override
public void keyTyped(KeyEvent e) {
int key = e.getKeyCode();
if(key == KeyEvent.VK_W){
if(getGoodGuy().getx() != 0){

WizardCells[getGoodGuy().getx()][getGoodGuy().gety()].setIcon(null);
WizardCells[getGoodGuy().changex(getGoodGuy().getx()-1)][getGoodGuy().gety()].setIcon(getGoodGuy().getIcon());

}

}

else if(key == KeyEvent.VK_S){

if(getGoodGuy().getx() != 19){

WizardCells[getGoodGuy().getx()][getGoodGuy().gety()].setIcon(null);
WizardCells[getGoodGuy().changex(getGoodGuy().getx()+1)][getGoodGuy().gety()].setIcon(getGoodGuy().getIcon());
}
}

else if(key == KeyEvent.VK_D){

if(getGoodGuy().gety() != 9){

WizardCells[getGoodGuy().getx()][getGoodGuy().gety()].setIcon(null);
WizardCells[getGoodGuy().getx()][getGoodGuy().changey(getGoodGuy().gety()+1)].setIcon(getGoodGuy().getIcon());
}
}

else if(key == KeyEvent.VK_A){

if(getGoodGuy().gety() != 0){

WizardCells[getGoodGuy().getx()][getGoodGuy().gety()].setIcon(null);
WizardCells[getGoodGuy().getx()][getGoodGuy().changey(getGoodGuy().gety()-1)].setIcon(getGoodGuy().getIcon());
}
}

else if(key == KeyEvent.VK_SPACE){
if(getBlueSpell().gety() != 19){
IsFinished =false;
run();

}

}

}





@Override
public void run() {

while(!IsFinished){
if(getBlueSpell().gety()<19){
WizardCells[getBlueSpell().getx()][getBlueSpell().gety()].setIcon(null);
WizardCells[getBlueSpell().changex(getGoodGuy().getx())][getBlueSpell().changey(getBlueSpell().gety() + 1)].setIcon(getBlueSpell().getIcon());

try{
Thread.sleep(1);
}
catch(InterruptedException ex){
Logger.getLogger(WizardKeyHandeler.class.getName()).log(Level.SEVERE, null, ex);
}

}
else{
WizardCells[getBlueSpell().getx()][getBlueSpell().gety()].setIcon(null);
IsFinished = true;
}


}


}
}









11
Java / Re: Making sprite move across screen
« on: March 24, 2014, 09:27:25 am »
Alright thank you i'll give it a try :)

12
Java / Making sprite move across screen
« on: March 23, 2014, 09:58:59 pm »
Alright so I'm back, I figured out the keyEvent thanks everyone who helped :), but now my problem is getting the spell to fire and continuously move across the screen until it hits the right border, as it is I have it so it moves, but only increments one every time I press space I want it to automatically increment after just one press, well here's my code any help is greatly appreciated thanks

I think those are the only classes you'll need, thanks again I looked everywhere on Google and couldn't find a thing anyway thanks :) 

KeyHandeler
Code: (javascript) [Select]
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;
import java.util.logging.Level;
import java.util.logging.Logger;

import javax.swing.ImageIcon;


@SuppressWarnings("serial")
public class WizardKeyHandeler extends WizardBattleGrid implements KeyListener{


@Override
public void keyPressed(KeyEvent e) {
int key = e.getKeyCode();

if(key == KeyEvent.VK_W){

if(getGoodGuy().getx() != 0){

WizardCells[getGoodGuy().getx()][getGoodGuy().gety()].setIcon(null);
WizardCells[getGoodGuy().changex(getGoodGuy().getx()-1)][getGoodGuy().gety()].setIcon(getGoodGuy().getIcon());
}

}

else if(key == KeyEvent.VK_S){

if(getGoodGuy().getx() != 19){

WizardCells[getGoodGuy().getx()][getGoodGuy().gety()].setIcon(null);
WizardCells[getGoodGuy().changex(getGoodGuy().getx()+1)][getGoodGuy().gety()].setIcon(getGoodGuy().getIcon());
}
}

else if(key == KeyEvent.VK_D){

if(getGoodGuy().gety() != 9){

WizardCells[getGoodGuy().getx()][getGoodGuy().gety()].setIcon(null);
WizardCells[getGoodGuy().getx()][getGoodGuy().changey(getGoodGuy().gety()+1)].setIcon(getGoodGuy().getIcon());
}
}

else if(key == KeyEvent.VK_A){

if(getGoodGuy().gety() != 0){

WizardCells[getGoodGuy().getx()][getGoodGuy().gety()].setIcon(null);
WizardCells[getGoodGuy().getx()][getGoodGuy().changey(getGoodGuy().gety()-1)].setIcon(getGoodGuy().getIcon());
}
}

else if(key == KeyEvent.VK_SPACE){
if(getBlueSpell().gety() != 19){
WizardCells[getBlueSpell().getx()][getBlueSpell().gety()].setIcon(null);
WizardCells[getBlueSpell().changex(getGoodGuy().getx())][getBlueSpell().changey(getBlueSpell().gety() +1)].setIcon(getBlueSpell().getIcon());

}

}

}





@Override
public void keyReleased(KeyEvent e) {
int key = e.getKeyCode();
if(key == KeyEvent.VK_W){
if(getGoodGuy().getx() != 0){

WizardCells[getGoodGuy().getx()][getGoodGuy().gety()].setIcon(null);
WizardCells[getGoodGuy().getx()][getGoodGuy().gety()].setIcon(getGoodGuy().getIcon());
}
}

else if(key == KeyEvent.VK_S){

if(getGoodGuy().getx() != 19){

WizardCells[getGoodGuy().getx()][getGoodGuy().gety()].setIcon(null);
WizardCells[getGoodGuy().getx()][getGoodGuy().gety()].setIcon(getGoodGuy().getIcon());
}
}

else if(key == KeyEvent.VK_D){

if(getGoodGuy().gety() != 9){

WizardCells[getGoodGuy().getx()][getGoodGuy().gety()].setIcon(null);
WizardCells[getGoodGuy().getx()][getGoodGuy().gety()].setIcon(getGoodGuy().getIcon());
}
}

else if(key == KeyEvent.VK_A){

if(getGoodGuy().gety() != 0){

WizardCells[getGoodGuy().getx()][getGoodGuy().gety()].setIcon(null);
WizardCells[getGoodGuy().getx()][getGoodGuy().gety()].setIcon(getGoodGuy().getIcon());
}
}

else if(key == KeyEvent.VK_SPACE){

if(getBlueSpell().gety() != 19){

WizardCells[getBlueSpell().getx()][getBlueSpell().gety()].setIcon(null);
WizardCells[getBlueSpell().getx()][getBlueSpell().gety()].setIcon(getBlueSpell().getIcon());

}
else{
WizardCells[getBlueSpell().getx()][getBlueSpell().gety()].setIcon(null);
}
}

}










@Override
public void keyTyped(KeyEvent e) {
int key = e.getKeyCode();
if(key == KeyEvent.VK_W){
if(getGoodGuy().getx() != 0){

WizardCells[getGoodGuy().getx()][getGoodGuy().gety()].setIcon(null);
WizardCells[getGoodGuy().changex(getGoodGuy().getx()-1)][getGoodGuy().gety()].setIcon(getGoodGuy().getIcon());

}

}

else if(key == KeyEvent.VK_S){

if(getGoodGuy().getx() != 19){

WizardCells[getGoodGuy().getx()][getGoodGuy().gety()].setIcon(null);
WizardCells[getGoodGuy().changex(getGoodGuy().getx()+1)][getGoodGuy().gety()].setIcon(getGoodGuy().getIcon());
}
}

else if(key == KeyEvent.VK_D){

if(getGoodGuy().gety() != 9){

WizardCells[getGoodGuy().getx()][getGoodGuy().gety()].setIcon(null);
WizardCells[getGoodGuy().getx()][getGoodGuy().changey(getGoodGuy().gety()+1)].setIcon(getGoodGuy().getIcon());
}
}

else if(key == KeyEvent.VK_A){

if(getGoodGuy().gety() != 0){

WizardCells[getGoodGuy().getx()][getGoodGuy().gety()].setIcon(null);
WizardCells[getGoodGuy().getx()][getGoodGuy().changey(getGoodGuy().gety()-1)].setIcon(getGoodGuy().getIcon());
}
}

else if(key == KeyEvent.VK_SPACE){
if(getBlueSpell().gety() != 19){
WizardCells[getBlueSpell().getx()][getBlueSpell().gety()].setIcon(null);
WizardCells[getBlueSpell().changex(getGoodGuy().getx())][getBlueSpell().changey(getBlueSpell().gety()+1)].setIcon(getBlueSpell().getIcon());

}

}

}









}







BlueSpell

Code: (javascript) [Select]
import javax.swing.ImageIcon;


public class BlueSpell extends WizardBattleGrid{
private int BlueSpellx;
private int BlueSpelly;
private ImageIcon Blue;

public BlueSpell(int x, int y, ImageIcon BlueSpell){
BlueSpellx = x;
BlueSpelly = y;
Blue = BlueSpell;

}

public int getx(){

return BlueSpellx;
}

public int gety(){

return BlueSpelly;
}

public ImageIcon getIcon(){

return Blue;
}

public int changex(int x){

BlueSpellx = x;

return x;
}

public int changey(int y){

BlueSpelly = y;

return y;
}





}


Grid
Code: (javascript) [Select]
import java.awt.*;

import javax.swing.Icon;
import javax.swing.JLabel;
import javax.swing.JPanel;


@SuppressWarnings("serial")

public class WizardBattleGrid extends GameWindowWizard {
public static JLabel[][] WizardCells = new JLabel [20][20];
public static int pos1 = 0;
public static int pos2 = 0;
public static JPanel WizardPanel = new JPanel(new GridLayout(20, 20, 0, 0));










public static void CreateGrid(){


for(int i=0; i<WizardCells.length; i++ ){
for(int j=0; j<WizardCells[i].length; j++){

JLabel label = new JLabel();
WizardCells[i][j] = label;

}
}

for(int i=0; i<WizardCells.length; i++){
for(int j=0; j<WizardCells[i].length;j++){


WizardPanel.add(WizardCells[i][j]);


}

}

WizardCells[pos1+10][pos2].setIcon(GoodGuyWizardIcon());
WizardCells[pos1+10][pos2+19].setIcon(BadGuyWizard());





Window.add(WizardPanel);

}




}




Window
Code: (javascript) [Select]
import java.awt.BorderLayout;

import java.awt.Image;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;

import javax.imageio.ImageIO;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;




@SuppressWarnings("serial")
public class GameWindowWizard extends JFrame {

final static JFrame Window = new JFrame();
static JButton Start = new JButton("Start");
static JButton Exit = new JButton("Exit");
static JPanel MainMenuButtons = new JPanel();
private static JLabel WizardBackground = new JLabel();
public static JLabel GoodGuyWizardLabel = new JLabel();
private static GoodGuy GoodGuyWizard = new GoodGuy(10, 0, GoodGuyWizardIcon());
private static BlueSpell GoodSpell = new BlueSpell(getGoodGuy().getx(), getGoodGuy().gety(), BlueSpellWizard());

public static GoodGuy getGoodGuy(){
return GoodGuyWizard;
}


public static BlueSpell getBlueSpell(){
return GoodSpell;
}

public static ImageIcon BlueSpellWizard(){

ImageIcon BlueSpell = new ImageIcon("resources/bluespellnobackground.png");

return BlueSpell;
}


public static ImageIcon BadGuyWizard(){

ImageIcon BadGuy = new ImageIcon("resources/badguynobackground.png");

return BadGuy;
}


public static ImageIcon GoodGuyWizardIcon(){

ImageIcon GoodGuy = new ImageIcon("resources/goodguynobackground.png") ;



return GoodGuy;

}


public static Image createimgpng(){



BufferedImage WizardBattleIcon = null;

try{
File wizardBattleIconFile = new File("resources/goodguynobackground.png");
WizardBattleIcon = ImageIO.read(wizardBattleIconFile);
ImageIO.write(WizardBattleIcon, "png", wizardBattleIconFile);
   
}
catch(IOException e){
e.printStackTrace();
}



return WizardBattleIcon;


}

public static JLabel createimgjpg(){

BufferedImage MainMenuBackground = null;

try{
File MainMenuBackgroundFile = new File("resources/WizardBattleBackground.jpg");
MainMenuBackground = ImageIO.read(MainMenuBackgroundFile);
ImageIO.write(MainMenuBackground, "jpg", MainMenuBackgroundFile);

}
catch(IOException e){
e.printStackTrace();
}

        WizardBackground = new JLabel(new ImageIcon(MainMenuBackground));


return WizardBackground;



}






public static void MainMenu(){


Window.setSize(640, 480);
Window.add(MainMenuButtons);
Window.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
Window.setLocationRelativeTo(null);
Window.setTitle("Wizard Battle");
MainMenuButtons.add(Start);
MainMenuButtons.add(Exit);
Window.getContentPane().add(MainMenuButtons, BorderLayout.SOUTH);
Window.setIconImage(createimgpng());
Window.add(createimgjpg());
Window.setVisible(true);
Window.setResizable(false);

Exit.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e){

Window.dispose();

}



});

Start.addActionListener(new ActionListener(){
@SuppressWarnings("static-access")
public void actionPerformed(ActionEvent e){

Window.setExtendedState(Window.MAXIMIZED_BOTH);
Window.setFocusable(true);
Window.remove(WizardBackground);
Window.remove(MainMenuButtons);
WizardBattleGrid.CreateGrid();
WizardKeyHandeler WizardKey = new WizardKeyHandeler();
Window.addKeyListener(WizardKey);




}
});
}
}


13
Java / Re: Adding a keyEvent
« on: March 15, 2014, 10:31:12 pm »
Ok, I looked it up and I think I have it created, it's just not working here's my input code if you can take a look at it, and how I called it into the window

Code: (javascript) [Select]
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;


@SuppressWarnings("serial")
public class WizardKeyHandeler extends WizardBattleGrid implements KeyListener {

@Override
public void keyPressed(KeyEvent e) {
int key = e.getKeyCode();

if(key == KeyEvent.VK_W){

WizardCells[pos1+11][pos2].setIcon(GoodGuyWizard());
}

}

@Override
public void keyReleased(KeyEvent e) {
int key = e.getKeyCode();
if(key == KeyEvent.VK_W){

WizardCells[pos1+11][pos2].setIcon(GoodGuyWizard());

}

}

@Override
public void keyTyped(KeyEvent arg0) {
// TODO Auto-generated method stub

}



}


Code: (javascript) [Select]
Start.addActionListener(new ActionListener(){
@SuppressWarnings("static-access")
public void actionPerformed(ActionEvent e){

Window.setExtendedState(Window.MAXIMIZED_BOTH);
Window.remove(WizardBackground);
Window.remove(MainMenuButtons);
WizardBattleGrid.CreateGrid();
WizardKeyHandeler WizardKey = new WizardKeyHandeler();
//WizardKeyInfo.setFocusable(true);
//WizardKeyInfo.addKeyListener(WizardKey);
Window.addKeyListener(WizardKey);

14
Java / Re: Adding a keyEvent
« on: March 14, 2014, 07:40:38 pm »
Ok thank you I will look the input class up online

15
Java / Re: Adding a keyEvent
« on: March 14, 2014, 03:19:37 am »
Thanks Matriplex I edited my question above and the graphics is just sprites created through paint and put on through ImageIcon

Pages: [1] 2 3