Changeset 924
- Timestamp:
- 02/04/2011 01:18:52 PM (10 years ago)
- Location:
- scenarios/GerminationX/fungi/src
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
scenarios/GerminationX/fungi/src/Fungi.hx
r917 r924 154 154 { 155 155 public var Name:String; 156 156 157 var Debug:flash.text.TextField; 157 158 var BG:Graphics; … … 167 168 var tf = new flash.text.TextField(); 168 169 tf.text = "nowt yet."; 169 tf.x=Pos.x- 50;170 tf.x=Pos.x-150; 170 171 tf.y=Pos.y-25; 171 172 tf.height=150; … … 187 188 BG.drawRect(tf.x,tf.y,tf.width,tf.height); 188 189 BG.endFill(); 190 figures.visible=false; 189 191 cast(c,truffle.flash.FlashWorld).addChild(figures); 190 192 191 193 c.addChild(tf); 192 194 Debug=tf; 193 /*tf.visible=false; 194 Root.MouseOver(this,function(c) { tf.visible=true; }); 195 Root.MouseOut(this,function(c) { tf.visible=false; });*/ 195 tf.visible=false; 196 196 197 197 Root.MouseDown(c,function(c) 198 198 { 199 t race("perc...");200 c.Server.Request("perceive",1,function(c,d){});199 tf.visible=!tf.visible; 200 figures.visible=!figures.visible; 201 201 }); 202 202 } … … 204 204 public function UpdateEmotions(e:Dynamic) 205 205 { 206 SetTilePos(new Vec2(Std.parseInt(e.tile.x), 207 Std.parseInt(e.tile.y))); 208 209 LogicalPos = new Vec3(Std.parseInt(e.pos.x), 210 Std.parseInt(e.pos.y), 211 4); 212 206 213 var ee = e.emotions.content; 207 214 var mood=Std.parseFloat(ee[0].content[0]); … … 229 236 t.color= 0x000000; 230 237 Debug.setTextFormat(t); 238 Debug.x=Pos.x-150; 239 Debug.y=Pos.y-25; 231 240 232 241 BG.clear(); … … 403 412 { 404 413 WorldPos=pos; 414 SetCurrentTilePos(new Vec2(pos.x,pos.y)); 405 415 406 416 var circles = []; -
scenarios/GerminationX/fungi/src/truffle/Bone.hx
r843 r924 64 64 } 65 65 66 override function Hide(s:Bool) : Void 67 { 68 if (Hidden!=s) 69 { 70 super.Hide(s); 71 for (c in Children) 72 { 73 c.Hide(s); 74 } 75 } 76 } 77 66 78 public function Print() 67 79 { -
scenarios/GerminationX/fungi/src/truffle/Entity.hx
r873 r924 19 19 class Entity 20 20 { 21 public var LogicalPos:Vec3; 22 public var Depth:Float; 23 public var Pos:Vec3; 24 public var NeedsUpdate:Bool; 21 public var TilePos:Vec2; // position in the world in tiles 22 public var LogicalPos:Vec3; // position in it's tile 23 public var Pos:Vec3; // screen position 24 public var Depth:Float; // depth from camera 25 public var NeedsUpdate:Bool; 26 public var Hidden:Bool; 25 27 26 28 public function new(w:World,pos:Vec3) … … 28 30 LogicalPos=pos; 29 31 Pos = Pos2PixelPos(LogicalPos); 32 TilePos = null; 30 33 Depth = Pos.z; 31 34 NeedsUpdate=false; … … 46 49 pos.x*0.51 + pos.y*0.71 + pos.z*0.47); 47 50 } 48 51 52 public function SetTilePos(s:Vec2) : Void 53 { 54 TilePos=s; 55 } 56 49 57 public function Update(frame:Int, world:World) 50 58 { … … 61 69 { 62 70 } 71 72 public function Hide(s:Bool) : Void 73 { 74 Hidden=s; 75 if (GetRoot()) GetRoot().Hide(s); 76 } 63 77 } -
scenarios/GerminationX/fungi/src/truffle/flash/FlashSprite.hx
r864 r924 38 38 public var Angle:Float; 39 39 public var MyScale:Vec2; 40 public var Hidden:Bool; 40 41 var Transform:Matrix; 41 42 var Depth:Int; … … 70 71 public function Hide(s:Bool) : Void 71 72 { 73 Hidden=s; 72 74 visible=!s; 73 75 } -
scenarios/GerminationX/fungi/src/truffle/flash/FlashWorld.hx
r873 r924 30 30 var MouseDownFunc:Dynamic -> Void; 31 31 var MouseDownContext:Dynamic; 32 var CurrentTilePos:Vec2; 32 33 33 34 function new() … … 35 36 super(); 36 37 Scene = []; 38 CurrentTilePos=new Vec2(0,0); // perhaps 37 39 } 38 40 … … 107 109 } 108 110 111 public function SetCurrentTilePos(s:Vec2) : Void 112 { 113 CurrentTilePos=s; 114 } 115 109 116 public function Update(time) 110 117 { 111 118 for (e in Scene) 112 119 { 113 if (e.NeedsUpdate) 120 if (e.TilePos!=null) 121 { 122 e.Hide(!e.TilePos.Eq(CurrentTilePos)); 123 } 124 125 if (e.NeedsUpdate && !e.Hidden) 114 126 { 115 127 e.Update(time,cast(this,truffle.World)); -
scenarios/GerminationX/fungi/src/truffle/interfaces/Sprite.hx
r864 r924 26 26 public var Angle:Float; 27 27 public var MyScale:Vec2; 28 public var Hidden:Bool; 28 29 29 30 public function MouseDown(c:Dynamic, f:Dynamic -> Void=null) : Void; -
scenarios/GerminationX/fungi/src/truffle/interfaces/World.hx
r873 r924 30 30 public function Update(time:Int) : Void; 31 31 public function Handle(event:Int) : Void; 32 public function SetCurrentTilePos(s:Vec2) : Void; 32 33 }
Note: See TracChangeset
for help on using the changeset viewer.