Transaction 16fc673afa79a9871fb1e42ff9b1712b242a571baf39da866b2aed85686018ca
1 Input
-
2a4d5d7b518a1f9032ef1388957655a312f0c8ce01787026a2436b269df6676c:0
OP_DATA_32(32) bf9bdca32861d09680feefe455104011b2762ab79e7e56d48719819929d19891OP_CHECKSIG(172)OP_0(0)OP_IF(99)OP_DATA_3(3) ordOP_DATA_1(1)OP_DATA_9(9) text/htmlOP_0(0)OP_PUSHDATA2(77) <!doctypehtml><html lang=en><meta charset=UTF-8><meta content="width=device-width,initial-scale=1"name=viewport><title>Ecosystem Simulation</title><script src=https://ordinals.com/content/7e37766541506810ba6399c4b2735121f508bd9209df43dd200bf2316b014594i0></script><style>body,html{margin:0;padding:0;display:flex;flex-direction:column;align-items:center;height:100vh;background-color:#161322;overflow:hidden}#game-container{position:relative}#environment-stats{position:absolute;top:10px;right:10px;padding:10px;border-rOP_PUSHDATA2(77) adius:5px}.stat-bar{height:10px;margin-bottom:5px}#ui-container{position:absolute;top:10px;left:10px;padding:10px;border-radius:5px}#object-preview{margin-top:10px}#toggle-rain{position:absolute;bottom:10px;left:10px}#debug-controls{margin-top:10px}#debug-controls button{margin-right:5px}.element-class-name{max-width:100%;width:100%;height:auto}</style><div id=game-container><div id=environment-stats></div><button id=toggle-rain>Disable Rain</button></div><script src=https://ordinals.com/content/91e90246c9e7e059165OP_PUSHDATA2(77) 39edcaf45088fd3a9d3ce8edb9d0a2fc379f879cf2342i0></script><script>let environment={sunlight:100,water:50,nutrients:100,temperature:50};const MAX_WATER=100;const MAX_NUTRIENTS=100;const EVAPORATION_RATE=0.1;const PRECIPITATION_CHANCE=0.05;const PLANT_GROWTH_CHANCE=0.02;const MIN_NUTRIENTS_FOR_GROWTH=30;const MAX_ENVIRONMENT_OBJECTS=15;const MAX_TREES=0;let audioContext;let waterDroplets=[];let plants=[];let herbivores=[];let carnivores=[];let decomposers=[];let isRainEnabled=!0;let isGameOver=!1;let groundLevel;let sOP_PUSHDATA2(77) electedObject='plant';let days=0;let score=0;let lastScoreTime=0;let environmentObjects=[];let flowerVines=[];let fairies=[];let bugs=[];function setup(){let canvasWidth=min(windowWidth,600);let canvasHeight=canvasWidth*(2/3);createCanvas(canvasWidth,canvasHeight);groundLevel=height*0.8;updateEnvironmentBars();setupUI();let rainToggleBtn=select('#toggle-rain');rainToggleBtn.mousePressed(toggleRain);Carnivore.baseSpeed=0.2;resetEcosystem();createAnimalButtons();textFont('Courier');textSize(10)} function windowResizOP_PUSHDATA2(77) ed(){let canvasWidth=min(windowWidth,600);let canvasHeight=canvasWidth*(2/3);resizeCanvas(canvasWidth,canvasHeight);groundLevel=height*0.8} function createAnimalButtons(){let herbivoreButton=createButton('');herbivoreButton.position(10,height-60);herbivoreButton.size(50,50);herbivoreButton.mousePressed(()=>selectedObject='herbivore');herbivoreButton.style('background','transparent');herbivoreButton.style('border','none');let carnivoreButton=createButton('');carnivoreButton.position(70,height-60);carnivoreButton.siOP_PUSHDATA2(77) ze(50,50);carnivoreButton.mousePressed(()=>selectedObject='carnivore');carnivoreButton.style('background','transparent');carnivoreButton.style('border','none')} function draw(){if(isGameOver){drawGameOverScreen();return} updateEnvironment();drawEnvironment();updateWaterDroplets();drawWaterDroplets();updateAndDrawEnvironmentObjects();updateAndDrawFlowerVines();updateAndDrawPlants();updateAndDrawHerbivores();updateAndDrawCarnivores();updateAndDrawDecomposers();updateAndDrawFairies();updateAndDrawBugs();spontaneousPOP_PUSHDATA2(77) lantGrowth();spontaneousEnvironmentGrowth();updateEnvironmentBars();updateDayCount();updateScore();displayStats();drawAnimalButtons();drawLifeText();checkGameOver()} function drawAnimalButtons(){let buttonSize=50;let buttonSpacing=60;let startX=10;let startY=height-60;function drawButton(x,y,animalType,isSelected){push();rectMode(CENTER);fill(0,0,0,0);stroke(isSelected?color(255,255,0):color(0));strokeWeight(2);rect(x+buttonSize/2,y+buttonSize/2,buttonSize,buttonSize);stroke(0);strokeWeight(2);line(x+buttonSize/2,OP_PUSHDATA2(77) y+10,x+buttonSize/2,y+20);line(x+buttonSize/2-5,y+15,x+buttonSize/2+5,y+15);translate(x+buttonSize/2,y+buttonSize/2+5);scale(0.8);if(animalType==='herbivore'){drawStaticHerbivore(-4,0)}else{drawStaticCarnivore(-4,0)} pop()} drawButton(startX,startY,'herbivore',selectedObject==='herbivore');drawButton(startX+buttonSpacing,startY,'carnivore',selectedObject==='carnivore')} function drawStaticHerbivore(x,y){push();translate(x,y);noStroke();fill(255,105,180);for(let i=0;i<5;i++){for(let j=0;j<5;j++){rect(i*2,j*2,2,2)OP_PUSHDATA2(77) }} for(let i=0;i<3;i++){for(let j=0;j<3;j++){rect(10+i*2,2+j*2,2,2)}} fill(0,255,255);rect(12,4,2,2);fill(255,105,180);rect(0,10,2,4);rect(8,10,2,4);pop()} function drawStaticCarnivore(x,y){push();translate(x,y);noStroke();fill(255,0,0);for(let i=0;i<7;i++){for(let j=0;j<7;j++){rect(i*2,j*2,2,2)}} for(let i=0;i<4;i++){for(let j=0;j<4;j++){rect(14+i*2,2+j*2,2,2)}} fill(255,255,0);rect(18,4,2,2);fill(255,0,0);rect(2,14,2,4);rect(10,14,2,4);pop()} function drawLifeText(){push();textAlign(CENTER,CENTER);textSize(OP_PUSHDATA2(77) 24);fill(0);text("LIFE.",width/2,height-30);pop()} function updateEnvironment(){environment.sunlight=map(sin(frameCount*0.01),-1,1,20,100);environment.temperature+=random(-1,1);environment.temperature=constrain(environment.temperature,0,100);let evaporation=EVAPORATION_RATE*(environment.temperature/100);environment.water=max(0,environment.water-evaporation);if(isRainEnabled&&random(1)<PRECIPITATION_CHANCE){let rainfall=random(5,10);environment.water=min(MAX_WATER,environment.water+rainfall);for(let i=0;i<rainfall;OP_PUSHDATA2(77) i++){waterDroplets.push(createVector(random(width),random(-20,0)))}} if(plants.length>0){environment.nutrients-=0.05*plants.length} environment.nutrients=constrain(environment.nutrients,0,MAX_NUTRIENTS)} function drawEnvironment(){let nightColor=color(25,25,112);let dayColor=color(135,206,235);let skyColor=lerpColor(nightColor,dayColor,environment.sunlight/100);background(skyColor);fill(34,139,34);rect(0,groundLevel,width,height-groundLevel);if(environment.sunlight<50){drawStars()}} function drawStars(){fill(25OP_PUSHDATA2(77) 5,255,255);for(let i=0;i<50;i++){let x=random(width);let y=random(groundLevel);rect(x,y,1,1)}} function updateWaterDroplets(){for(let i=waterDroplets.length-1;i>=0;i--){waterDroplets[i].y+=2;if(waterDroplets[i].y>groundLevel){waterDroplets.splice(i,1)}}} function drawWaterDroplets(){fill(0,100,255);noStroke();for(let droplet of waterDroplets){rect(droplet.x,droplet.y,2,2)}} function updateAndDrawPlants(){for(let i=plants.length-1;i>=0;i--){plants[i].grow();plants[i].display();if(plants[i].health<=0){environment.OP_PUSHDATA2(77) nutrients+=plants[i].size*0.5;environment.nutrients=min(environment.nutrients,MAX_NUTRIENTS);plants.splice(i,1)}}} function updateAndDrawHerbivores(){for(let i=herbivores.length-1;i>=0;i--){let result=herbivores[i].update(plants,herbivores);if(result==='dead'){playRemoveSound();decomposers.push(new Decomposer(herbivores[i].x,groundLevel));herbivores.splice(i,1)}else if(result instanceof Herbivore){playReproduceSound();herbivores.push(result)}else{if(herbivores[i].eat(plants)){playEatSound()} herbivores[i].displayOP_PUSHDATA2(77) ()}}} function updateAndDrawCarnivores(){for(let i=carnivores.length-1;i>=0;i--){let result=carnivores[i].update(herbivores,carnivores);if(result==='dead'){playRemoveSound();decomposers.push(new Decomposer(carnivores[i].x,groundLevel));carnivores.splice(i,1)}else if(result instanceof Carnivore){playReproduceSound();carnivores.push(result)}else{let eatenHerbivore=carnivores[i].eat(herbivores);if(eatenHerbivore){playEatSound();decomposers.push(new Decomposer(eatenHerbivore.x,groundLevel))} carnivores[i].display()}}OP_PUSHDATA2(77) } function updateAndDrawDecomposers(){for(let i=decomposers.length-1;i>=0;i--){decomposers[i].grow();decomposers[i].display();if(decomposers[i].isDead()){decomposers.splice(i,1)}}} function spontaneousPlantGrowth(){if(environment.nutrients>MIN_NUTRIENTS_FOR_GROWTH&&random()<PLANT_GROWTH_CHANCE){let x=random(width);plants.push(new Plant(x,groundLevel));environment.nutrients-=5;environment.nutrients=max(0,environment.nutrients)}} function updateAndDrawEnvironmentObjects(){for(let i=environmentObjects.length-1;i>=0OP_PUSHDATA2(77) ;i--){let obj=environmentObjects[i];obj.grow();obj.display();if(obj.age>5000){environmentObjects.splice(i,1)}}} function updateAndDrawFlowerVines(){for(let vine of flowerVines){vine.grow();vine.display()} if(random()<0.001){createFlowerVine()}} function createFlowerVine(){let tallPlants=environmentObjects.filter(obj=>obj instanceof TallFlower||obj instanceof Tree);if(tallPlants.length>=2){let start=random(tallPlants);let end=random(tallPlants.filter(p=>p!==start));if(dist(start.x,start.y,end.x,end.y)<150){flowerOP_PUSHDATA2(77) Vines.push(new FlowerVine({x:start.x,y:start.y-start.height},{x:end.x,y:end.y-end.height}))}}} function spontaneousEnvironmentGrowth(){if(environmentObjects.length<MAX_ENVIRONMENT_OBJECTS){let treeCount=environmentObjects.filter(obj=>obj instanceof Tree).length;if(random()<0.001){let x=random(width);let objectType;if(treeCount<MAX_TREES){objectType=random([Tree,Vine,TallFlower])}else{objectType=random([Vine,TallFlower])} environmentObjects.push(new objectType(x,groundLevel))}}} function updateAndDrawFairies(){foOP_PUSHDATA2(77) r(let fairy of fairies){fairy.move();fairy.display()}} function updateAndDrawBugs(){if(random()<0.001){let tree=random(environmentObjects.filter(obj=>obj instanceof Tree));if(tree){bugs.push(new Bug(tree.x+random(-20,20),tree.y-random(0,tree.height)))}} for(let bug of bugs){bug.move();bug.display()}} function updateDayCount(){if(frameCount%60===0){days++}} function updateScore(){if(plants.length>0&&herbivores.length>=2&&carnivores.length>=2&&decomposers.length>0){if(frameCount-lastScoreTime>=60){score++;lastScoOP_PUSHDATA2(77) reTime=frameCount}}} function displayStats(){push();fill(0);textAlign(LEFT,TOP);text(`Days: ${days}`,10,10);text(`Score: ${score}`,10,25);text(`Plants: ${plants.length}`,10,40);text(`Herbivores: ${herbivores.length}`,10,55);text(`Carnivores: ${carnivores.length}`,10,70);text(`Decomposers: ${decomposers.length}`,10,85);pop()} function updateEnvironmentBars(){push();textAlign(RIGHT,CENTER);let barWidth=80;let barHeight=8;let startX=width-barWidth-10;let startY=height-10-(Object.keys(environment).length*(barHeight+5OP_PUSHDATA2(77) ));for(let[key,value]of Object.entries(environment)){fill(0);noStroke();text(key,startX-5,startY+barHeight/2);stroke(0);noFill();rect(startX,startY,barWidth,barHeight);noStroke();fill(0);rect(startX,startY,(value/100)*barWidth,barHeight);startY+=barHeight+5} pop()} function displayStats(){push();fill(0);textAlign(LEFT,TOP);text(`Days: ${days}`,10,10);text(`Score: ${score}`,10,25);pop()} function getColorForStat(stat){switch(stat){case 'sunlight':return color(255,255,0);case 'water':return color(0,0,255);case 'nuOP_PUSHDATA2(77) trients':return color(0,255,0);case 'temperature':return color(255,0,0);default:return color(150)}} function toggleRain(){isRainEnabled=!isRainEnabled;let rainToggleBtn=select('#toggle-rain');rainToggleBtn.html(isRainEnabled?'Disable Rain':'Enable Rain')} function mousePressed(){initAudio();if(isGameOver){if(mouseX>width/2-50&&mouseX<width/2+50&&mouseY>height/2+70&&mouseY<height/2+110){playButtonClickSound();resetEcosystem()} return} let buttonSize=50;let buttonSpacing=60;let startX=10;let startY=height-60;if(mOP_PUSHDATA2(77) ouseX>startX&&mouseX<startX+buttonSize&&mouseY>startY&&mouseY<startY+buttonSize){playButtonClickSound();selectedObject='herbivore'}else if(mouseX>startX+buttonSpacing&&mouseX<startX+buttonSpacing+buttonSize&&mouseY>startY&&mouseY<startY+buttonSize){playButtonClickSound();selectedObject='carnivore'}else if(mouseY<groundLevel){switch(selectedObject){case 'herbivore':herbivores.push(new Herbivore(mouseX,groundLevel));playAddHerbivoreSound();break;case 'carnivore':carnivores.push(new Carnivore(mouseX,groundLevel));playOP_PUSHDATA2(77) AddCarnivoreSound();break}}} function checkGameOver(){if(plants.length===0&&herbivores.length===0&&carnivores.length===0&&decomposers.length===0){isGameOver=!0;playGameOverSound()}} function drawGameOverScreen(){background(0);fill(255);textSize(32);textAlign(CENTER,CENTER);text("Extinction Event!",width/2,height/2-100);text("Game Over",width/2,height/2-50);textSize(24);text(`Days Survived: ${days}`,width/2,height/2);text(`Final Score: ${score}`,width/2,height/2+30);fill(100);rect(width/2-50,height/2+70,100,40);fiOP_PUSHDATA2(77) ll(255);textSize(20);text("Restart",width/2,height/2+90)} function resetEcosystem(){plants=[];herbivores=[];carnivores=[];decomposers=[];environmentObjects=[];flowerVines=[];fairies=[];bugs=[];for(let i=0;i<10;i++){let x=random(width);let objectType=random([Tree,Vine,TallFlower]);environmentObjects.push(new objectType(x,groundLevel))} for(let i=0;i<5;i++){plants.push(new Plant(random(width),groundLevel))} for(let i=0;i<5;i++){herbivores.push(new Herbivore(random(width),groundLevel))} for(let i=0;i<2;i++){carnivOP_PUSHDATA2(77) ores.push(new Carnivore(random(width),groundLevel))} environment={sunlight:100,water:50,nutrients:100,temperature:50};days=0;score=0;lastScoreTime=0;isGameOver=!1;loop();selectedObject=null} function setupDebugMenu(){let debugDiv=createDiv();debugDiv.id('debug-controls');debugDiv.position(10,height+10);let addPlantBtn=createButton('Add Plant');addPlantBtn.parent(debugDiv);addPlantBtn.mousePressed(()=>plants.push(new Plant(random(width),groundLevel)));let addHerbivoreBtn=createButton('Add Herbivore');addHerbivoreBOP_PUSHDATA2(77) tn.parent(debugDiv);addHerbivoreBtn.mousePressed(()=>herbivores.push(new Herbivore(random(width),groundLevel)));let addCarnivoreBtn=createButton('Add Carnivore');addCarnivoreBtn.parent(debugDiv);addCarnivoreBtn.mousePressed(()=>carnivores.push(new Carnivore(random(width),groundLevel)));let addDecomposerBtn=createButton('Add Decomposer');addDecomposerBtn.parent(debugDiv);addDecomposerBtn.mousePressed(()=>decomposers.push(new Decomposer(random(width),groundLevel)))} function initAudio(){if(!audioContext){audioContexOP_PUSHDATA2(77) t=new(window.AudioContext||window.webkitAudioContext)()}} function playOscillator(frequency,duration,type='square'){initAudio();const oscillator=audioContext.createOscillator();const gainNode=audioContext.createGain();oscillator.type=type;oscillator.frequency.setValueAtTime(frequency,audioContext.currentTime);gainNode.gain.setValueAtTime(0.1,audioContext.currentTime);gainNode.gain.exponentialRampToValueAtTime(0.01,audioContext.currentTime+duration);oscillator.connect(gainNode);gainNode.connect(audioContext.destinaOP_PUSHDATA2(77) tion);oscillator.start();oscillator.stop(audioContext.currentTime+duration)} function playAddHerbivoreSound(){playOscillator(660,0.1)} function playAddCarnivoreSound(){playOscillator(587.33,0.1)} function playRemoveSound(){playOscillator(440,0.1)} function playEatSound(){playOscillator(660,0.05);setTimeout(()=>playOscillator(880,0.05),50)} function playReproduceSound(){playOscillator(523.25,0.05);setTimeout(()=>playOscillator(659.25,0.05),50);setTimeout(()=>playOscillator(783.99,0.05),100)} function playGameOOP_PUSHDATA2(77) verSound(){playOscillator(440,0.1);setTimeout(()=>playOscillator(349.23,0.1),100);setTimeout(()=>playOscillator(293.66,0.3),200)} function playButtonClickSound(){playOscillator(1000,0.05,'sine')} function setupUI(){let uiContainer=createDiv();uiContainer.id('ui-container');uiContainer.position(10,10)} function updateSelectedObject(){selectedObject=select('select').value().toLowerCase();updateObjectPreview()} function updateObjectPreview(){let preview=select('#object-preview');preview.html('');let previewCanvas=OP_PUSHDATA2(77) createGraphics(50,50);previewCanvas.background(220);switch(selectedObject){case 'plant':drawPlantPreview(previewCanvas);break;case 'herbivore':drawHerbivorePreview(previewCanvas);break;case 'decomposer':drawDecomposerPreview(previewCanvas);break} preview.child(previewCanvas)} function drawPlantPreview(canvas){let plant=new Plant(25,50);plant.size=10;canvas.push();canvas.translate(0,-10);plant.display();canvas.pop()} function drawHerbivorePreview(canvas){let herbivore=new Herbivore(25,50);canvas.push();canvas.traOP_PUSHDATA1(76) nslate(0,-10);herbivore.display();canvas.pop()} function drawDecomposerPreview(canvas){let decomposer=new Decomposer(25,50);decomposer.size=8;canvas.push();canvas.translate(0,-10);decomposer.display();canvas.pop()}</script>OP_ENDIF(104)
3 Outputs
- 16fc673afa79a9871fb1e42ff9b1712b242a571baf39da866b2aed85686018ca:0
- 16fc673afa79a9871fb1e42ff9b1712b242a571baf39da866b2aed85686018ca:1
- 16fc673afa79a9871fb1e42ff9b1712b242a571baf39da866b2aed85686018ca:2
value 546
address bc1pmzy0t799ny4nq74sdxzjc8h7vjn3dgrm6gzk9e0rd5s2vj4ngjws8ds5xz
value 5293
address bc1qepup64ptwrdpqhu52f865jz5rqx22wflxw3t6c
value 2000
address 33HToBLb5xGhkoHbYCR7KZP7hy57ZnrCJW