Game Programming

jMonopoly – Java Monopoly game.

Saturday, January 5th, 2013

So I was sitting in my house today and was thinking about how long its been since I last played Monopoly and started to get the itch to play. As I was searching online to find some Monopoly game to download I though about what a great idea it would be to write my own. So I have spent a few hours today and though I would share my progress. Also since silabsoft.org is my homepage I hoped this post would motivate me to continue working on it

jMonopoly jMonopoly    Java  Monopoly game.

The Dice Class:

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.silabsoft.jmonopoly.model;
 
import java.awt.Image;
import java.awt.image.BufferedImage;
import java.util.Comparator;
import java.util.Random;
 
/**
 *
 * @author Silabsoft
 */
public class Dice extends BoardEntity {
 
    private final BufferedImage[] diceImages;
    private final Random random = new Random();
    private int value;
    public static int t;
 
    public Dice(int x, int y, BufferedImage diceImages[]) {
        drawX = x;
        drawY = y;
        this.diceImages = diceImages;
 
        rollDice();
    }
 
    public Image getImage() {
        return diceImages[value - 1];
    }
 
    public void rollDice() {
        value = 1 + random.nextInt(6);
    }
 
    public int getValue() {
        return value;
    }
 
    public static boolean isDouble(Dice a, Dice b) {
        return a.getValue() == b.getValue();
    }
 
    public boolean isDouble(Dice compare) {
        return this.getValue() == compare.getValue();
    }
 
    public int getTotal(Dice dice) {
        return this.getValue() + dice.getValue();
    }
 
    public static int getTotal(Dice a, Dice b) {
        return a.getValue() + b.getValue();
    }
}

Light Chaser

Saturday, May 12th, 2012

If you havn’t visted http://gamedev.moparscape.org then you probably don’t know that lately I have been working on an html5 javascript clone of a game I used to have as a child called lights out. The game was rather simple all you had to do was turn off all the lights to progress to the next level. Currently the game is a work in progress and has a few minor bugs (don’t try to turn on all the lights) but it is playable. Please let me know if you find any bugs or just want to make some comments on improvements. Also you can view the source on my github account.