package com.curtismckinney.websiteMain; import com.curtismckinney.map.WebsiteMap; import com.curtismckinney.sound.MusicPlayer; import com.coleingraham.lag.*; import org.jbox2d.common.*; import processing.core.*; public class TentacleWebsite extends PApplet implements PConstants{ /** The width of the video. May not be the same size as the screen's physical width. * */ private int wth = 800;//(int)(screen.width); /**The height of the video. May not be same size as the screen physical height. * */ private int ht = 600;//(int)(screen.height); /** Instance of the LAGlib class. * */ public LAGlib laglib; /** Version number. * */ private static final long serialVersionUID = 1L; /** The AudioContext for all audio...context... * */ //public AudioContext ac; /**Music Player handles playing the music..... * */ public MusicPlayer musicPlayer; private int bgstart = 0; /** The main method. Do not touch unless you need to for some reason. * * @param args */ public static void main(String args[]) { PApplet.main(new String[] { "--present","--hide-stop", "com.curtismckinney.websiteMain.TentacleWebsite" }); } /** The setup method like in processing. * */ public void setup() { size(800,600,OPENGL); background(0); //hint(ENABLE_OPENGL_4X_SMOOTH); frameRate(90); laglib = new LAGlib(this); laglib.setVideoSize(new Vec2(wth,ht)); laglib.setCurrentMap((AreaMap) new WebsiteMap(this,"WebsiteMap",laglib)); //noSmooth(); musicPlayer = new MusicPlayer(this,(WebsiteMap)laglib.getCurrentMap()); musicPlayer.playBGMusic(); } /** The draw method like in processing. * */ public void draw() { background(0); if(!laglib.getCurrentMap().isPaused()){ laglib.getCurrentMap().update(); } laglib.getCurrentMap().display(); if(bgstart == 0) { bgstart = 1; } } /** The keyPressed method like in processing. * */ public void keyPressed() { } /** The keyReleased method like in processing. * */ public void keyReleased() { } public void mousePressed() { ((WebsiteMap) laglib.getCurrentMap()).mouseAction(); } public void mouseReleased() { ((WebsiteMap) laglib.getCurrentMap()).mouseReleased(); } public void stop() { musicPlayer.bgMusic.stopTrack(); } }