workings
|
@ -1,3 +1,3 @@
|
|||
{ projects
|
||||
string test
|
||||
string new scene stuff makings
|
||||
}
|
||||
|
|
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 156 B After Width: | Height: | Size: 156 B |
Before Width: | Height: | Size: 173 B After Width: | Height: | Size: 173 B |
Before Width: | Height: | Size: 170 B After Width: | Height: | Size: 170 B |
Before Width: | Height: | Size: 163 B After Width: | Height: | Size: 163 B |
Before Width: | Height: | Size: 376 B After Width: | Height: | Size: 376 B |
Before Width: | Height: | Size: 403 B After Width: | Height: | Size: 403 B |
Before Width: | Height: | Size: 397 B After Width: | Height: | Size: 397 B |
Before Width: | Height: | Size: 361 B After Width: | Height: | Size: 361 B |
Before Width: | Height: | Size: 432 B After Width: | Height: | Size: 432 B |
Before Width: | Height: | Size: 459 B After Width: | Height: | Size: 459 B |
Before Width: | Height: | Size: 333 B After Width: | Height: | Size: 333 B |
Before Width: | Height: | Size: 588 KiB After Width: | Height: | Size: 588 KiB |
Before Width: | Height: | Size: 486 B After Width: | Height: | Size: 486 B |
Before Width: | Height: | Size: 333 B After Width: | Height: | Size: 333 B |
Before Width: | Height: | Size: 444 B After Width: | Height: | Size: 444 B |
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 333 B After Width: | Height: | Size: 333 B |
|
@ -8,8 +8,8 @@ int 255
|
|||
}
|
||||
{ entities
|
||||
string boxcoll
|
||||
double -200.0
|
||||
double 0.0
|
||||
double -200
|
||||
double 0
|
||||
boolean true
|
||||
int 100
|
||||
int 100
|
||||
|
@ -17,18 +17,18 @@ int 0
|
|||
int 255
|
||||
int 0
|
||||
string plrstart
|
||||
double -300.0
|
||||
double 0.0
|
||||
double -300
|
||||
double 0
|
||||
boolean false
|
||||
string inviscoll
|
||||
double -200.0
|
||||
double 100.0
|
||||
double -200
|
||||
double 100
|
||||
boolean true
|
||||
int 100
|
||||
int 100
|
||||
string boxnocoll
|
||||
double -200.0
|
||||
double -100.0
|
||||
double -200
|
||||
double -100
|
||||
boolean false
|
||||
int 100
|
||||
int 100
|
||||
|
@ -36,8 +36,8 @@ int 255
|
|||
int 0
|
||||
int 0
|
||||
string light
|
||||
double -200.0
|
||||
double 200.0
|
||||
double -200
|
||||
double 200
|
||||
boolean false
|
||||
int 100
|
||||
}
|
|
@ -102,6 +102,7 @@ public class MainPanel extends JPanel {
|
|||
if(key == KeyEvent.VK_F11){
|
||||
Trident.fullscreen = !Trident.fullscreen;
|
||||
Main.window = BTools.getWindowFullscreen(Main.window, Trident.fullscreen, panel);
|
||||
Update.tridentEvent(Trident.EVENT_FULLSCREEN);
|
||||
return;
|
||||
}
|
||||
if(!inIntro){
|
|
@ -54,7 +54,7 @@ public class Trident {
|
|||
protected static String newSprite = null;
|
||||
|
||||
// Trident events
|
||||
public static final int EVENT_SCREENSHOT = 0;
|
||||
public static final int EVENT_SCREENSHOT = 0, EVENT_FULLSCREEN = 1;
|
||||
|
||||
|
||||
// Setting methods
|
|
@ -102,6 +102,7 @@ public class MainPanel extends JPanel {
|
|||
if(key == KeyEvent.VK_F11){
|
||||
Trident.fullscreen = !Trident.fullscreen;
|
||||
Main.window = BTools.getWindowFullscreen(Main.window, Trident.fullscreen, panel);
|
||||
Update.tridentEvent(Trident.EVENT_FULLSCREEN);
|
||||
return;
|
||||
}
|
||||
if(!inIntro){
|
||||
|
|
|
@ -54,7 +54,7 @@ public class Trident {
|
|||
protected static String newSprite = null;
|
||||
|
||||
// Trident events
|
||||
public static final int EVENT_SCREENSHOT = 0;
|
||||
public static final int EVENT_SCREENSHOT = 0, EVENT_FULLSCREEN = 1;
|
||||
|
||||
|
||||
// Setting methods
|
||||
|
|
|
@ -3,7 +3,7 @@ package trident;
|
|||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
public class Main{
|
||||
protected static JFrame window = new JFrame("3D Trident Project");
|
||||
public static JFrame window = new JFrame("3D Trident Project");
|
||||
public static void main(String[] args){
|
||||
window.setSize(700, 500);
|
||||
window.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
||||
|
|
|
@ -14,7 +14,7 @@ public class MainPanel extends JPanel {
|
|||
|
||||
protected FrameManager frameManager = new FrameManager();
|
||||
public static Server server;
|
||||
protected KeyManager km = new InputListener(this);
|
||||
public KeyManager km = new InputListener(this);
|
||||
private Animator introAnim;
|
||||
public static Position introPos = new Position();
|
||||
public static ImageIcon splash = new ImageIcon("data/images/trident/splash.png");
|
||||
|
@ -23,6 +23,8 @@ public class MainPanel extends JPanel {
|
|||
|
||||
public MainPanel(){
|
||||
|
||||
Trident.panel = this;
|
||||
|
||||
System.setProperty("sun.java2d.opengl", "true"); // hardware acceleration?
|
||||
|
||||
setBackground(Color.black);
|
||||
|
@ -102,6 +104,7 @@ public class MainPanel extends JPanel {
|
|||
if(key == KeyEvent.VK_F11){
|
||||
Trident.fullscreen = !Trident.fullscreen;
|
||||
Main.window = BTools.getWindowFullscreen(Main.window, Trident.fullscreen, panel);
|
||||
Update.tridentEvent(Trident.EVENT_FULLSCREEN);
|
||||
return;
|
||||
}
|
||||
if(!inIntro){
|
||||
|
|
|
@ -36,6 +36,8 @@ public class Trident {
|
|||
public static boolean drawPlayer = true;
|
||||
public static Position mouseWorldPos = new Position();
|
||||
public static boolean enableBloom = true, enableExposure = true;
|
||||
public static boolean captureCursor = false;
|
||||
public static MainPanel panel = null;
|
||||
|
||||
|
||||
// Trident Variables
|
||||
|
@ -56,7 +58,7 @@ public class Trident {
|
|||
protected static String newSprite = null;
|
||||
|
||||
// Trident events
|
||||
public static final int EVENT_SCREENSHOT = 0;
|
||||
public static final int EVENT_SCREENSHOT = 0, EVENT_FULLSCREEN = 1;
|
||||
|
||||
|
||||
// Setting methods
|
||||
|
|
|
@ -35,13 +35,16 @@ public class Inputs {
|
|||
}
|
||||
}
|
||||
}
|
||||
if(key == KeyEvent.VK_ESCAPE){
|
||||
Trident.captureCursor = false;
|
||||
}
|
||||
// if(key == KeyEvent.VK_DOWN) Rend3D.offset++;
|
||||
// if(key == KeyEvent.VK_UP) Rend3D.offset--;
|
||||
}
|
||||
}
|
||||
|
||||
public static void mousePressed(int mb, Point mousePos, Position worldPos){
|
||||
|
||||
Trident.captureCursor = true;
|
||||
}
|
||||
|
||||
public static void onScroll(int scroll){
|
||||
|
|
|
@ -4,6 +4,7 @@ import trident.*;
|
|||
import trident.ent.*;
|
||||
import ent.*;
|
||||
import java.util.ArrayList;
|
||||
|
||||
import blib.b3d.*;
|
||||
import blib.game.*;
|
||||
import blib.util.*;
|
||||
|
@ -79,15 +80,51 @@ public class Update {
|
|||
|
||||
public static void update(long elapsedTime){
|
||||
if(Rend3D.enabled){
|
||||
int mouseDelta = 0;
|
||||
if(Trident.captureCursor){
|
||||
int startX = Trident.panel.km.getMousePos().x;
|
||||
Point p = new Point(Main.window.getWidth() / 2 + Main.window.getX(), Main.window.getHeight() / 2 + Main.window.getY());
|
||||
mouseDelta = startX - Main.window.getWidth() / 2;
|
||||
if(!Trident.getFullscreen()) mouseDelta += 8;
|
||||
GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
|
||||
GraphicsDevice[] gs = ge.getScreenDevices();
|
||||
|
||||
// Search the devices for the one that draws the specified point.
|
||||
for (GraphicsDevice device: gs) {
|
||||
GraphicsConfiguration[] configurations =
|
||||
device.getConfigurations();
|
||||
|
||||
|
||||
boolean gtfo = false;
|
||||
for (GraphicsConfiguration config: configurations) {
|
||||
Rectangle bounds = config.getBounds();
|
||||
if(bounds.contains(p)) {
|
||||
// Set point to screen coordinates.
|
||||
|
||||
try {
|
||||
Robot r = new Robot(device);
|
||||
r.mouseMove(p.x, p.y);
|
||||
} catch (AWTException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
gtfo = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if(gtfo) break;
|
||||
}
|
||||
|
||||
Trident.panel.setCursor(BTools.getBlankCursor());
|
||||
}else{
|
||||
Trident.panel.setCursor(Cursor.getDefaultCursor());
|
||||
}
|
||||
|
||||
Trident.setPlrSpeed(0);
|
||||
if(HUD.currentDialog == null){ // only move when there's no dialog
|
||||
if(Trident.getKeyDown(KeyEvent.VK_LEFT)){
|
||||
WallManager.camera.direction -= Math.toRadians(0.1) * elapsedTime;
|
||||
}
|
||||
if(Trident.getKeyDown(KeyEvent.VK_RIGHT)){
|
||||
WallManager.camera.direction += Math.toRadians(0.1) * elapsedTime;
|
||||
}
|
||||
|
||||
if(Trident.captureCursor) WallManager.camera.direction += Math.toRadians(mouseDelta * 0.007) * elapsedTime;
|
||||
|
||||
Position startPos = Trident.getPlrPos().copy();
|
||||
Point move = new Point();
|
||||
|
|