mirror of
https://gitlab.com/2009scape/rt4-client.git
synced 2025-12-13 18:10:20 -07:00
Begin basic playground code, eventually will become a model viewer
This commit is contained in:
parent
153d8569b5
commit
8fb5b3fc75
10 changed files with 121 additions and 34 deletions
56
playground/src/main/java/com/itspazaz/rt4/Playground.java
Normal file
56
playground/src/main/java/com/itspazaz/rt4/Playground.java
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
package com.itspazaz.rt4;
|
||||
|
||||
import rt4.*;
|
||||
|
||||
public class Playground extends GameShell {
|
||||
public static Playground instance;
|
||||
|
||||
public static void main(String[] args) {
|
||||
instance = new Playground();
|
||||
instance.startApplication(32, "runescape");
|
||||
GameShell.frame.setLocation(40, 40);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init() {
|
||||
instance = this;
|
||||
this.startApplet(32);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void mainInit() {
|
||||
Keyboard.init();
|
||||
Keyboard.start(GameShell.canvas);
|
||||
Mouse.start(GameShell.canvas);
|
||||
SoftwareRaster.frameBuffer.makeTarget();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void mainLoop() {
|
||||
Keyboard.loop();
|
||||
Mouse.loop();
|
||||
|
||||
GameShell.frame.setTitle(Keyboard.pressedKeys[Keyboard.KEY_CTRL] ? "pressed" : "not pressed");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void mainRedraw() {
|
||||
SoftwareRaster.clear();
|
||||
|
||||
SoftwareRaster.drawRect(50, 50, 100, 100, 0xFF00FF);
|
||||
|
||||
SoftwareRaster.frameBuffer.draw(GameShell.canvas.getGraphics());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void mainQuit() {
|
||||
Keyboard.stop(GameShell.canvas);
|
||||
Mouse.stop(GameShell.canvas);
|
||||
Keyboard.quit();
|
||||
Mouse.quit();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void reset() {
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue