STORY   LOOP   FURRY   PORN   GAMES
• C •   SERVICES [?] [R] RND   POPULAR
Archived flashes:
229595
/disc/ · /res/     /show/ · /fap/ · /gg/ · /swf/P0001 · P2595 · P5190

<div style="position:absolute;top:-99px;left:-99px;"><img src="http://swfchan.com:57475/67113188?noj=FRM67113188-22DN" width="1" height="1"></div>

This is the wiki page for Flash #171169
Visit the flash's index page for basic data and a list of seen names.


AntFarmREAL.swf
95,4 KiB, 00:00 | [W] [I]

Threads (1):

[QX0AKAJ]F ! http://boards.4chan.org/f/thread/2808069/ant-farm-ai-co…
ARCHIVEDDiscovered: 10/6 -2015 01:40:53 Ended: 10/6 -2015 04:26:02Flashes: 1 Posts: 19
File: AntFarmREAL.swf-(93 KB, 700x500, Game)
[_] Ant Farm AI + code + source Anon 2808069 Ripped from http://www.zen-sign.com/extranet/antland/ I'm making my own creature AI stuff I'll post my update later tonight, but I found this a week ago and it kind of inspired me. Super simple AI at work, I already decompiled the SWF and checked the code - anyone wanna see? Marked for deletion (old).
>> [_] Anon 2808073 class Ant extends MovieClip { var customName = "Name This Ant"; var warningOn = false; var actionState = 0; function Ant() { super(); this.age = 1; this.appetite = 0; this.decisionMod = 0.4; this.moveDir = 5; this.moveRate = 0.25; this.maxAge = 1; this.ageRate = 20000; this.gender = 0; this.digCapacity = 30; this.antRestAmount = 1000; this.xtile = 0; this.ytile = 1; this.tileW = 20; this.tileH = 20; this._x = this.xtile * this.tileW; this._y = this.ytile * this.tileH; this.growOlder(); this.getHungry(); this.doAI(); this.dying_sound = new Sound(); this.digging_sound = new Sound(); this.eating_sound = new Sound(); this.dying_sound.loadSound("sound/dying_ voice.mp3",false); this.digging_sound.loadSound("sound/digg ing.mp3",false); this.eating_sound.loadSound("sound/eatin g2.mp3",false); this.digging_sound.setVolume(75); this.dying_sound.setVolume(30); }
>> [_] Anon 2808080 >># function increaseAppetite() { if(!(this.appetite < 100)) { if(!(this.actionState == 3) || !(this.actionState == 4)) { this.actionState = 5; clearInterval(this.hunger_intervalId); this.die(); } } else if(!(this.appetite < 80)) { this.appetite = this.appetite + 2; if(this.warningOn == false) { if(!this._parent[this.myName].messageHol der.dyingWarning) { this.warningOn = true; this._parent[this.myName].createEmptyMov ieClip("messageHolder",this.getNextHighes tDepth()); this._parent[this.myName].messageHolder. attachMovie("dyingWarning","dyingWarning" ,this.getNextHighestDepth()); this._parent[this.myName].messageHolder. dyingWarning._alpha = 0; this.dyingWarningFadeIn = new mx.transitions.Tween(this._parent[this.m yName].messageHolder.dyingWarning,"_alpha ",mx.transitions.easing.Regular.easeOut,0 ,100,8,false); } else { this.warningOn = true; this.dyingWarningFadeIn = new mx.transitions.Tween(this._parent[this.m yName].messageHolder.dyingWarning,"_alpha ",mx.transitions.easing.Regular.easeOut,0 ,100,8,false); } } } else if(this.warningOn == true) { this.dyingWarningFadeOut = new mx.transitions.Tween(this._parent[this.m yName].messageHolder.dyingWarning,"_alpha ",mx.transitions.easing.Regular.easeOut,1 00,0,8,false); this.warningOn = false; this.appetite = this.appetite + 2; } this.appetite = this.appetite + 2; } function reduceAppetite() { if(!(this.appetite < 6)) { this.appetite = this.appetite - 6; } else { this.appetite = 0; } }
>> [_] Anon 2808084 >># function ageYear() { if(!(this.age < this.maxAge)) { if(!(this.actionState == 3) || !(this.actionState == 4)) { this.actionState = 5; clearInterval(this.grow_intervalId); this.die(); } } else { this.age = this.age + 1; } } function getHungry() { if(!(this.hunger_intervalId == null)) { clearInterval(this.hunger_intervalId); } this.hunger_intervalId = setInterval(this,"increaseAppetite",5000 ); } function growOlder() { if(!(this.grow_intervalId == null)) { clearInterval(this.grow_intervalId); } this.grow_intervalId = setInterval(this,"ageYear",this.ageRate); } function die() { if(this.actionState == 5) { this.dying_sound.start(); delete this.onEnterFrame; if(this.rest_intervalId) { clearInterval(this.rest_intervalId); } if(!(this.grow_intervalId == null)) { clearInterval(this.grow_intervalId); } if(!(this.dig_intervalId == null)) { clearInterval(this.dig_intervalId); } if(this["dyingWarning" + this]) { this.removeMovieClip(); } this._parent.totalAntsNo = this._parent.totalAntsNo - 1; var _loc3_ = this._y; var _loc2_ = this._y - 40; this.gotoAndStop(9); var _loc4_ = new mx.transitions.Tween(this,"_alpha",mx.tr ansitions.easing.Regular.easeOut,100,0,30 ,false); var _loc5_ = new mx.transitions.Tween(this,"_y",mx.transi tions.easing.Regular.easeOut,_loc3_,_loc2 _,30,false); Aaaaand the and dies. There's about 500+ more lines of code, with character limit it will take forever to paste this. But you get the jist.
>> [_] Anon 2808100 you can only feed five times. wat
>> [_] Anon 2808106 these ants are rather stupid..... the fuckers dug out the top 3 layers. thats it
>> [_] Anon 2808114 >># it recharges over time i noticed
>> [_] Anon 2808116 how do you even feed them
>> [_] Anon 2808119 >># how do you feed them ?
>> [_] Anon 2808120 >># You could have just linked a github post....
>> [_] Anon 2808133 >># >># >># There's a button at the bottom, if you move your cursor down there. Doesn't help much, as the little tards piss and moan about starving even as they let all of their food rot, ignoring it RIGHT FUCKING NEXT TO THEM... Until OP/Creator figures out how to program an "Eat" subroutine when appetite drops below a certain threshold, this "game" is fucked.
>> [_] Anon 2808155 Hunger continues to drain when tabbed, but they don't continue to dig :l
>> [_] Anon 2808193 >># the fucking ants act so randomly it's not even fun to watch them. they'd rather starve to death than move 1 square in the right direction to eat a meal. shit idea shit game do something else with your time OP
>> [_] Anon 2808195 >># just like real ants.
>> [_] Anon 2808202 How do I make the ants have sex?
>> [_] Anon 2808204 How poor is your character? He can't feed two fucking ants holy shit.
>> [_] Anon 2808218 >># Actually, real ants are rather interesting, really. They all work as a highly coordinated team to further their puny, futile existence. Their colonies can become massive with complex networks of tunnels and chambers. Each colony has different types of ants. The most prominent are worker ants. They're usually small, and can be seen traveling in a path with several of their fellow workers. This path is a DNA trail left by a scout that found a food source, or other valuable resources for the colony. Usually it's a food source. If you want a good example of this, leave bread or sugar water outside. Soon you will see one of these trails of little black specs moving back and forth like a two lane highway! Their are many more types of ants with interesting duties, but I don't want to write for an hour.
>> [_] Anon 2808224 >># I didn't make it, lol. I'm developing other stuff. Everyone is right though, the ants are retarded and don't really want to survive. Anyway, I'll update my AI in a sec.
>> [_] Anon 2808226 >># Is there a new version of colorfull squares?



http://swfchan.net/35/171169.shtml
Created: 10/6 -2015 01:48:23 Last modified: 17/10 -2018 20:11:41 Server time: 22/12 -2024 05:37:47