Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Math = luajava.bindClass("java.lang.Math")
- function onCreate()
- -- properties
- world.MAX_X = 100
- world.MAX_Y = 100
- world.freeEnergy = 100
- world.viscosity = 100
- world.BrownianCutoff = 0
- world.unlimitedEnergy = true;
- -- lights
- -- genome
- --stage:setSensitivityValues({0, 25, 50, 75, 100})
- stage:setSensitivityValues({0, 10, 75})
- stage.showHPBar = false
- stage:setShowDegradationValues(false)
- stage:setShowSensitivityValues(false)
- stage:setShowCostOnIcon(false)
- stage:setShowDegradationOnIcon(false)
- local genome = luajava.newInstance("com.sgstudio.genebox.blogic.Genome")
- genome.maxPopulationDivide = 1
- genome.color:set(0, 0.5, 0.5, 1)
- genome.shape = "hedgehog"
- world:setGenome(genome)
- local Gene = luajava.bindClass("com.sgstudio.genebox.blogic.genes.Gene")
- local GeneType = luajava.bindClass("com.sgstudio.genebox.blogic.genes.Gene$TYPE")
- housekeepingGene = Gene:createGeneByType(GeneType.HOUSEKEEPING)
- housekeepingGene:setPosition(100, 100)
- housekeepingGene.defaultProteins = 50
- housekeepingGene.controlled = false
- genome:addGene(housekeepingGene)
- growthGene = Gene:createGeneByType(GeneType.GROWTH)
- growthGene:setPosition(300, 100)
- growthGene.defaultProteins = 100
- growthGene.isRegulator = false
- genome:addGene(growthGene)
- housekeepingGene.deletable=false
- growthGene.deletable=false
- housekeepingGene:addRegulator(housekeepingGene, 200);
- --Solution
- --growthGene:addRegulator(housekeepingGene, 10);
- -- microbes
- Microbe1 = world:addMicrobeToGroup(genome, 50, 50);
- -- available genes
- world:addAvailableGene(GeneType.NONE)
- -- win conditions
- timer = 100
- hint = 0
- --[[stage:showHintWindow({"text:CLICK_DIAGRAM,align:right,highlight:true,actorName:playButton",
- "text:CLICK_DIAGRAM,align:left,arrowAlign:right,actorName:mainMenuButton",
- "text:CLICK_DIAGRAM,align:left,arrowAlign:left,highlight:true,actorName:diagramButton",
- "text:CLICK_DIAGRAM,align:left,arrowAlign:bottomLeft,highlight:true,actorName:diagramButton",
- "text:CLICK_DIAGRAM,align:topRight,actorName:diagramButton",
- "text:LEVEL1_HINT_1,image:hints/Lvl1Fig1.png,imageSize:200",
- "text:LEVEL1_HINT_2,image:hints/Lvl1Fig2.png,imageSize:50",
- "text:LEVEL1_HINT_3,image:hints/Lvl1Fig3.png,imageSize:100",
- "text:LEVEL1_HINT_4,image:hints/Lvl1Fig4.png,imageSize:50",
- "text:LEVEL1_HINT_5,image:hints/Lvl1Fig5.png,imageSize:150"})
- stage:showHintWindow({"text:WELCOME_HINT,image:hints/Lvl1Fig1.png,imageSize:200,stageBackground:true",
- "text:GROWTH_OBJECTIVE,image:hints/Lvl1Fig1.png,imageSize:200,stageBackground:true",
- "text:CLICK_ON_DIAGRAM,align:right,arrowAlign:bottom,highlight:true,actorName:diagramButton,waitFor:diagramWindow,width:200,pad:100",
- "text:GENES_FIRST_HINT, align:bottomRight,arrowAlign:right, actorName:geneTableHousekeeping, width:200",
- "text:CLICK_ON_GENE, align:bottomRight, arrowAlign:right, actorName:geneTableHousekeeping, waitFor:geneControlWindow,width:400",
- "text:DRAG_IT,align:topRight,arrowAlign:top,actorName:dependencyButton,moveTo:geneTableGrowth,hideClose:true"})
- ]]
- stage:showHintWindow({"text:WELCOME_HINT,image:hints/Lvl1Fig1.png,imageSize:200,stageBackground:true",
- "text:GROWTH_OBJECTIVE,image:hints/Lvl1Fig2.png,imageSize:200,stageBackground:true",
- "text:CLICK_ON_DIAGRAM,align:right,arrowAlign:bottom,highlight:true,actorName:diagramButton,waitFor:diagramWindow,width:200,pad:100",
- "text:GENES_FIRST_HINT,align:right,width:450",
- "text:GENES_SECOND_HINT,image:hints/Lvl1Fig3.png,imageSize:150,align:right,width:450",
- "text:GENES_THIRD_HINT,image:hints/Lvl1Fig4.png,imageSize:200,align:right,width:500",
- "text:GENES_FOURTH_HINT,image:hints/Lvl1Fig5.png,imageSize:200,align:right,width:400",
- "text:GENES_FIFTH_HINT,image:hints/Lvl1Fig6.png,imageSize:200,align:right,width:400",
- "text:GENES_SIXTH_HINT,image:hints/Lvl1Fig7.png,imageSize:300,align:right,width:400",
- "text:CLICK_ON_GENE,align:bottomRight,arrowAlign:right,actorName:geneTableHousekeeping,waitFor:geneControlWindow,width:300",
- "text:DRAG_IT,align:topRight,arrowAlign:top,actorName:dependencyButton,moveTo:geneTableGrowth,hideClose:true"})
- end
- function onCheck(delta)
- local cnt = world.microbes:get(world:getGenome()):size()
- --energyZones[5].enabled = world.time < 50
- if Microbe1.size >= 8 then stage:finish(true) end
- if timer < stage:getTime() or cnt == 0 then
- stage:finish(1 == cnt)
- end
- stage:setTimer(timer - stage:getTime())
- stage:setMicrobeCount(Microbe1.size, 8, "gene_growth")
- end
- function onAct()
- if hint == 0 and stage.gameUIStage:getRoot():findActor("sensitivityWindow") ~= nil and
- stage.gameUIStage:getRoot():findActor("sensitivityWindow"):isVisible() then
- hint = 1
- stage:showHintWindow("text:MOVE_TO_2_ARROWS,align:topRight,hideClose:true,actorName:sensitivityWindow,moveBy:0x60,arrowOffset:0x-60,arrowAlign:right")
- --[[stage.gameUIStage.hintWindow:setCheckListener(luajava.createProxy('com.badlogic.gdx.scenes.scene2d.EventListener', {
- handle = function()
- local hasMore50 = growthGene.regulatedBy:get(0).sensitivity > 50
- if hasMore50 then
- stage:showHintWindow("text:CLOSE_DIAGRAM_AND_SEE,align:bottomLeft,arrowAlign:bottom,actorName:diagramButton,waitFor:!diagramWindow")
- stage.gameUIStage.hintWindow:setOnCloseListener(luajava.createProxy('com.badlogic.gdx.scenes.scene2d.EventListener', {
- handle = function(e)
- stage:setSpeed(1)
- end
- }))
- end
- return hasMore50
- end
- }))]]
- end
- if hint == 1 and growthGene.regulatedBy:get(0).sensitivity >= 50 then
- hint = 2
- stage:showHintWindow({"text:CLOSE_DIAGRAM,align:bottomLeft,arrowAlign:bottom,actorName:diagramButton,waitFor:!diagramWindow",
- "text:TAP_ON_MICROBE,align:bottom,arrowAlign:top,waitFor:microbeInfoTable",
- "text:CLICK_HERE_TO_ENABLE_GRAPH,align:top,arrowAlign:top,actorName:geneTableGrowthForGraph,hideClose:true",
- "text:SEE_THE_GOAL,align:left,arrowAlign:bottom,actorName:statusProgressBar"})
- end
- if hint == 2 and stage.gameUIStage.gameUI.infoTable:isVisible(growthGene) then
- stage:showHintWindow("text:CLICK_ON_PLAY,align:left,arrowAlign:bottom,actorName:playButton,hideClose:true")
- hint = 3
- end
- if stage.speed > 0 and hint == 3 then
- stage:closeHintWindow()
- hint = 4
- end
- --[[if hint == 4 and stage:getTime()>10 then
- hint = 5
- stage:showHintWindow("text:LEVEL1_HINT_10,image:hints/Lvl1Fig10.png,imageSize:200")
- end
- if hint == 3 and (stage.gameUIStage.gameUI.infoTable:showGraph(housekeepingGene) or stage.gameUIStage.gameUI.infoTable:showGraph(growthGene)) then
- hint = 4
- stage:showHintWindow("text:LEVEL1_HINT_9,image:hints/Lvl1Fig9.png,imageSize:100")
- end
- --Here we need to learn if the mocrobe window is ON (instead 1==1)
- if hint == 2 and stage.gameUIStage.gameUI.infoTable:isVisible() then
- hint = 3
- stage:showHintWindow("text:LEVEL1_HINT_8,image:hints/Lvl1Fig8.png,imageSize:100")
- end
- if hint == 1 and growthGene.regulatedBy:size() > 0 then
- if growthGene.regulatedBy:get(0).sensitivity > 50 then
- hint = 2
- stage:showHintWindow("text:LEVEL1_HINT_7,image:hints/Lvl1Fig7.png,imageSize:0")
- end
- end
- if hint == 0 and growthGene.regulatedBy:size() > 0 then
- hint = 1
- stage:showHintWindow("text:LEVEL1_HINT_6,image:hints/Lvl1Fig6.png,imageSize:200")
- end]]
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement