Giter Club home page Giter Club logo

spaceranger2's Introduction

SpaceRanger2

spaceranger2's People

Contributors

hpopov avatar

spaceranger2's Issues

abstract class Bounds! Or interface?...

public Bounds unite(Bounds anotherBounds)
You have to developed this idea and maybe include some abilities and transformations to/from javafx.geometry.Bounds.

Also there must be RectangularBounds, CircleBounds and maybe some other subclasses.

SpriteAnimation class

Must provide next API:
public SpriteAnimation() {
images = null;
currentImg = -1;
imageCount = 0;
window = new ImageView();
}

public SpriteAnimation(Image[] images) {
	setImages(images);
	window = new ImageView();		
}

public void setImages(Image[] images) {
	this.images = images;
	imageCount = images.length;
	currentImg = imageCount/2;		
}

public SpriteAnimation(Image[] images, int initialImg) {
	this.images = images;
	imageCount = images.length;
	currentImg = initialImg;
	window = new ImageView();
}

public void bindToParent(Pane parent) {
	parent.getChildren().add(window);
}

public boolean removeFromParent(Pane parent) {
	return parent.getChildren().remove(window);
}

public void setWindowPosition(Vector position) {
	window.setX(position.x);
	window.setY(position.y);
}

public void flipForward() {
	currentImg++;
	if (currentImg == imageCount) {
		currentImg = 0;
	}
}

public void flipBack() {
	currentImg--;
	if (currentImg < 0) {
		currentImg = imageCount-1;
	}
}

public int getFlipCount() {
	return images.length;
}

public boolean isFirstFlip() {
	return currentImg == 0;
}

public boolean isLastFlip() {
	return currentImg == imageCount-1;
}

public boolean isCentralFlip() {
	return currentImg == imageCount/2;
}

public void redraw() {
	window.setImage(images[currentImg]);
}

public double getWidth();

public double getHeight();

Static ResourceBuilder

Make a ResourceBuilder class, each resource it can return must be a private static field and build it as singletone

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.