From e23c7f479dd816f1be431431f1dedcd1cd547e66 Mon Sep 17 00:00:00 2001 From: kvetzal Date: Thu, 10 Apr 2014 12:55:28 -0400 Subject: [PATCH] Update lajik.pde Integrated Intro screen and credits --- lajik/lajik.pde | 349 ++++++++++++++++++++++++++++++++++-------------- 1 file changed, 250 insertions(+), 99 deletions(-) diff --git a/lajik/lajik.pde b/lajik/lajik.pde index f5990ca..2c1cf3b 100644 --- a/lajik/lajik.pde +++ b/lajik/lajik.pde @@ -1,15 +1,20 @@ import fisica.*; +//intro screen libraries +import punktiert.math.Vec; +import punktiert.physics.*; + //A couple states planned to be in use. //We are going to have a change state method, that will run the start and exit state methods automatically. -int STATE_GAME = 1; -int STATE_LEVEL_EDITOR = 2; -int STATE_INTRO = 3; +final int STATE_INTRO = 0; +final int STATE_GAME = 1; +final int STATE_LEVEL_EDITOR = 2; +final int STATE_CREDITS = 3; //so, change this to 3 once intro state is done. //each state should be stored in a method and whenever this is changed, a state should be capable //of completely pausing. -int current_state = 1; +int current_state = 0; float realFrameRate = 400; //float frameCount; @@ -33,104 +38,14 @@ ParticleSystem ps; void setup() { size(1024, 768); smooth(); + + introScreenSetup(); + Fisica.init(this); - - ps = new ParticleSystem(100, 1, 8, 8, 1, 1); - - - world = new FWorld(); - world.setGravity(0, 40); - - myLevel = new Level(); - - - world.setEdges(-1024, -768, 2048, 1536); - - //InitPlayerModel - playerModel = new FBox(40, 40); - - //Setup playermodel - playerModel.setBullet(true); - playerModel.setNoStroke(); - playerModel.setFill(255, 255, 255); - playerModel.setPosition(width/2, height/2); - playerModel.setFriction(0.01); - playerModel.setDensity(2.0); - playerModel.setRestitution(0.0); - - //starter platform - groundTest = new FBox(width, 50); - groundTest.setFillColor(#303030); - groundTest.setFriction(0.1); - groundTest.setStatic(true); - groundTest.setPosition(width/2, height-50); - - myLevel.static_objects.add(groundTest); - - //starter platform bottom and sides. - groundTest = new FBox(width+2, 50+1); - groundTest.setFriction(0.1); - groundTest.setStatic(true); - groundTest.setPosition(width/2, height-50+2); - groundTest.setFill(0, 0, 0, 0); - groundTest.setNoStroke(); - myLevel.static_objects_walls.add(groundTest); - - groundTest = new FBox(3072, 25); - groundTest.setFillColor(#303030); - groundTest.setFriction(0.1); - groundTest.setStatic(true); - groundTest.setPosition(512, 1501); - - myLevel.static_objects.add(groundTest); - - /*groundTest = new FBox(30, 500); - groundTest.setFillColor(#303030); - groundTest.setFriction(0.1); - groundTest.setStatic(true); - groundTest.setPosition(15, 993); - - myLevel.static_objects_walls.add(groundTest);*/ - - //create the steps - - for (int i = 0;i < 4;i++) { - groundTest = new FBox(100, 10); - groundTest.setFillColor(#303030); - groundTest.setFriction(0.1); - groundTest.setStatic(true); - groundTest.setPosition(-150-205*i, 900+185*i); - - myLevel.static_objects.add(groundTest); - - groundTest = new FBox(104, 11); - groundTest.setFriction(0.1); - groundTest.setStatic(true); - groundTest.setPosition(-150-205*i, 900+185*i+2); - //groundTest.setStroke(255,0,0); - groundTest.setFill(0, 0, 0, 0); - groundTest.setNoStroke(); - myLevel.static_objects_walls.add(groundTest); - } - - for (int i=0;i