Skip to content

Instantly share code, notes, and snippets.

@Jimshii
Jimshii / impissedatthis
Created May 21, 2012 18:54
Simple menu stuff
package skeleton;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JFrame;
import javax.swing.SwingUtilities;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;
package skeleton;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.Color;
import java.io.IOException;
import javax.swing.JFrame;
import javax.swing.JTextField;
import javax.swing.SwingUtilities;
JMenuItem Exit = new JMenuItem("Exit");
Exit.setToolTipText("Exit application");
Exit.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent event) {
statusbar.setText("Exiting");
JOptionPane.showConfirmDialog(main, "Are you sure you want to exit?",
"Exiting", JOptionPane.YES_NO_OPTION);
System.exit(0);
}
public Class negro {
System.out.println("Louie my killa")
}
import java.util.Random;
public class Character {
static String name;
static int health;
static int mana;
static int gold;
static int xp;
static int attack;
public class Example extends JFrame {
private static final long serialVersionUID = 1L;
protected Component main;
public Example() {
initUI();
}
@Jimshii
Jimshii / gist:2785363
Created May 25, 2012 02:00
shopkeeper NPC outline 4 dat kyle feller
package skeleton;
public class ShopNPC {
String response1 = "gtfo my face nigga";
// Do like a dozen of these response.
//String responsetitle = "what he actually says";
//Name the response whatever you want so that they fit the actual response.
//Make sure to include things like "Would you like to view my items?" or "You don't have enough money for that!"
//Easter eggs gogogogogo
@Jimshii
Jimshii / gist:2789078
Created May 25, 2012 16:33
fuck this
public static void CharacterCreate(int ccRace, int ccGender, int ccRole, int qq1, int qq2, int qq3) {
if (ccRace == 0 && ccGender == 0 && ccRole == 0) {
health = 150;
secondBar = "Stamina";
stamina = 100;
strength = 30;
intelligence = 15;
dexterity = 15;
charisma = 0;
JMenuItem Load = new JMenuItem("Load Game");
Load.setToolTipText("Load a previously saved game");
Load.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent event) {
load.loadGame();
if (Character.secondBar == null) {
statusbar.setText("No game found");
}
else {
statusbar.setText("Loading game...");
public class save {
static int savedQ = 0;
public static void gameSave() {
try{ // Catch errors in I/O if necessary.
// Open a file to write to, named GameData.sav.
FileOutputStream saveFile = new FileOutputStream("GameData.sav");
// Create an ObjectOutputStream to put objects into save file.