Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package Souris_fla
- {
- import Box2D.Dynamics.*;
- import Box2D.Collision.Shapes.*;
- import flash.display.*;
- import flash.geom.*;
- import adobe.utils.*;
- import flash.accessibility.*;
- import flash.desktop.*;
- import flash.errors.*;
- import flash.events.*;
- import flash.external.*;
- import flash.filters.*;
- import flash.media.*;
- import flash.net.*;
- import flash.printing.*;
- import flash.profiler.*;
- import flash.sampler.*;
- import flash.system.*;
- import flash.text.*;
- import flash.text.engine.*;
- import flash.ui.*;
- import flash.utils.*;
- import flash.xml.*;
- import Box2D.Collision.*;
- import Box2D.Common.Math.*;
- import fl.transitions.Tween;
- import fl.transitions.TweenEvent;
- import __AS3__.vec.Vector;
- import Box2D.Dynamics.Joints.b2RevoluteJointDef;
- public dynamic class MainTimeline extends MovieClip
- {
- public function MainTimeline() {
- super();
- addFrameScript(0,this.frame1);
- }
- public var ClipJoueurProp:b2CircleDef;
- public var Domaine:String;
- public function Connexion_Impossible(param1:Event) : void {
- this.ClipServeur.Texte.text = "\nImpossible d\'établir une connexion avec le serveur :\'(";
- }
- public var PosDépartX:int;
- public var PosDépartY:int;
- public var InfoSalon:Array;
- public var IPS:$IPS;
- public var TexteServeur:TextField;
- public var DernierSaut:int;
- public function Validation_Placement_Objet(param1:Event) : void {
- var _loc2_:MovieClip = null;
- if(!this.HorsDePorté)
- {
- this.PosFinObjetX = this.ObjetEnCours.x;
- this.PosFinObjetY = this.ObjetEnCours.y;
- stage.addEventListener(MouseEvent.MOUSE_UP,this.Annulation_Invocation);
- Mouse.hide();
- _loc2_ = this.ClipJoueur.BarreDinvoc;
- _loc2_._M.width = 0;
- _loc2_._H.x = 0;
- this.InvocationEnCours = true;
- this.DébutInvocation = getTimer();
- this.ClipJoueur.addChild(this.ClipJoueur.BarreDinvoc);
- if(this.ClipJoueur.x < this.ObjetEnCours.x)
- {
- if(this.ClipJoueur.Vers_La_Droite(true))
- {
- this.Envoie_Serveur(this.$4 + this.$8 + this.$1 + 0);
- }
- this.ClipJoueur.Animation_Statique(true);
- }
- else
- {
- if(this.ClipJoueur.Vers_La_Droite(false))
- {
- this.Envoie_Serveur(this.$4 + this.$8 + this.$1 + 1);
- }
- this.ClipJoueur.Animation_Statique(false);
- }
- this.ClipJoueur.DroiteEnCours = false;
- this.ClipJoueur.GaucheEnCours = false;
- this.MAJ_Position();
- this.Envoie_Serveur(this.$5 + this.$8 + this.$1 + this.ObjetEnCours.Code + this.$1 + this.PosFinObjetX + this.$1 + this.PosFinObjetY + this.$1 + int(this.ObjetEnCours.rotation));
- this.ClipJoueur.Animation_Invocation(this.ClipJoueur.AnimDroite);
- }
- }
- public const CouleurBase:ColorTransform = new ColorTransform(1,1,1,0.5);
- public function MAJ_Position(param1:Event=null, param2:Boolean=false) : void {
- var _loc3_:String = null;
- var _loc4_:* = 0;
- var _loc5_:* = 0;
- var _loc6_:b2Body = null;
- var _loc7_:b2XForm = null;
- var _loc8_:* = NaN;
- var _loc9_:* = NaN;
- var _loc10_:b2Vec2 = null;
- var _loc11_:* = 0;
- var _loc12_:b2Body = null;
- var _loc13_:* = 0;
- var _loc14_:* = 0;
- var _loc15_:b2XForm = null;
- var _loc16_:b2Vec2 = null;
- var _loc17_:* = 0;
- if(((param1) || (param2)) && (this.Synchroniseur))
- {
- _loc3_ = this.$4 + this.$3;
- _loc4_ = this.ListeMobile.length;
- _loc5_ = 0;
- while(_loc5_ < _loc4_)
- {
- _loc6_ = this.ListeMobile[_loc5_];
- if(_loc6_)
- {
- _loc7_ = _loc6_.GetXForm();
- _loc8_ = int(_loc7_.position.x * 1000) / 1000;
- _loc9_ = int(_loc7_.position.y * 1000) / 1000;
- if(-4 > _loc8_ || _loc8_ > 31 || _loc9_ > 20 || -15 > _loc9_)
- {
- this.Destruction_Mobile(_loc5_);
- _loc3_ = _loc3_ + (this.$1 + "x");
- }
- else
- {
- _loc10_ = _loc6_.GetLinearVelocity();
- _loc11_ = int(_loc6_.m_userData.Type);
- _loc3_ = _loc3_ + (this.$1 + _loc11_ + "," + _loc8_ + "," + _loc9_ + "," + int(_loc10_.x * 1000) / 1000 + "," + int(_loc10_.y * 1000) / 1000 + "," + int(_loc6_.GetAngle() * 1000) / 1000 + "," + int(_loc6_.GetAngularVelocity() * 1000) / 1000);
- }
- }
- else
- {
- _loc3_ = _loc3_ + (this.$1 + "x");
- }
- _loc5_++;
- }
- this.Envoie_Serveur(_loc3_);
- }
- if(!this.ClipJoueur.Mort)
- {
- _loc12_ = this.ClipJoueur.Physique;
- _loc13_ = this.ClipJoueur.DroiteEnCours?1:0;
- _loc14_ = this.ClipJoueur.GaucheEnCours?1:0;
- _loc15_ = _loc12_.GetXForm();
- _loc16_ = _loc12_.GetLinearVelocity();
- _loc17_ = this.ClipJoueur.Saute?1:0;
- this.Envoie_Serveur(this.$4 + this.$4 + this.$1 + _loc13_ + this.$1 + _loc14_ + this.$1 + int(_loc15_.position.x * 1000) / 1000 + this.$1 + int(_loc15_.position.y * 1000) / 1000 + this.$1 + int(_loc16_.x * 1000) / 1000 + this.$1 + int(_loc16_.y * 1000) / 1000 + this.$1 + _loc17_ + this.$1 + this.ClipJoueur.ImageSaut);
- }
- }
- public var ListeJoueur:Dictionary;
- public var TexteChat:TextField;
- public var SautDisponible:Boolean;
- public var m_iterations:int;
- public function Demande_Giclage(param1:int) : void {
- this.Envoie_Serveur(this.$4 + this.$6 + this.$1 + param1);
- }
- public function Demande_Explosion(param1:int, param2:int, param3:int, param4:int, param5:Boolean=false) : void {
- if(param5)
- {
- this.Envoie_Serveur(this.$5 + this.$17 + this.$1 + param1 + this.$1 + param2 + this.$1 + param3 + this.$1 + param4 + this.$1 + 1);
- }
- else
- {
- this.Envoie_Serveur(this.$5 + this.$17 + this.$1 + param1 + this.$1 + param2 + this.$1 + param3 + this.$1 + param4 + this.$1 + 0);
- }
- }
- public var CouleurSol:uint;
- public function Annulation_Invocation(param1:Event=null) : void {
- if(this.InvocationEnCours)
- {
- if(this.ObjetEnCours)
- {
- this.ObjetEnCours.x = mouseX;
- this.ObjetEnCours.y = mouseY;
- }
- Mouse.show();
- this.InvocationEnCours = false;
- if(this.ClipJoueur.BarreDinvoc.parent)
- {
- this.ClipJoueur.removeChild(this.ClipJoueur.BarreDinvoc);
- }
- this.Envoie_Serveur(this.$5 + this.$9);
- this.ClipJoueur.Animation_Statique(this.ClipJoueur.AnimDroite);
- }
- }
- public const VitesseJoueur:Number = 3;
- public var AutoClouDécalage:int;
- public function Validation_Placement_Objet_Fin() : void {
- var _loc3_:MovieClip = null;
- var _loc4_:Point = null;
- var _loc1_:MovieClip = this.ObjetEnCours;
- var _loc2_:int = _loc1_.Code;
- if(_loc2_ > 10 && _loc2_ < 17 || _loc2_ == 22)
- {
- this.Création_Clou(_loc2_,this.PosFinObjetX,this.PosFinObjetY);
- this.Annulation_Placement_Objet();
- return;
- }
- this.Creation_Objet(_loc2_,int(_loc1_.x),int(_loc1_.y),int(_loc1_.rotation));
- this.Envoie_Serveur(this.$5 + this.$20 + this.$1 + _loc2_ + this.$1 + this.PosFinObjetX + this.$1 + (this.PosFinObjetY - 3) + this.$1 + int(_loc1_.rotation) + this.$1 + 0 + this.$1 + 0);
- if(this.AutoClou)
- {
- this.AutoClou = false;
- _loc3_ = this.ObjetEnCours.getChildAt(this.ObjetEnCours.numChildren-1) as MovieClip;
- _loc4_ = _loc3_.localToGlobal(new Point(0,0));
- this.Création_Clou(this.AutoClouCode,_loc4_.x,_loc4_.y - 3);
- }
- this.Annulation_Invocation();
- this.Annulation_Placement_Objet();
- }
- public function Objet_Transparent(param1:String, param2:int, param3:int, param4:int, param5:int) : MovieClip {
- var _loc6_:MovieClip = $Res.Pouf("$Objet_" + param2);
- _loc6_.mouseEnabled = false;
- _loc6_.mouseChildren = false;
- _loc6_.x = param3;
- _loc6_.y = param4;
- _loc6_.transform.colorTransform = this.CouleurBleue;
- _loc6_.rotation = param5;
- _loc6_.name = param1;
- this.ClipOP.addChild(_loc6_);
- return _loc6_;
- }
- public var ClipServeur:MovieClip;
- public var Monte:Boolean;
- public var CodeJoueur:int;
- public var TempsEnCours:int;
- public function Connexion_Interdite(param1:SecurityErrorEvent) : void {
- this.ClipServeur.Texte.text = "\nImpossible d\'établir une connexion avec le serveur :\'(";
- }
- function frame1() : * {
- $Joueur._root = this;
- opaqueBackground = 13027543;
- this.ClipMonde = this._M;
- this.ClipListeJoueur = this.ClipMonde._ListeJoueur;
- this.ClipListeMobile = this.ClipMonde._ListeMobile;
- this.ClipStatique = this.ClipMonde._OS;
- this.ClipServeur = this._Serveur;
- this.ClipIdentification = this._Serveur._I;
- this.ClipInterface = this._I;
- this.ClipOP = this._OP;
- this.ClipOP.mouseEnabled = false;
- this.ClipOP.mouseChildren = false;
- this.ClipInterface.mouseEnabled = false;
- this.TexteServeur = this._Serveur.Texte;
- this.NomObjet = new Array();
- this.MoteurActif = false;
- this.CouleurSol = 6788234;
- this.ListeObjetDispo = new Array(1,2,3,4,6,7,18);
- this.NomObjet[0] = "Flèche indicative";
- this.NomObjet[1] = "Petite caisse";
- this.NomObjet[2] = "Grosse caisse";
- this.NomObjet[3] = "Petite planche";
- this.NomObjet[4] = "Grande planche";
- this.NomObjet[5] = "Balle lourde";
- this.NomObjet[6] = "Balle";
- this.NomObjet[7] = "Trampoline ";
- this.NomObjet[8] = "Petite planche rugueuse";
- this.NomObjet[9] = "Grande planche rugueuse";
- this.NomObjet[10] = "Boite lourde";
- this.NomObjet[11] = "Clou fixe";
- this.NomObjet[12] = "Moteur fixe droite";
- this.NomObjet[13] = "Moteur fixe gauche";
- this.NomObjet[14] = "Clou (Touche V pour associer avec un autre objet)";
- this.NomObjet[15] = "Moteur droite";
- this.NomObjet[16] = "Moteur gauche";
- this.NomObjet[17] = "Boulet";
- this.NomObjet[18] = "Boulet";
- this.NomObjet[19] = "Boulet";
- this.NomObjet[20] = "Boulet";
- this.NomObjet[21] = "Balle collante";
- this.NomObjet[22] = "Clou semi fixe (Touche C pour associer avec un autre objet)";
- this.ListeJoueur = new Dictionary();
- this.Synchroniseur = false;
- this.SautDisponible = false;
- this.AutoClou = false;
- this.ClipInterface.visible = false;
- this.ClipMonde.visible = false;
- this.$1 = String.fromCharCode(1);
- this.$2 = String.fromCharCode(2);
- this.$3 = String.fromCharCode(3);
- this.$4 = String.fromCharCode(4);
- this.$5 = String.fromCharCode(5);
- this.$6 = String.fromCharCode(6);
- this.$7 = String.fromCharCode(7);
- this.$8 = String.fromCharCode(8);
- this.$9 = String.fromCharCode(9);
- this.$11 = String.fromCharCode(11);
- this.$12 = String.fromCharCode(12);
- this.$14 = String.fromCharCode(14);
- this.$15 = String.fromCharCode(15);
- this.$16 = String.fromCharCode(16);
- this.$17 = String.fromCharCode(17);
- this.$18 = String.fromCharCode(18);
- this.$19 = String.fromCharCode(19);
- this.$20 = String.fromCharCode(20);
- this.$21 = String.fromCharCode(21);
- this.$22 = String.fromCharCode(22);
- this.$24 = String.fromCharCode(24);
- this.$25 = String.fromCharCode(25);
- this.$26 = String.fromCharCode(26);
- this.$27 = String.fromCharCode(27);
- this.ClipJoueurProp = new b2CircleDef();
- this.ClipJoueurProp.radius = 0.5;
- this.ClipJoueurProp.density = 2;
- this.ClipJoueurProp.friction = 0.2;
- this.ClipJoueurProp.restitution = 0.2;
- this.ClipJoueurProp.filter.categoryBits = 2;
- this.ClipJoueurProp.filter.maskBits = 4;
- this.MasseSourisBase = new b2MassData();
- this.MasseSourisBase.mass = 30;
- this.MasseSourisGrosse = new b2MassData();
- this.MasseSourisGrosse.mass = 90;
- this.worldAABB = new b2AABB();
- this.worldAABB.lowerBound.Set(-100,-100);
- this.worldAABB.upperBound.Set(100,100);
- this.MondePhysique = new b2World(this.worldAABB,new b2Vec2(0.0,10),true);
- this.m_iterations = 10;
- this.m_timeStep = 1 / 30;
- this.CacheObjet = new Array();
- stage.addEventListener(Event.ENTER_FRAME,this.Boucle_Moteur);
- this.ImagesCalculées = 0;
- this.HorsDePorté = false;
- this.Monte = true;
- this.StyleTexte = new StyleSheet();
- this.StyleTexte.setStyle("BV",{"color":"#002222"});
- this.StyleTexte.setStyle("R",{"color":"#440000"});
- this.StyleTexte.setStyle("BL",{"color":"#000044"});
- this.StyleTexte.setStyle("J",{"color":"#554400"});
- this.StyleTexte.setStyle("N",{"color":"#000044"});
- this.StyleTexte.setStyle("G",{"color":"#1D4E4E"});
- this.StyleTexte.setStyle("V",{"color":"#002200"});
- this.StyleTexte.setStyle("VP",{"color":"#440044"});
- this.StyleTexte.setStyle("VI",{"color":"#440044"});
- this.StyleTexte.setStyle("ROSE",{"color":"#440044"});
- this.StyleTexte.setStyle("a:hover",{"color":"#2ECF73"});
- this.StyleTexte.setStyle("a:active",{"color":"#2ECF73"});
- this.CollisionJoueur = false;
- this.Guide = false;
- this.IPS = new $IPS(200,50,30);
- $Res.FonctionErreur = this.Erreur_Ressource;
- this.TimerPosition = new Timer(500);
- this.TimerPosition.addEventListener(TimerEvent.TIMER,this.MAJ_Position);
- this.NombreObjet = this.NomObjet.length;
- this.InterfaceListeObjet = new $Liste(145,189,43,false);
- this.ClipInterface.addChild(this.InterfaceListeObjet);
- this.InterfaceListeObjet.x = 650;
- this.InterfaceListeObjet.y = 406;
- this.InterfaceListeObjet.Ascenseur();
- this.CouleurBleue = new ColorTransform(1,1,2,0.5,0,0,50);
- this.InvocationEnCours = false;
- this.Domaine = "r3x.no-ip.org";
- this.Version = "0.1";
- this.MauvaiseVersion = true;
- this.Restriction = "^<";
- this.Admin = false;
- this.Modo = false;
- this.SalonCible = "1";
- stage.tabChildren = false;
- Security.allowDomain("*");
- this.Chargement_Ressources();
- try
- {
- if(ExternalInterface.available)
- {
- this.Adresse = ExternalInterface.call("window.location.href.toString");
- if(this.Adresse == null)
- {
- this.SalonCible = "1";
- }
- else
- {
- this.InfoSalon = this.Adresse.split("?salon=");
- if(this.InfoSalon.length == 1)
- {
- this.SalonCible = "1";
- }
- else
- {
- this.SalonCible = this.InfoSalon[1].toLowerCase();
- }
- }
- }
- else
- {
- this.SalonCible = "1";
- }
- }
- catch(E:Error)
- {
- }
- this.BoucleReveille = new Timer(11000);
- this.CE = this.ClipInterface.CE;
- this.LimiteChat = 0;
- this.DernierMessage = "";
- this.TexteChat = this.ClipInterface.CS;
- this.TexteChat.styleSheet = this.StyleTexte;
- this.TexteChat.text = "";
- this.DernierCodeClou = -1;
- stage.addEventListener(KeyboardEvent.KEY_DOWN,this.Clavier1);
- stage.addEventListener(KeyboardEvent.KEY_UP,this.Clavier2);
- this.InterfaceListeJoueur = new $Liste(145,190,19,false);
- this.ClipInterface.addChild(this.InterfaceListeJoueur);
- this.InterfaceListeJoueur.x = 494;
- this.InterfaceListeJoueur.y = 407;
- this.InterfaceListeJoueur.Ascenseur();
- this.AscenseurChat = new $Ascenseur(this.TexteChat);
- this.ListeMessage = new Vector.<String>();
- this._Vignette = this.ClipVignette;
- this.AnimVignette = new Tween(this._Vignette,"alpha",null,1,0,0.1,true);
- this.AnimVignette.addEventListener(TweenEvent.MOTION_FINISH,this.Fin_AnimVignette);
- this._Vignette.mouseChildren = false;
- this._Vignette.mouseEnabled = false;
- this._Vignette._Texte.styleSheet = this.StyleTexte;
- this.Fx = 0.1;
- this.Fy = 0;
- this.Gy = 0.1;
- this.ParticuleZone = new $ParticuleZone(0,0,800,400,this.Mouvement);
- this.ClipMonde.addChild(this.ParticuleZone);
- this.ListeParticule = new Array();
- this.ListeParticuleAnimation = new Array();
- this._Serveur._Titre.text = $T.Nom_Jeu;
- }
- public function Vignette_RollOver(param1:MouseEvent) : void {
- var _loc3_:* = 0;
- var _loc4_:* = 0;
- stage.removeEventListener(MouseEvent.MOUSE_MOVE,this.Vignette_On);
- this.VignetteEnCours = param1.currentTarget;
- var _loc2_:int = this.VignetteEnCours.VignetteFixe;
- this._Vignette._Texte.htmlText = this.VignetteEnCours.VignetteTexte;
- if(this.VignetteEnCours.VignetteLargeur == 0)
- {
- this._Vignette._Texte.wordWrap = false;
- this._Vignette._Texte.width = this._Vignette._Texte.textWidth + 4;
- }
- else
- {
- this._Vignette._Texte.wordWrap = true;
- this._Vignette._Texte.width = this.VignetteEnCours.VignetteLargeur;
- }
- this._Vignette._Texte.height = this._Vignette._Texte.textHeight + 4;
- _loc3_ = this._Vignette._Texte.width + 10;
- _loc4_ = this._Vignette._Texte.height + 6;
- this._Vignette.graphics.clear();
- this._Vignette.graphics.beginFill(2236979);
- this._Vignette.graphics.lineStyle(3,0,1,true,"normal",null,JointStyle.MITER);
- this._Vignette.graphics.drawRect(0,0,_loc3_,_loc4_);
- this._Vignette.graphics.endFill();
- if(_loc2_ == 0)
- {
- this._Vignette.x = mouseX;
- this._Vignette.y = mouseY + 22;
- stage.addEventListener(MouseEvent.MOUSE_MOVE,this.Vignette_On);
- this.LimiteX = 800 - this._Vignette.width;
- this.LimiteY = 600 - this._Vignette.height;
- if(this._Vignette.x > this.LimiteX)
- {
- this._Vignette.x = this.LimiteX;
- }
- if(this._Vignette.y > this.LimiteY)
- {
- this._Vignette.y = this.LimiteY;
- }
- }
- else
- {
- if(_loc2_ == 1)
- {
- this._Vignette.x = this.VignetteEnCours.VignetteFixeX;
- this._Vignette.y = this.VignetteEnCours.VignetteFixeY;
- }
- else
- {
- if(_loc2_ == 2)
- {
- this._Vignette.x = this.VignetteEnCours.VignetteFixeX;
- this._Vignette.y = int(this.VignetteEnCours.VignetteFixeY - this._Vignette.height);
- }
- else
- {
- if(_loc2_ == 3)
- {
- this._Vignette.x = int(this.VignetteEnCours.VignetteFixeX - this._Vignette.width);
- this._Vignette.y = int(this.VignetteEnCours.VignetteFixeY - this._Vignette.height);
- }
- else
- {
- if(_loc2_ == 10)
- {
- this._Vignette.x = mouseX;
- this._Vignette.y = mouseY + 22;
- stage.addEventListener(MouseEvent.MOUSE_MOVE,this.Vignette_On);
- this.LimiteX = 800 - this._Vignette.width;
- this.LimiteY = 600 - this._Vignette.height;
- if(this._Vignette.x > this.LimiteX)
- {
- this._Vignette.x = this.LimiteX;
- }
- if(this._Vignette.y > this.LimiteY)
- {
- this._Vignette.y = this.LimiteY;
- }
- }
- }
- }
- }
- }
- this.AnimVignette.stop();
- if(this._Vignette.alpha != 1)
- {
- this.AnimVignette.begin = this._Vignette.alpha;
- this.AnimVignette.finish = 1;
- this.AnimVignette.start();
- }
- addChild(this._Vignette);
- }
- public function Destruction_Joueur(param1:int, param2:int=0, param3:int=0) : void {
- var _loc4_:$Joueur = this.ListeJoueur[param1];
- if(_loc4_)
- {
- if(param2 == 0)
- {
- delete this.ListeJoueur[[param1]];
- }
- if(_loc4_.parent)
- {
- _loc4_.parent.removeChild(_loc4_);
- this.MondePhysique.DestroyBody(_loc4_.Physique);
- }
- _loc4_.Mort = true;
- _loc4_.Score = param3;
- if(_loc4_.ClipJoueur)
- {
- if(param2 == 1)
- {
- this.Message_Chat("Pas de fromage pour vous ! ^_^");
- }
- else
- {
- if(param2 == 2)
- {
- this.Message_Chat("Fromaaaage *-*");
- }
- }
- }
- }
- }
- public var CE:TextField;
- public function MAJ_Force_Porté() : void {
- var _loc1_:* = 0;
- var _loc2_:* = 0;
- var _loc3_:* = 0;
- if(this.ObjetEnCours)
- {
- _loc1_ = this.ObjetEnCours.x - this.ClipJoueur.x;
- _loc2_ = this.ObjetEnCours.y - this.ClipJoueur.y;
- _loc3_ = Math.sqrt(_loc1_ * _loc1_ + _loc2_ * _loc2_);
- if(_loc3_ > 120)
- {
- this.ObjetEnCours.transform.colorTransform = this.CouleurZéro;
- this.HorsDePorté = true;
- }
- else
- {
- this.ObjetEnCours.transform.colorTransform = this.CouleurBase;
- this.HorsDePorté = false;
- }
- }
- }
- public var Monde:MovieClip;
- public function Fin_AnimVignette(param1:Event) : void {
- if(this._Vignette.alpha == 0)
- {
- removeChild(this._Vignette);
- stage.removeEventListener(MouseEvent.MOUSE_MOVE,this.Vignette_On);
- }
- }
- public var ImagesCalculées:int;
- public var VraiLargeur:int;
- public var TempsSeconde:int;
- public function Envoie_Serveur(param1:String) : void {
- this.Serveur.send(param1);
- }
- public var ParticuleZone:$ParticuleZone;
- public var AutoClou:Boolean;
- public function Boucle_Molette(param1:MouseEvent) : void {
- var _loc2_:* = 0;
- if((this.ObjetEnCours) && !this.InvocationEnCours)
- {
- if(param1.delta < 0)
- {
- _loc2_ = -15;
- }
- else
- {
- _loc2_ = 15;
- }
- this.ObjetEnCours.rotation = this.ObjetEnCours.rotation + _loc2_;
- }
- }
- public var _OP:MovieClip;
- public function Creation_Objet(param1:int, param2:int, param3:int, param4:int, param5:Number=0, param6:Number=0) : b2Body {
- var _loc7_:* = NaN;
- var _loc8_:* = NaN;
- var _loc9_:b2BodyDef = null;
- var _loc10_:b2PolygonDef = null;
- var _loc11_:b2CircleDef = null;
- var _loc12_:b2Body = null;
- var _loc13_:b2MassData = null;
- var _loc18_:MovieClip = null;
- var _loc19_:* = 0;
- var _loc20_:* = 0;
- var _loc21_:BitmapData = null;
- var _loc22_:Matrix = null;
- _loc9_ = new b2BodyDef();
- _loc9_.position.x = param2 / 30;
- _loc9_.position.y = param3 / 30;
- _loc9_.angle = Math.PI * param4 / 180;
- if(!this.CacheObjet[param1])
- {
- _loc18_ = $Res.Pouf("$Objet_" + param1);
- _loc19_ = _loc18_.width + 2;
- _loc20_ = _loc18_.height + 2;
- _loc21_ = new BitmapData(_loc19_,_loc20_,true,0);
- _loc22_ = new Matrix();
- _loc22_.translate(_loc19_ / 2,_loc20_ / 2);
- _loc21_.draw(_loc18_,_loc22_);
- this.CacheObjet[param1] = _loc21_;
- }
- var _loc14_:MovieClip = new MovieClip();
- var _loc15_:Bitmap = new Bitmap(this.CacheObjet[param1],"auto",true);
- _loc15_.x = -int(_loc15_.width / 2);
- _loc15_.y = -int(_loc15_.height / 2);
- _loc14_.addChild(_loc15_);
- _loc14_.Type = param1;
- var _loc16_:* = false;
- var _loc17_:* = false;
- if(param1 == 0)
- {
- this.ClipListeMobile.addChild(_loc14_);
- _loc14_.x = param2;
- _loc14_.y = param3;
- _loc14_.rotation = param4;
- return null;
- }
- if(param1 == 1 || param1 == 2)
- {
- if(param1 == 1)
- {
- _loc7_ = 0.5;
- _loc8_ = 0.5;
- }
- else
- {
- _loc7_ = 1;
- _loc8_ = 1;
- }
- _loc10_ = new b2PolygonDef();
- _loc10_.filter.categoryBits = 4;
- _loc10_.SetAsBox(_loc7_,_loc8_);
- _loc10_.density = 30;
- _loc10_.friction = 0.8;
- _loc10_.restitution = 0.2;
- _loc9_.userData = _loc14_;
- _loc14_.width = _loc7_ * 60;
- _loc14_.height = _loc8_ * 60;
- _loc12_ = this.MondePhysique.CreateBody(_loc9_);
- _loc12_.CreateShape(_loc10_);
- _loc12_.SetMassFromShapes();
- }
- else
- {
- if(param1 == 3 || param1 == 4)
- {
- if(param1 == 3)
- {
- _loc7_ = 1.66;
- }
- else
- {
- _loc7_ = 3.33;
- }
- _loc8_ = 0.16666;
- _loc10_ = new b2PolygonDef();
- _loc10_.filter.categoryBits = 4;
- _loc10_.SetAsBox(_loc7_,_loc8_);
- _loc10_.density = 50;
- _loc10_.friction = 0.4;
- _loc10_.restitution = 0.1;
- _loc9_.userData = _loc14_;
- _loc12_ = this.MondePhysique.CreateBody(_loc9_);
- _loc12_.CreateShape(_loc10_);
- _loc12_.SetMassFromShapes();
- }
- else
- {
- if(param1 == 5 || param1 == 6)
- {
- _loc7_ = 0.5;
- _loc8_ = 0.5;
- _loc11_ = new b2CircleDef();
- _loc11_.filter.categoryBits = 4;
- _loc11_.radius = _loc7_;
- if(param1 == 5)
- {
- _loc11_.density = 100;
- _loc11_.restitution = 0.2;
- }
- else
- {
- _loc11_.density = 10;
- _loc11_.restitution = 0.9;
- }
- _loc11_.friction = 0.1;
- _loc9_.userData = _loc14_;
- _loc12_ = this.MondePhysique.CreateBody(_loc9_);
- _loc12_.CreateShape(_loc11_);
- if(param1 == 5)
- {
- _loc13_ = new b2MassData();
- _loc13_.mass = 500;
- _loc12_.SetMass(_loc13_);
- }
- else
- {
- _loc12_.SetMassFromShapes();
- }
- }
- else
- {
- if(param1 == 7)
- {
- _loc9_.userData = _loc14_;
- _loc12_ = this.MondePhysique.CreateBody(_loc9_);
- _loc10_ = new b2PolygonDef();
- _loc10_.filter.categoryBits = 4;
- _loc10_.vertexCount = 4;
- _loc10_.vertices[0].Set(-1.66,0);
- _loc10_.vertices[1].Set(1.66,0);
- _loc10_.vertices[2].Set(1.66,0.33);
- _loc10_.vertices[3].Set(-1.66,0.33);
- _loc10_.density = 50;
- _loc10_.friction = 1;
- _loc10_.restitution = 0;
- _loc12_.CreateShape(_loc10_);
- _loc10_ = new b2PolygonDef();
- _loc10_.filter.categoryBits = 4;
- _loc10_.vertexCount = 4;
- _loc10_.vertices[0].Set(-1.33,0);
- _loc10_.vertices[1].Set(-0.33,-0.33);
- _loc10_.vertices[2].Set(0.33,-0.33);
- _loc10_.vertices[3].Set(1.33,0);
- _loc10_.density = 10;
- _loc10_.friction = 0;
- _loc10_.restitution = 1.5;
- _loc12_.CreateShape(_loc10_);
- _loc12_.SetMassFromShapes();
- }
- else
- {
- if(param1 == 8 || param1 == 9)
- {
- if(param1 == 8)
- {
- _loc7_ = 1.66;
- }
- else
- {
- _loc7_ = 3.33;
- }
- _loc8_ = 0.166;
- _loc10_ = new b2PolygonDef();
- _loc10_.filter.categoryBits = 4;
- _loc10_.SetAsBox(_loc7_,_loc8_);
- _loc10_.density = 20;
- _loc10_.friction = 10;
- _loc9_.userData = _loc14_;
- _loc14_.width = _loc7_ * 60;
- _loc12_ = this.MondePhysique.CreateBody(_loc9_);
- _loc12_.CreateShape(_loc10_);
- _loc12_.SetMassFromShapes();
- }
- else
- {
- if(param1 == 10)
- {
- _loc7_ = 0.5;
- _loc8_ = 0.5;
- _loc10_ = new b2PolygonDef();
- _loc10_.filter.categoryBits = 4;
- _loc10_.SetAsBox(_loc7_,_loc8_);
- _loc10_.density = 50;
- _loc10_.friction = 0.2;
- _loc10_.restitution = 0;
- _loc9_.userData = _loc14_;
- _loc14_.width = _loc7_ * 60;
- _loc14_.height = _loc8_ * 60;
- _loc12_ = this.MondePhysique.CreateBody(_loc9_);
- _loc12_.CreateShape(_loc10_);
- _loc13_ = new b2MassData();
- _loc13_.mass = 1000;
- _loc13_.center = new b2Vec2(0,0);
- _loc13_.I = 100;
- _loc12_.SetMass(_loc13_);
- }
- else
- {
- if(param1 > 16 && param1 < 21)
- {
- _loc7_ = 0.5;
- _loc8_ = 0.5;
- _loc11_ = new b2CircleDef();
- _loc11_.filter.categoryBits = 4;
- _loc11_.radius = _loc7_;
- _loc11_.density = 1;
- _loc11_.friction = 0.2;
- _loc11_.restitution = 0.2;
- _loc9_.userData = _loc14_;
- _loc12_ = this.MondePhysique.CreateBody(_loc9_);
- _loc12_.CreateShape(_loc11_);
- _loc13_ = new b2MassData();
- _loc13_.mass = 1000;
- if(param1 == 17)
- {
- _loc12_.m_linearVelocity.y = -20;
- _loc17_ = true;
- }
- else
- {
- if(param1 == 18)
- {
- _loc12_.m_linearVelocity.y = 10;
- _loc17_ = true;
- _loc13_.mass = 2000;
- }
- else
- {
- if(param1 == 19)
- {
- _loc12_.m_linearVelocity.x = 20;
- _loc16_ = true;
- }
- else
- {
- if(param1 == 20)
- {
- _loc12_.m_linearVelocity.x = -20;
- _loc16_ = true;
- }
- }
- }
- }
- _loc13_.center = new b2Vec2(0,0);
- _loc13_.I = 100;
- _loc12_.SetMass(_loc13_);
- }
- else
- {
- if(param1 == 21)
- {
- _loc7_ = 0.5;
- _loc8_ = 0.5;
- _loc11_ = new b2CircleDef();
- _loc11_.filter.categoryBits = 4;
- _loc11_.radius = _loc7_;
- _loc11_.density = 100;
- _loc11_.friction = 30;
- _loc11_.restitution = 0;
- _loc9_.userData = _loc14_;
- _loc12_ = this.MondePhysique.CreateBody(_loc9_);
- _loc12_.CreateShape(_loc11_);
- _loc13_ = new b2MassData();
- _loc13_.mass = 500;
- _loc12_.SetMass(_loc13_);
- }
- }
- }
- }
- }
- }
- }
- }
- this.ClipListeMobile.addChild(_loc14_);
- this.ListeMobile.push(_loc12_);
- _loc14_.CodeObjet = param1;
- _loc14_.x = param2;
- _loc14_.y = param3;
- _loc14_.rotation = param4;
- if(!_loc16_)
- {
- _loc12_.m_linearVelocity.x = param5;
- }
- if(!_loc17_)
- {
- _loc12_.m_linearVelocity.y = param6;
- }
- _loc12_.WakeUp();
- this.Explosion(3,param2 - 10,param3 - 10,10,2,false);
- return _loc12_;
- }
- public var MauvaiseVersion:Boolean;
- public var AnimVignette:Tween;
- public var _Serveur:MovieClip;
- public var $2:String;
- public var $3:String;
- public var $4:String;
- public var $5:String;
- public var $6:String;
- public var $7:String;
- public var $1:String;
- public var NomObjet:Array;
- public var $8:String;
- public var $9:String;
- public var Adresse:String;
- public var ListeMessage:Vector.<String>;
- public function Selection_Objet_Clavier(param1:int) : void {
- if(!this.InvocationEnCours && (this.ListeClipObjet[param1]))
- {
- this.Clique_Placement_Objet(this.ListeClipObjet[param1].Code);
- }
- }
- public function Gravité(param1:$Particule) : void {
- }
- public var InterfaceListeObjet:$Liste;
- public function Boucle_Reveille(param1:Event) : void {
- var _loc2_:int = getTimer();
- this.Envoie_Serveur(this.$4 + this.$2 + this.$1 + (getTimer() - this.TempsZeroBR));
- this.TempsZeroBR = _loc2_;
- if(getTimer() - this.DernièreAction > 1000000 && false)
- {
- this.Serveur.close();
- this.Deconnexion(null);
- this.ClipServeur.Texte.text = "\nVous êtes afk depuis trop longtemps :\'(";
- }
- }
- public function Reception(param1:DataEvent) : void {
- var _loc7_:$Joueur = null;
- var _loc8_:* = 0;
- var _loc9_:b2Body = null;
- var _loc10_:Array = null;
- var _loc11_:* = 0;
- var _loc12_:* = NaN;
- var _loc13_:* = NaN;
- var _loc14_:* = 0;
- var _loc15_:String = null;
- var _loc16_:Array = null;
- var _loc17_:* = NaN;
- var _loc18_:* = false;
- var _loc19_:* = false;
- var _loc20_:* = false;
- var _loc2_:String = param1.data;
- var _loc3_:Array = _loc2_.split(this.$1);
- var _loc4_:String = _loc3_[0];
- var _loc5_:int = _loc4_.charCodeAt(0);
- var _loc6_:int = _loc4_.charCodeAt(1);
- if(_loc5_ == 4)
- {
- if(_loc6_ == 3)
- {
- if(!this.Synchroniseur)
- {
- _loc3_.shift();
- _loc11_ = _loc3_.length;
- _loc14_ = 0;
- while(_loc14_ < _loc11_)
- {
- _loc15_ = _loc3_[_loc14_];
- _loc9_ = this.ListeMobile[_loc14_];
- if(_loc15_ == "x")
- {
- if(_loc9_)
- {
- this.Destruction_Mobile(_loc14_);
- }
- }
- else
- {
- _loc16_ = _loc15_.split(",");
- if(!_loc9_)
- {
- _loc9_ = this.Creation_Objet(_loc16_[0],0,0,0);
- }
- _loc9_.SetXForm(new b2Vec2(_loc16_[1],_loc16_[2]),_loc16_[5]);
- _loc12_ = Number(_loc16_[3]);
- _loc13_ = Number(_loc16_[4]);
- _loc9_.SetLinearVelocity(new b2Vec2(_loc12_,_loc13_));
- _loc17_ = Number(_loc16_[6]);
- _loc9_.SetAngularVelocity(_loc17_);
- if(_loc12_ < 0.01 && -0.01 < _loc12_ && _loc13_ < 0.01 && -0.01 < _loc13_ && _loc17_ < 0.01 && -0.01 < _loc17_)
- {
- _loc9_.PutToSleep();
- }
- else
- {
- _loc9_.WakeUp();
- }
- }
- _loc14_++;
- }
- }
- return;
- }
- if(_loc6_ == 4)
- {
- _loc8_ = int(_loc3_[9]);
- _loc7_ = this.ListeJoueur[_loc8_];
- if((_loc7_) && !_loc7_.ClipJoueur)
- {
- _loc18_ = _loc7_.DroiteEnCours;
- _loc19_ = _loc7_.GaucheEnCours;
- _loc7_.DroiteEnCours = _loc3_[1] == "1";
- _loc7_.GaucheEnCours = _loc3_[2] == "1";
- _loc9_ = _loc7_.Physique;
- _loc9_.SetXForm(new b2Vec2(_loc3_[3],_loc3_[4]),0);
- _loc12_ = Number(_loc3_[5]);
- _loc13_ = Number(_loc3_[6]);
- _loc9_.SetLinearVelocity(new b2Vec2(_loc12_,_loc13_));
- _loc20_ = false;
- if(_loc3_[7] == "1")
- {
- _loc7_.MAJ_Saut(true,_loc3_[8]);
- }
- else
- {
- _loc7_.MAJ_Saut(false);
- }
- if(_loc7_.DroiteEnCours)
- {
- if(!_loc18_)
- {
- _loc7_.Animation_Course(true);
- }
- _loc20_ = true;
- }
- else
- {
- if(_loc7_.GaucheEnCours)
- {
- if(!_loc19_)
- {
- _loc7_.Animation_Course(false);
- }
- _loc20_ = true;
- }
- else
- {
- if((_loc18_) || (_loc19_))
- {
- _loc7_.Animation_Statique(_loc18_);
- }
- }
- }
- if(_loc20_)
- {
- _loc9_.WakeUp();
- }
- else
- {
- if(_loc12_ < 0.01 && -0.01 < _loc12_ && _loc13_ < 0.01 && -0.01 < _loc13_)
- {
- _loc9_.PutToSleep();
- }
- else
- {
- _loc9_.WakeUp();
- }
- }
- }
- return;
- }
- if(_loc6_ == 6)
- {
- _loc9_ = this.ListeMobile[_loc3_[1]];
- if(_loc9_)
- {
- _loc9_.SetXForm(new b2Vec2(0,600),0);
- }
- return;
- }
- if(_loc6_ == 8)
- {
- _loc7_ = this.ListeJoueur[_loc3_[1]];
- if((_loc7_) && !_loc7_.ClipJoueur)
- {
- _loc7_.Vers_La_Droite(_loc3_.length == 2);
- }
- return;
- }
- if(_loc6_ == 20)
- {
- this.Envoie_Serveur(this.$4 + this.$20);
- return;
- }
- }
- if(_loc5_ == 5)
- {
- if(_loc6_ == 5)
- {
- this.Nouvelle_Partie(_loc3_[1]);
- while(this.ClipOP.numChildren)
- {
- this.ClipOP.removeChildAt(0);
- }
- this.ClipInterface._JEV.text = _loc3_[2];
- return;
- }
- if(_loc6_ == 7)
- {
- _loc11_ = _loc3_.length;
- _loc14_ = 1;
- while(_loc14_ < _loc11_)
- {
- this.Création_Lien.apply(this,_loc3_[_loc14_].split(","));
- _loc14_++;
- }
- return;
- }
- if(_loc6_ == 8)
- {
- _loc7_ = this.ListeJoueur[_loc3_[1]];
- if(!_loc7_)
- {
- return;
- }
- if(_loc7_.ClipJoueur)
- {
- return;
- }
- _loc7_.Animation_Invocation(_loc7_.AnimDroite);
- this.Objet_Transparent("O" + _loc3_[1],_loc3_[2],_loc3_[3],_loc3_[4],_loc3_[5]);
- return;
- }
- if(_loc6_ == 9)
- {
- _loc7_ = this.ListeJoueur[_loc3_[1]];
- if(_loc7_)
- {
- _loc7_.Animation_Statique(_loc7_.AnimDroite);
- }
- this.Supprimer_OP("O" + _loc3_[1]);
- return;
- }
- if(_loc6_ == 16)
- {
- this.Déplacement_Fromage(_loc3_[1],_loc3_[2]);
- return;
- }
- if(_loc6_ == 17)
- {
- this.Génération_Explosion(_loc3_[1],_loc3_[2],_loc3_[3],_loc3_[4],_loc3_[5] == "1");
- return;
- }
- if(_loc6_ == 19)
- {
- _loc7_ = this.ListeJoueur[_loc3_[1]];
- if(_loc7_)
- {
- this.Souris_Grosse(_loc7_);
- this.Explosion(3,_loc7_.x - 10,_loc7_.y - 10,10,2,false);
- }
- return;
- }
- if(_loc6_ == 20)
- {
- if(_loc3_.length == 8)
- {
- _loc7_ = this.ListeJoueur[_loc3_[1]];
- if((_loc7_) && (_loc7_.ClipJoueur))
- {
- return;
- }
- this.Creation_Objet(_loc3_[2],_loc3_[3],_loc3_[4],_loc3_[5],_loc3_[6],_loc3_[7]);
- }
- else
- {
- this.Creation_Objet(_loc3_[1],_loc3_[2],_loc3_[3],_loc3_[4],_loc3_[5],_loc3_[6]);
- }
- return;
- }
- if(_loc6_ == 21)
- {
- this.Message_Chat("Vous venez d\'entrer dans le salon [" + _loc3_[1] + "].");
- return;
- }
- }
- if(_loc5_ == 6)
- {
- if(_loc6_ == 6)
- {
- if(_loc3_[2].indexOf("<") != -1)
- {
- return;
- }
- this.Message_Chat(_loc3_[3],_loc3_[2]);
- _loc7_ = this.ListeJoueur[_loc3_[1]];
- this.Affichage_Bulle(_loc7_,_loc3_[3]);
- return;
- }
- if(_loc6_ == 20)
- {
- this.Message_Chat("<BL>" + _loc3_[1],"Serveur");
- return;
- }
- }
- if(_loc5_ == 8)
- {
- if(_loc6_ == 5)
- {
- this.Destruction_Joueur(_loc3_[1],1,_loc3_[3]);
- this.MAJ_InterfaceListeJoueur();
- this.ClipInterface._JEV.text = _loc3_[2];
- return;
- }
- if(_loc6_ == 6)
- {
- this.Destruction_Joueur(_loc3_[1],2,_loc3_[3]);
- this.MAJ_InterfaceListeJoueur();
- this.ClipInterface._JEV.text = _loc3_[2];
- return;
- }
- if(_loc6_ == 7)
- {
- this.Destruction_Joueur(_loc3_[1]);
- this.Message_Chat(_loc3_[2] + " vient de se déconnecter.");
- this.MAJ_InterfaceListeJoueur();
- return;
- }
- if(_loc6_ == 8)
- {
- _loc10_ = _loc3_[1].split(",");
- _loc7_ = this.Creation_Joueur(_loc10_);
- if(!_loc7_.Mort)
- {
- this.ClipListeJoueur.addChildAt(_loc7_,0);
- }
- if(_loc3_.length == 2)
- {
- this.Message_Chat(_loc10_[0] + " vient de se connecter.");
- this.MAJ_InterfaceListeJoueur();
- }
- return;
- }
- if(_loc6_ == 9)
- {
- _loc3_.shift();
- this.Chargement_Liste_Joueur(_loc3_);
- this.MAJ_InterfaceListeJoueur();
- return;
- }
- if(_loc6_ == 20)
- {
- this.Guide = false;
- if(_loc3_[1] == "X")
- {
- this.Guide = true;
- this._I._CH.text = "-";
- }
- else
- {
- if(int(_loc3_[1]) == this.CodeJoueur)
- {
- this.Guide = true;
- }
- _loc7_ = this.ListeJoueur[_loc3_[1]];
- if(_loc7_)
- {
- this._I._CH.text = _loc7_.NomJoueur;
- this.Message_Chat("Suivez votre Chaman " + _loc7_.NomJoueur + " !");
- }
- }
- this.Init_Guide();
- return;
- }
- if(_loc6_ == 21)
- {
- this.Synchroniseur = false;
- if(int(_loc3_[1]) == this.CodeJoueur)
- {
- this.Synchroniseur = true;
- }
- return;
- }
- }
- if(_loc5_ == 26)
- {
- if(_loc6_ == 4)
- {
- this.Message_Chat(_loc3_[1],null,true);
- return;
- }
- if(_loc6_ == 8)
- {
- this.NomJoueur = _loc3_[1];
- this.CodeJoueur = int(_loc3_[2]);
- return;
- }
- if(_loc6_ == 25)
- {
- this.Message_Chat("\n" + _loc3_[2] + "\n<J>Exception pour [" + _loc3_[1] + "]\n");
- return;
- }
- if(_loc6_ == 27)
- {
- this.MauvaiseVersion = false;
- this.ClipIdentification.Version.text = "Version " + this.Version + "\nJoueurs : " + _loc3_[1];
- this.TexteServeur.text = "\nChargement en cours.";
- return;
- }
- }
- trace("Code inconnu : " + _loc5_ + " -> " + _loc6_);
- }
- public function MAJ_ListeJoueur() : void {
- }
- public function Demande_Déplacement_Fromage(param1:int, param2:int) : void {
- this.Envoie_Serveur(this.$5 + this.$16 + this.$1 + param1 + this.$1 + param2);
- }
- public var DernierMessage:String;
- public function Génération_Explosion(param1:int, param2:int, param3:int, param4:int, param5:Boolean=false) : void {
- var _loc6_:* = 0;
- var _loc7_:* = 0;
- var _loc8_:* = 0;
- var _loc9_:* = NaN;
- var _loc10_:* = NaN;
- var _loc11_:* = NaN;
- var _loc12_:* = 0;
- var _loc13_:* = 0;
- var _loc14_:b2Body = null;
- var _loc15_:MovieClip = null;
- this.Explosion(3,param1 - 10,param2 - 10,20,2,false);
- this.Explosion(1,param1 - 10,param2 - 10,20,2,false);
- this.Explosion(2,param1 - 10,param2 - 10,20,2,false);
- this.Explosion(0,param1 - 10,param2 - 10,20,2,false);
- if(!this.ClipJoueur.Mort)
- {
- _loc6_ = this.ClipJoueur.x - param1;
- _loc7_ = this.ClipJoueur.y - param2;
- _loc8_ = Math.sqrt(_loc6_ * _loc6_ + _loc7_ * _loc7_);
- if(_loc8_ < param4)
- {
- _loc9_ = 1 - _loc8_ / param4;
- param3 = param3 * _loc9_;
- _loc10_ = _loc6_ / _loc8_ * param3;
- _loc11_ = _loc7_ / _loc8_ * param3;
- this.ClipJoueur.Physique.SetLinearVelocity(new b2Vec2(_loc10_,_loc11_));
- this.MAJ_Position();
- }
- }
- if((param5) && (this.Synchroniseur))
- {
- _loc12_ = this.ListeMobile.length;
- _loc13_ = 0;
- while(_loc13_ < _loc12_)
- {
- _loc14_ = this.ListeMobile[_loc13_];
- if(_loc14_)
- {
- _loc15_ = _loc14_.m_userData;
- if((_loc15_) && (_loc15_.CodeObjet))
- {
- _loc6_ = _loc15_.x - param1;
- _loc7_ = _loc15_.y - param2;
- _loc8_ = Math.sqrt(_loc6_ * _loc6_ + _loc7_ * _loc7_);
- if(_loc8_ <= param4)
- {
- _loc9_ = 1 - _loc8_ / param4;
- param3 = param3 * _loc9_;
- _loc10_ = _loc6_ / _loc8_ * param3;
- _loc11_ = _loc7_ / _loc8_ * param3;
- _loc14_.SetLinearVelocity(new b2Vec2(_loc10_,_loc11_));
- _loc14_.WakeUp();
- }
- }
- }
- _loc13_++;
- }
- this.MAJ_Position(null,true);
- }
- }
- public var _Vignette:MovieClip;
- public var Version:String;
- public function Affichage_Bulle(param1:$Joueur, param2:String) : void {
- var _loc3_:MovieClip = param1.BulleDialogue;
- _loc3_._T.width = 150;
- _loc3_._T.htmlText = "<N>" + param2;
- var _loc4_:int = _loc3_._T.numLines;
- _loc3_._T.width = _loc3_._T.textWidth + 10;
- if(_loc4_ == 1)
- {
- _loc3_._T.height = 17;
- }
- else
- {
- if(_loc4_ == 2)
- {
- _loc3_._T.height = 29;
- }
- else
- {
- _loc3_._T.height = 41;
- }
- }
- var _loc5_:int = _loc3_._T.width;
- var _loc6_:int = _loc3_._T.height + 4;
- var _loc7_:Graphics = _loc3_.graphics;
- _loc7_.clear();
- _loc7_.beginFill(8948906);
- _loc7_.lineStyle(2,0,1,true);
- _loc7_.drawRoundRect(-2,-2,_loc5_,_loc6_,10,10);
- _loc7_.endFill();
- _loc3_.x = -_loc5_ / 2;
- _loc3_.y = -26 - _loc6_;
- param1.addChild(_loc3_);
- _loc3_.Init();
- }
- public var ClipListeJoueur:MovieClip;
- public var ClipVignette:$ClipVignette;
- public var ListeClipObjet:Array;
- public function Connexion(param1:Event) : void {
- this.Envoie_Serveur(this.Version);
- this.BoucleReveille.addEventListener(TimerEvent.TIMER,this.Boucle_Reveille);
- this.BoucleReveille.start();
- this.TempsZeroBR = getTimer();
- this.ClipIdentification.visible = true;
- this.TexteServeur.visible = false;
- }
- public function Chargement_Liste_Joueur(param1:Array) : void {
- var _loc2_:$Joueur = null;
- var _loc5_:Array = null;
- var _loc6_:$Joueur = null;
- for each (_loc2_ in this.ListeJoueur)
- {
- this.MondePhysique.DestroyBody(_loc2_.Physique);
- }
- while(this.ClipListeJoueur.numChildren)
- {
- this.ClipListeJoueur.removeChildAt(0);
- }
- this.ListeJoueur = new Dictionary();
- if(this.ClipJoueur)
- {
- this.ClipJoueur.DroiteEnCours = false;
- this.ClipJoueur.GaucheEnCours = false;
- }
- var _loc3_:int = param1.length;
- var _loc4_:* = 0;
- while(_loc4_ < _loc3_)
- {
- _loc5_ = param1[_loc4_].split(",");
- _loc6_ = this.Creation_Joueur(_loc5_);
- if(!_loc6_.Mort)
- {
- this.ClipListeJoueur.addChild(_loc6_);
- }
- _loc4_++;
- }
- if((this.ClipJoueur) && !this.ClipJoueur.Mort)
- {
- this.ClipListeJoueur.addChild(this.ClipJoueur);
- }
- }
- public var LimiteChat:int;
- public var Guide:Boolean;
- public function Clique_Guide(param1:MouseEvent) : void {
- this.AutoClou = false;
- var _loc2_:MovieClip = param1.currentTarget as MovieClip;
- this.Clique_Placement_Objet(_loc2_.Code);
- }
- public function Message_Chat(param1:String, param2:String=null, param3:Boolean=false) : void {
- var _loc4_:String = null;
- if(param2 == null)
- {
- if(param3)
- {
- _loc4_ = "<ROSE>[*] [Serveur] " + param1;
- }
- else
- {
- _loc4_ = "<G>" + param1;
- }
- }
- else
- {
- _loc4_ = "<ROSE>[" + param2 + "] <N>" + param1;
- }
- if(this.ListeMessage.length > 150)
- {
- this.ListeMessage.shift();
- }
- this.ListeMessage.push(_loc4_);
- var _loc5_:* = this.TexteChat.scrollV == this.TexteChat.maxScrollV;
- this.TexteChat.htmlText = this.ListeMessage.join("\n");
- if(_loc5_)
- {
- this.AscenseurChat.Rendu_Ascenseur(2);
- }
- else
- {
- this.AscenseurChat.Rendu_Ascenseur(1);
- }
- }
- public function Boucle_Placement(param1:MouseEvent) : void {
- if(!this.InvocationEnCours)
- {
- this.ObjetEnCours.x = mouseX;
- this.ObjetEnCours.y = mouseY;
- param1.updateAfterEvent();
- }
- }
- public var ListeMobile:Array;
- public function Vignette_Off(param1:MouseEvent) : void {
- this.AnimVignette.stop();
- this.AnimVignette.begin = this._Vignette.alpha;
- this.AnimVignette.finish = 0;
- this.AnimVignette.start();
- }
- public var DébutInvocation:int;
- public var m_timeStep:Number;
- public var TempsZeroBR:int;
- public function MAJ_InterfaceListeJoueur() : void {
- var _loc1_:$Joueur = null;
- var _loc2_:MovieClip = null;
- this.InterfaceListeJoueur.Vider();
- for each (_loc1_ in this.ListeJoueur)
- {
- _loc2_ = new $NomJoueur();
- _loc2_.Score = _loc1_.Score;
- _loc2_._N.mouseEnabled = false;
- _loc2_._N.styleSheet = this.StyleTexte;
- if(_loc1_.ClipJoueur)
- {
- _loc2_._N.htmlText = "<ROSE>" + _loc1_.NomJoueur + " <BV>" + _loc1_.Score;
- }
- else
- {
- _loc2_._N.htmlText = _loc1_.NomJoueur + " <BV>" + _loc1_.Score;
- }
- this.InterfaceListeJoueur.Ajout_Element(_loc2_);
- }
- this.InterfaceListeJoueur.Rendu("Score",Array.NUMERIC | Array.DESCENDING);
- this.InterfaceListeJoueur.Position(1);
- }
- public function Création_Clou(param1:int, param2:int, param3:int) : void {
- var _loc10_:b2Body = null;
- var _loc11_:b2Body = null;
- var _loc12_:MovieClip = null;
- var _loc13_:String = null;
- var _loc14_:b2Vec2 = null;
- var _loc15_:* = 0;
- var _loc16_:b2Body = null;
- var _loc17_:b2Vec2 = null;
- var _loc18_:* = NaN;
- var _loc19_:* = NaN;
- var _loc20_:* = NaN;
- var _loc21_:* = 0;
- var _loc22_:b2Vec2 = null;
- var _loc23_:* = NaN;
- var _loc24_:* = NaN;
- var _loc25_:* = NaN;
- var _loc26_:* = 0;
- var _loc4_:Boolean = param1 == 11 || param1 == 12 || param1 == 13;
- var _loc5_:Array = new Array();
- var _loc6_:int = this.ListeMobile.length;
- var _loc7_:* = 0;
- while(_loc7_ < _loc6_)
- {
- _loc11_ = this.ListeMobile[_loc7_];
- if(_loc11_)
- {
- _loc12_ = _loc11_.m_userData as MovieClip;
- if(!((_loc4_) && (_loc12_.Sol)))
- {
- if(_loc12_.hitTestPoint(param2,param3,true))
- {
- _loc5_.push(_loc11_);
- }
- }
- }
- _loc7_++;
- }
- var _loc8_:int = _loc5_.length;
- var _loc9_:* = 0;
- if(_loc8_ == 0)
- {
- return;
- }
- if(!_loc4_)
- {
- if(_loc8_ == 1)
- {
- return;
- }
- _loc10_ = _loc5_[0];
- _loc9_ = 1;
- }
- else
- {
- _loc10_ = this.PhysiqueSol;
- }
- if(_loc8_)
- {
- _loc13_ = this.$5 + this.$7;
- _loc14_ = new b2Vec2(param2 / 30,param3 / 30);
- _loc15_ = _loc9_;
- while(_loc15_ < _loc8_)
- {
- _loc16_ = _loc5_[_loc15_];
- _loc17_ = _loc16_.GetLocalPoint(_loc14_);
- _loc18_ = int(_loc17_.x * 1000) / 1000;
- _loc19_ = int(_loc17_.y * 1000) / 1000;
- _loc20_ = int(_loc16_.GetAngle() * 1000) / 1000;
- if(_loc16_ == this.PhysiqueSol)
- {
- _loc21_ = -2;
- }
- else
- {
- _loc21_ = this.ListeMobile.indexOf(_loc16_);
- }
- _loc22_ = _loc10_.GetLocalPoint(_loc14_);
- _loc23_ = int(_loc22_.x * 1000) / 1000;
- _loc24_ = int(_loc22_.y * 1000) / 1000;
- _loc25_ = int(_loc10_.GetAngle() * 1000) / 1000;
- if(_loc10_ == this.PhysiqueSol)
- {
- _loc26_ = -2;
- }
- else
- {
- _loc26_ = this.ListeMobile.indexOf(_loc10_);
- }
- _loc13_ = _loc13_ + (this.$1 + param1 + "," + _loc21_ + "," + _loc18_ + "," + _loc19_ + "," + _loc20_ + "," + _loc26_ + "," + _loc23_ + "," + _loc24_ + "," + _loc25_);
- _loc10_ = _loc16_;
- _loc15_++;
- }
- this.Envoie_Serveur(_loc13_);
- }
- }
- public function Explosion(param1:int, param2:int, param3:int, param4:int, param5:int, param6:Boolean=true) : void {
- var _loc9_:$Particule = null;
- var _loc10_:* = NaN;
- var _loc11_:* = NaN;
- var _loc7_:$ParticuleZero = this.ListeParticule[param1];
- var _loc8_:* = 0;
- while(_loc8_ < param4)
- {
- _loc9_ = new $Particule(_loc7_,false);
- _loc9_.Gravité = param6;
- this.ParticuleZone.ListeParticule.push(_loc9_);
- _loc9_.x = param2;
- _loc9_.y = param3;
- _loc10_ = Math.random() * 3.14 - 1.57;
- _loc11_ = Math.random() * param5;
- if(_loc8_ % 2 == 0)
- {
- _loc9_.Vx = -Math.cos(_loc10_) * _loc11_ * 2;
- }
- else
- {
- _loc9_.Vx = Math.cos(_loc10_) * _loc11_ * 2;
- }
- _loc9_.Vy = Math.sin(_loc10_) * _loc11_;
- _loc8_++;
- }
- this.ParticuleZone.DemandeRendu = true;
- }
- public var worldAABB:b2AABB;
- public var TINV:int;
- public var Fx:Number;
- public var Fy:Number;
- public var MasseSourisBase:b2MassData;
- public function Mobile_Statique(param1:MovieClip, param2:Array) : b2PolygonDef {
- var _loc7_:* = NaN;
- var _loc8_:* = NaN;
- var _loc3_:b2PolygonDef = new b2PolygonDef();
- var _loc4_:int = param2.length;
- _loc3_.vertexCount = _loc4_ / 2;
- _loc3_.filter.categoryBits = 4;
- _loc3_.friction = 0.3;
- _loc3_.density = 0;
- if(param1)
- {
- param1.graphics.lineStyle(2);
- param1.graphics.beginFill(6788234);
- }
- var _loc5_:* = 0;
- var _loc6_:* = 0;
- while(_loc6_ < _loc4_)
- {
- _loc7_ = param2[_loc6_];
- _loc8_ = param2[_loc6_ + 1];
- _loc3_.vertices[_loc5_].Set(_loc7_ / 30,_loc8_ / 30);
- if(param1)
- {
- if(_loc6_ == 0)
- {
- param1.graphics.moveTo(_loc7_,_loc8_);
- }
- else
- {
- param1.graphics.lineTo(_loc7_,_loc8_);
- }
- }
- _loc5_++;
- _loc6_ = _loc6_ + 2;
- }
- if(param1)
- {
- param1.graphics.endFill();
- }
- return _loc3_;
- }
- public function Vignette_On(param1:MouseEvent) : void {
- this._Vignette.x = mouseX;
- if(this._Vignette.x > this.LimiteX)
- {
- this._Vignette.x = this.LimiteX;
- }
- this._Vignette.y = mouseY + 22;
- if(this._Vignette.y > this.LimiteY)
- {
- this._Vignette.y = this.LimiteY;
- }
- param1.updateAfterEvent();
- }
- public var ClipMonde:MovieClip;
- public function Init_Guide() : void {
- var _loc1_:Array = null;
- var _loc2_:MovieClip = null;
- var _loc3_:* = 0;
- var _loc4_:* = 0;
- var _loc5_:* = 0;
- var _loc6_:* = 0;
- var _loc7_:* = 0;
- var _loc8_:* = 0;
- var _loc9_:* = 0;
- var _loc10_:* = 0;
- var _loc11_:* = false;
- var _loc12_:* = 0;
- var _loc13_:ApplicationDomain = null;
- var _loc14_:MovieClip = null;
- var _loc15_:MovieClip = null;
- var _loc16_:MovieClip = null;
- var _loc17_:* = NaN;
- if(this.Guide)
- {
- this.ListeClipObjet = new Array();
- this.AutoClou = false;
- this.InterfaceListeObjet.Vider();
- _loc1_ = this.ListeObjetDispo.slice();
- if(this.Monde.ObjetInterdit)
- {
- _loc5_ = this.Monde.ObjetInterdit.length;
- _loc6_ = 0;
- while(_loc6_ < _loc5_)
- {
- _loc7_ = this.Monde.ObjetInterdit[_loc6_];
- _loc8_ = _loc1_.length;
- _loc9_ = 0;
- while(_loc9_ < _loc8_)
- {
- if(_loc1_[_loc9_] == _loc7_)
- {
- _loc1_.splice(_loc9_,1);
- break;
- }
- _loc9_++;
- }
- _loc6_++;
- }
- }
- _loc3_ = _loc1_.length;
- _loc4_ = 0;
- while(_loc4_ < _loc3_)
- {
- _loc10_ = _loc1_[_loc4_];
- _loc11_ = _loc1_[_loc4_ + 1];
- _loc12_ = _loc1_[_loc4_ + 1];
- _loc13_ = this.loaderInfo.applicationDomain;
- _loc14_ = $Res.Pouf("$Objet_" + _loc10_);
- _loc15_ = $Res.Pouf("$Objet_" + _loc12_);
- _loc16_ = new $ObjetInterface();
- _loc16_._O1.addChild(_loc14_);
- this.ListeClipObjet.push(_loc16_._O1);
- if(_loc11_)
- {
- _loc16_._O2.addChild(_loc15_);
- this.ListeClipObjet.push(_loc16_._O2);
- }
- _loc16_.x = 2;
- _loc16_._O1.buttonMode = true;
- _loc16_._O1.useHandCursor = true;
- _loc16_._O1.mouseChildren = false;
- _loc16_._O2.buttonMode = true;
- _loc16_._O2.useHandCursor = true;
- _loc16_._O2.mouseChildren = false;
- _loc16_._O1.Code = _loc10_;
- _loc16_._O2.Code = _loc12_;
- if(!_loc2_)
- {
- _loc2_ = _loc16_._O1;
- }
- _loc14_.x = 32;
- _loc14_.y = 20;
- _loc15_.x = 32;
- _loc15_.y = 20;
- if(_loc14_.height > 36)
- {
- _loc17_ = 36 / _loc14_.height;
- _loc14_.height = 36;
- _loc14_.width = _loc14_.width * _loc17_;
- }
- if(_loc14_.width > 61)
- {
- _loc17_ = 61 / _loc14_.width;
- _loc14_.width = 61;
- _loc14_.height = _loc14_.height * _loc17_;
- }
- if(_loc11_)
- {
- if(_loc15_.height > 36)
- {
- _loc17_ = 36 / _loc15_.height;
- _loc15_.height = 36;
- _loc15_.width = _loc15_.width * _loc17_;
- }
- if(_loc15_.width > 61)
- {
- _loc17_ = 61 / _loc15_.width;
- _loc15_.width = 61;
- _loc15_.height = _loc15_.height * _loc17_;
- }
- }
- _loc16_._O1.addEventListener(MouseEvent.MOUSE_DOWN,this.Clique_Guide);
- if(_loc11_)
- {
- _loc16_._O2.addEventListener(MouseEvent.MOUSE_DOWN,this.Clique_Guide);
- }
- this.Vignette(_loc16_._O1,this.NomObjet[_loc10_]);
- if(_loc11_)
- {
- this.Vignette(_loc16_._O2,this.NomObjet[_loc12_]);
- }
- this.InterfaceListeObjet.Ajout_Element(_loc16_);
- _loc4_ = _loc4_ + 2;
- }
- this.InterfaceListeObjet.Rendu();
- }
- else
- {
- this.Annulation_Placement_Objet();
- this.InterfaceListeObjet.Vider();
- }
- this.InterfaceListeObjet.Position(0);
- }
- public function Envoie_Exception(param1:Error) : void {
- this.Envoie_Serveur(this.$26 + this.$25 + this.$1 + param1.getStackTrace());
- }
- public function Destruction_Mobile(param1:int) : void {
- var _loc2_:b2Body = this.ListeMobile[param1];
- if(_loc2_)
- {
- this.ListeMobile[param1] = null;
- if(_loc2_.m_userData.parent)
- {
- _loc2_.m_userData.parent.removeChild(_loc2_.m_userData);
- }
- this.MondePhysique.DestroyBody(_loc2_);
- }
- }
- public var ListeParticuleAnimation:Array;
- public var SalonCible:String;
- public var Gy:Number;
- public function Déplacement_Fromage(param1:int, param2:int) : void {
- this.ListeFromage[0] = param1;
- this.ListeFromage[1] = param2;
- this.ClipFromage.x = param1;
- this.ClipFromage.y = param2;
- }
- public var ClipObjetEnCours:MovieClip;
- public var Admin:Boolean;
- public function Clou_Mouvement() : void {
- if(this.AutoClouDécalage < 0)
- {
- this.AutoClouDécalage = 0;
- }
- else
- {
- if(this.AutoClouDécalage == 0)
- {
- this.AutoClouDécalage = int(this.VraiLargeur / 2 - 5);
- }
- else
- {
- this.AutoClouDécalage = -int(this.VraiLargeur / 2 - 5);
- }
- }
- this.MAJ_AutoClou();
- }
- public function Erreur_Ressource(param1:String) : void {
- this.Message_Chat("<font color=\'#FF0000\'>Impossible de charger le clip [" + param1 + "].");
- }
- public var Synchroniseur:Boolean;
- public function Chargement_Ok(param1:Event) : void {
- var _loc2_:MovieClip = $Res.Pouf("FondCarte");
- _loc2_.mouseEnabled = false;
- _loc2_.mouseChildren = false;
- _loc2_.cacheAsBitmap = true;
- this._M.addChildAt(_loc2_,0);
- this.Init_Serveur();
- this.Initialisation_Particule();
- }
- public var AscenseurChat:$Ascenseur;
- public var $11:String;
- public var DernièreAction:int;
- public var PhysiqueSol:b2Body;
- public var $14:String;
- public var $15:String;
- public var $16:String;
- public var $17:String;
- public var $18:String;
- public var $19:String;
- public function Clique_Placement_Objet(param1:int) : void {
- this.Annulation_Placement_Objet();
- this.ObjetEnCours = this.Objet_Transparent("OB",param1,this.ClipMonde.mouseX,this.ClipMonde.mouseY + 3,0);
- stage.addEventListener(MouseEvent.MOUSE_MOVE,this.Boucle_Placement);
- stage.addEventListener(MouseEvent.MOUSE_WHEEL,this.Boucle_Molette);
- this.ClipMonde.addEventListener(MouseEvent.MOUSE_DOWN,this.Validation_Placement_Objet);
- this.MAJ_Force_Porté();
- this.ObjetEnCours.Code = param1;
- this.HorsDePorté = false;
- }
- public var PosFinObjetX:int;
- public var ClipOP:MovieClip;
- public var $12:String;
- public var MondePhysique:b2World;
- public function Creation_Joueur(param1:Array) : $Joueur {
- var _loc2_:String = param1[0];
- var _loc3_:int = int(param1[1]);
- var _loc4_:* = param1[2] == "1";
- var _loc5_:int = int(param1[3]);
- var _loc6_:* = param1[4] == "1";
- var _loc7_:b2BodyDef = new b2BodyDef();
- _loc7_.position.x = this.PosDépartX / 30;
- _loc7_.position.y = this.PosDépartY / 30;
- _loc7_.fixedRotation = true;
- var _loc8_:$Joueur = new $Joueur(_loc2_);
- _loc8_.Mort = _loc4_;
- _loc8_.CodeJoueur = _loc3_;
- _loc8_.Score = _loc5_;
- _loc7_.userData = _loc8_;
- if(_loc3_ == this.CodeJoueur)
- {
- this.ClipJoueur = _loc8_;
- _loc8_.ClipJoueur = true;
- _loc8_.NomTexte.textColor = 12763866;
- }
- var _loc9_:b2Body = this.MondePhysique.CreateBody(_loc7_);
- _loc8_.Physique = _loc9_;
- this.CollisionJoueur = this.Monde.CollisionJoueur;
- if(this.CollisionJoueur)
- {
- this.ClipJoueurProp.filter.categoryBits = 4;
- }
- else
- {
- this.ClipJoueurProp.filter.categoryBits = 2;
- }
- _loc9_.CreateShape(this.ClipJoueurProp);
- if(_loc6_)
- {
- this.Souris_Grosse(_loc8_);
- }
- else
- {
- _loc9_.SetMass(this.MasseSourisBase);
- }
- if(_loc3_ == this.CodeJoueur)
- {
- _loc9_.AllowSleeping(false);
- }
- this.ListeJoueur[_loc3_] = _loc8_;
- return _loc8_;
- }
- public function Vignette(param1:Object, param2:String, param3:int=0, param4:int=0, param5:int=0, param6:int=0) : void {
- param1.mouseEnabled = true;
- param1.VignetteTexte = param2;
- param1.VignetteFixe = param3;
- if(param3)
- {
- param1.VignetteFixeX = param4;
- param1.VignetteFixeY = param5;
- }
- param1.VignetteLargeur = param6;
- param1.addEventListener(MouseEvent.MOUSE_OVER,this.Vignette_RollOver);
- param1.addEventListener(MouseEvent.ROLL_OUT,this.Vignette_Off);
- }
- public function Supprimer_OP(param1:String) : void {
- var _loc2_:DisplayObject = this.ClipOP.getChildByName(param1);
- if(_loc2_)
- {
- this.ClipOP.removeChild(_loc2_);
- }
- }
- public function Initialisation_Particule() : void {
- var Clip:MovieClip = null;
- var AnimStatique:MovieClip = $Res.Pouf("AnimStatique");
- var AnimCourse:MovieClip = $Res.Pouf("AnimCourse");
- var AnimInvoc:MovieClip = $Res.Pouf("AnimInvoc");
- $Joueur.Anim_Statique_Base = new $ParticuleZero(AnimStatique);
- $Joueur.Anim_Course_Base = new $ParticuleZero(AnimCourse);
- $Joueur.Anim_Invoc_Base = new $ParticuleZero(AnimInvoc);
- var ClipGrosse:MovieClip = $Res.Pouf("FromageSouris");
- AnimStatique.ClipGrosse.addChild(ClipGrosse);
- $Joueur.Anim_Statique_Base_G = new $ParticuleZero(AnimStatique);
- AnimCourse.ClipGrosse.addChild(ClipGrosse);
- $Joueur.Anim_Course_Base_G = new $ParticuleZero(AnimCourse);
- AnimInvoc.ClipGrosse.addChild(ClipGrosse);
- $Joueur.Anim_Invoc_Base_G = new $ParticuleZero(AnimInvoc);
- var i:int = 0;
- while(true)
- {
- try
- {
- Clip = $Res.Pouf("$P" + i,true);
- i++;
- if(Clip)
- {
- this.ListeParticule.push(new $ParticuleZero(Clip));
- }
- else
- {
- break;
- }
- }
- catch(E:Error)
- {
- return;
- }
- }
- }
- public var $20:String;
- public var $21:String;
- public var $22:String;
- public function Chargement_Ressources() : void {
- var _loc3_:Date = null;
- var _loc1_:Loader = new Loader();
- _loc1_.contentLoaderInfo.addEventListener(Event.COMPLETE,this.Chargement_Ok);
- $Res.Bibliothèque = new ApplicationDomain(ApplicationDomain.currentDomain);
- var _loc2_:LoaderContext = new LoaderContext(false,$Res.Bibliothèque);
- if(this.Domaine != "127.0.0.1")
- {
- _loc1_.load(new URLRequest("./Ressources.swf"),_loc2_);
- }
- else
- {
- _loc3_ = new Date();
- _loc1_.load(new URLRequest("././././././././././././././././Ressources.swf?n=" + _loc3_.getTime()),_loc2_);
- }
- }
- public var $24:String;
- public var $25:String;
- public var $26:String;
- public var $27:String;
- public function Annulation_Placement_Objet() : void {
- if(this.ObjetEnCours)
- {
- stage.removeEventListener(MouseEvent.MOUSE_MOVE,this.Boucle_Placement);
- stage.removeEventListener(MouseEvent.MOUSE_WHEEL,this.Boucle_Molette);
- this.ClipMonde.removeEventListener(MouseEvent.MOUSE_DOWN,this.Validation_Placement_Objet);
- if(this.ObjetEnCours.parent)
- {
- this.ClipOP.removeChild(this.ObjetEnCours);
- }
- this.ObjetEnCours = null;
- }
- }
- public var PosFinObjetY:int;
- public function Mouvement(param1:$Particule) : void {
- param1.x = param1.x + param1.Vx;
- if(param1.Vx < 0)
- {
- param1.Vx = param1.Vx + (param1.Fx + this.Fx);
- if(param1.Vx > 0)
- {
- param1.Vx = param1.Ax;
- }
- else
- {
- if(param1.Ax > 0 || -param1.Vmax < param1.Vx)
- {
- param1.Vx = param1.Vx + param1.Ax;
- }
- }
- }
- else
- {
- param1.Vx = param1.Vx - (param1.Fx + this.Fx);
- if(param1.Vx < 0)
- {
- param1.Vx = param1.Ax;
- }
- else
- {
- if(param1.Ax < 0 || param1.Vx < param1.Vmax)
- {
- param1.Vx = param1.Vx + param1.Ax;
- }
- }
- }
- param1.y = param1.y + param1.Vy;
- if(param1.Gravité)
- {
- param1.Vy = param1.Vy + this.Gy;
- }
- if(param1.Vy < 0)
- {
- param1.Vy = param1.Vy + (param1.Fy + this.Fy);
- if(param1.Vy > 0)
- {
- param1.Vy = param1.Ay;
- }
- else
- {
- if(param1.Ay > 0)
- {
- param1.Vy = param1.Vy + param1.Ay;
- }
- }
- }
- else
- {
- param1.Vy = param1.Vy - (param1.Fy + this.Fy);
- if(param1.Vy < 0)
- {
- param1.Vy = param1.Ay;
- }
- else
- {
- if(param1.Ay < 0)
- {
- param1.Vy = param1.Vy + param1.Ay;
- }
- }
- }
- }
- public var TimerPosition:Timer;
- public var LimiteY:int;
- public function Création_Objet_Monde(param1:int, param2:int, param3:int, param4:int=0, param5:Number=0, param6:Number=0) : void {
- this.Envoie_Serveur(this.$5 + this.$21 + this.$1 + param1 + this.$1 + param2 + this.$1 + param3 + this.$1 + param4 + this.$1 + param5 + this.$1 + param6);
- }
- public function Deconnexion(param1:Event) : void {
- this.MoteurActif = false;
- stage.removeEventListener(Event.ENTER_FRAME,this.Boucle_Moteur);
- this.TimerPosition.stop();
- this.BoucleReveille.stop();
- var _loc2_:int = numChildren;
- var _loc3_:* = 0;
- while(_loc3_ < _loc2_)
- {
- getChildAt(_loc3_).visible = false;
- _loc3_++;
- }
- if(this.MauvaiseVersion)
- {
- this.ClipServeur.Texte.text = "\nVotre version du jeu est incorrecte :\'(";
- }
- else
- {
- this.ClipServeur.Texte.text = "\nLa connexion avec le serveur vient d\'être interrompue :\'(";
- }
- addChild(this.ClipServeur);
- this.ClipServeur.visible = true;
- this.TexteServeur.visible = true;
- this.ClipIdentification.visible = false;
- this.Serveur.removeEventListener(Event.CONNECT,this.Connexion);
- this.Serveur.removeEventListener(Event.CLOSE,this.Deconnexion);
- this.Serveur.removeEventListener(IOErrorEvent.IO_ERROR,this.Connexion_Impossible);
- this.Serveur.removeEventListener(SecurityErrorEvent.SECURITY_ERROR,this.Connexion_Interdite);
- this.Serveur.removeEventListener(DataEvent.DATA,this.Reception);
- }
- public var ClipListeMobile:MovieClip;
- public var TempsPartieZéro:int;
- public var NombreObjet:int;
- public var MoteurActif:Boolean;
- public var InterfaceListeJoueur:$Liste;
- public var ClipJoueur:$Joueur;
- public function Souris_Grosse(param1:$Joueur) : void {
- param1.Grosse = true;
- param1.MAJ_Grosse();
- param1.Physique.SetMass(this.MasseSourisGrosse);
- }
- public var ClipFromage:MovieClip;
- public var LimiteX:int;
- public function MAJ_AutoClou() : void {
- var _loc1_:MovieClip = this.ObjetEnCours.getChildAt(this.ObjetEnCours.numChildren-1) as MovieClip;
- _loc1_.x = this.AutoClouDécalage;
- }
- public var AutoClouCode:int;
- public var ListeObjetDispo:Array;
- public var InvocationEnCours:Boolean;
- public var BoucleReveille:Timer;
- public const CouleurZéro:ColorTransform = new ColorTransform(1,1,1,0.5,128);
- public var ClipStatique:MovieClip;
- public function Clavier1(param1:KeyboardEvent) : void {
- var _loc3_:String = null;
- var _loc4_:b2Vec2 = null;
- var _loc5_:* = 0;
- var _loc6_:ApplicationDomain = null;
- var _loc7_:MovieClip = null;
- var _loc2_:int = param1.keyCode;
- if(stage.focus == this.CE)
- {
- if(_loc2_ == 13)
- {
- _loc3_ = this.CE.text;
- this.CE.text = "";
- while(_loc3_.substr(0,1) == " ")
- {
- _loc3_ = _loc3_.substr(1);
- }
- while(_loc3_.charAt(_loc3_.length-1) == " ")
- {
- _loc3_ = _loc3_.substr(0,-1);
- }
- if(_loc3_ == "")
- {
- stage.focus = stage;
- return;
- }
- if(getTimer() - this.LimiteChat < 1000 && !this.Admin)
- {
- this.Message_Chat("Doucement, merci.");
- return;
- }
- if(_loc3_.charAt(0) == "/")
- {
- this.LimiteChat = getTimer();
- this.Envoie_Serveur(this.$6 + this.$26 + this.$1 + _loc3_.substr(1));
- stage.focus = stage;
- return;
- }
- if(this.DernierMessage == _loc3_ && !this.Admin)
- {
- this.Message_Chat("Votre dernier message est identique.");
- return;
- }
- _loc3_ = _loc3_.replace(new RegExp("<","g"),"<");
- this.LimiteChat = getTimer();
- this.DernierMessage = _loc3_;
- this.Envoie_Serveur(this.$6 + this.$6 + this.$1 + _loc3_);
- stage.focus = stage;
- }
- }
- else
- {
- if((this.ClipJoueur) && !this.ClipJoueur.Mort)
- {
- if((_loc2_ == 68 || _loc2_ == 39) && !this.ClipJoueur.DroiteEnCours && !this.InvocationEnCours)
- {
- this.ClipJoueur.DroiteEnCours = true;
- this.ClipJoueur.GaucheEnCours = false;
- this.ClipJoueur.Animation_Course(true);
- this.MAJ_Position();
- return;
- }
- if((_loc2_ == 81 || _loc2_ == 37) && !this.ClipJoueur.GaucheEnCours && !this.InvocationEnCours)
- {
- this.ClipJoueur.GaucheEnCours = true;
- this.ClipJoueur.DroiteEnCours = false;
- this.ClipJoueur.Animation_Course(false);
- this.MAJ_Position();
- return;
- }
- if(_loc2_ == 90 || _loc2_ == 38)
- {
- if((this.SautDisponible) && !this.InvocationEnCours)
- {
- this.SautDisponible = false;
- this.DernierSaut = getTimer();
- this.ClipJoueur.Physique.m_linearVelocity.y = -5;
- this.ClipJoueur.Physique.WakeUp();
- this.ClipJoueur.MAJ_Saut(true);
- this.MAJ_Position();
- return;
- }
- }
- else
- {
- if(_loc2_ == 83)
- {
- this.Annulation_Placement_Objet();
- }
- else
- {
- if(_loc2_ == 32)
- {
- _loc4_ = this.ClipJoueur.Physique.GetLinearVelocity();
- }
- else
- {
- if(_loc2_ >= 49 && _loc2_ <= 57)
- {
- this.Selection_Objet_Clavier(_loc2_ - 49);
- }
- }
- }
- }
- }
- if(_loc2_ == 67 || _loc2_ == 86 || _loc2_ == 66)
- {
- if(this.ObjetEnCours)
- {
- if((this.AutoClou) && this.DernierCodeClou == _loc2_)
- {
- this.Clou_Mouvement();
- return;
- }
- this.DernierCodeClou = _loc2_;
- this.AutoClou = !this.AutoClou;
- _loc5_ = this.ObjetEnCours.rotation;
- this.Clique_Placement_Objet(this.ObjetEnCours.Code);
- if(_loc2_ == 67)
- {
- this.AutoClouCode = 22;
- }
- else
- {
- if(_loc2_ == 86)
- {
- this.AutoClouCode = 14;
- }
- else
- {
- if(_loc2_ == 66)
- {
- this.AutoClouCode = 15;
- }
- }
- }
- if(this.AutoClou)
- {
- this.AutoClouDécalage = 0;
- _loc6_ = this.loaderInfo.applicationDomain;
- _loc7_ = $Res.Pouf("$Objet_" + this.AutoClouCode);
- this.ObjetEnCours.addChild(_loc7_);
- this.VraiLargeur = this.ObjetEnCours.width;
- }
- this.ObjetEnCours.rotation = _loc5_;
- }
- return;
- }
- if(_loc2_ == 13)
- {
- stage.focus = this.CE;
- }
- else
- {
- if(_loc2_ == 27)
- {
- this.Annulation_Placement_Objet();
- }
- }
- }
- }
- public var CacheObjet:Array;
- public var VignetteEnCours:Object;
- public var ClipInterface:MovieClip;
- public var CollisionJoueur:Boolean;
- public function Nouvelle_Partie(param1:int) : void {
- this.ClipServeur.visible = false;
- this.ClipInterface.visible = true;
- this.ClipMonde.visible = true;
- this.TempsPartieZéro = getTimer();
- while(this.ClipListeMobile.numChildren)
- {
- this.ClipListeMobile.removeChildAt(0);
- }
- var _loc2_:Array = new Array();
- var _loc3_:b2Body = this.MondePhysique.m_bodyList;
- while(_loc3_)
- {
- _loc2_.push(_loc3_);
- _loc3_ = _loc3_.m_next;
- }
- var _loc4_:int = _loc2_.length;
- var _loc5_:* = 0;
- while(_loc5_ < _loc4_)
- {
- this.MondePhysique.DestroyBody(_loc2_[_loc5_]);
- _loc5_++;
- }
- this.worldAABB = new b2AABB();
- this.worldAABB.lowerBound.Set(-100,-100);
- this.worldAABB.upperBound.Set(100,100);
- this.MondePhysique = new b2World(this.worldAABB,new b2Vec2(0.0,10),true);
- this.ListeMobile = new Array();
- this.Monde = $Res.Pouf("$Monde_" + param1);
- this.ClipInterface._M.text = String(param1);
- this.Monde.Initialisation(this,this.ClipListeMobile);
- this.TempsZéro = getTimer();
- this.TimerPosition.start();
- this.MoteurActif = true;
- this.SautDisponible = true;
- }
- public var ListeFromage:Array;
- public function Clavier2(param1:KeyboardEvent) : void {
- var _loc2_:* = 0;
- var _loc3_:* = false;
- var _loc4_:b2Vec2 = null;
- this.DernièreAction = getTimer();
- if(stage.focus != this.CE)
- {
- _loc2_ = param1.keyCode;
- if(this.ClipJoueur)
- {
- _loc3_ = false;
- if((_loc2_ == 68 || _loc2_ == 39) && !this.InvocationEnCours)
- {
- this.ClipJoueur.DroiteEnCours = false;
- if(!this.ClipJoueur.GaucheEnCours)
- {
- this.ClipJoueur.Animation_Statique(true);
- _loc3_ = true;
- }
- }
- else
- {
- if((_loc2_ == 81 || _loc2_ == 37) && !this.InvocationEnCours)
- {
- this.ClipJoueur.GaucheEnCours = false;
- if(!this.ClipJoueur.DroiteEnCours)
- {
- this.ClipJoueur.Animation_Statique(false);
- _loc3_ = true;
- }
- }
- }
- if(_loc3_)
- {
- _loc4_ = this.ClipJoueur.Physique.GetLinearVelocity();
- if(_loc4_.x < this.VitesseJoueur + 1 && -this.VitesseJoueur-1 < _loc4_.x)
- {
- }
- this.MAJ_Position();
- }
- }
- }
- }
- public var CouleurBleue:ColorTransform;
- public function Boucle_Moteur(param1:Event) : void {
- var _loc2_:* = 0;
- var _loc3_:* = 0;
- var _loc4_:* = false;
- var _loc5_:* = false;
- var _loc6_:* = 0;
- var _loc7_:* = 0;
- var _loc8_:* = 0;
- var _loc9_:* = 0;
- var _loc10_:b2Body = null;
- var _loc11_:* = 0;
- var _loc12_:* = 0;
- var _loc13_:* = 0;
- var _loc14_:* = 0;
- var _loc15_:* = 0;
- var _loc16_:* = 0;
- var _loc17_:* = 0;
- var _loc18_:* = 0;
- var _loc19_:* = 0;
- var _loc20_:* = 0;
- var _loc21_:* = 0;
- var _loc22_:* = 0;
- var _loc23_:* = 0;
- var _loc24_:* = 0;
- var _loc25_:Sprite = null;
- var _loc26_:$Joueur = null;
- var _loc27_:* = NaN;
- var _loc28_:* = NaN;
- if(this.IPS.stage)
- {
- this.IPS.Rendu();
- }
- this.IPS.Nouvelle_Valeur(-1);
- if(this.MoteurActif)
- {
- _loc2_ = getTimer();
- _loc3_ = (_loc2_ - this.TempsPartieZéro) / 1000;
- if(_loc3_ != this.TempsEnCours)
- {
- this.TempsEnCours = _loc3_;
- _loc11_ = 120 - this.TempsEnCours;
- if(_loc11_ < 0)
- {
- _loc11_ = 0;
- }
- _loc12_ = int(_loc11_ / 60);
- _loc13_ = _loc11_ % 60;
- this.ClipInterface._TR.text = "0" + _loc12_ + ":" + (_loc13_ < 10?"0" + _loc13_:_loc13_);
- }
- if(_loc2_ - this.TINV > 100)
- {
- this.TINV = _loc2_;
- _loc4_ = true;
- }
- else
- {
- _loc4_ = false;
- }
- if(_loc2_ - this.TempsSeconde > 100)
- {
- this.TempsSeconde = _loc2_;
- _loc5_ = true;
- }
- else
- {
- _loc5_ = false;
- }
- if((_loc5_) && !this.ClipJoueur.Mort && !this.Guide)
- {
- if(this.ClipJoueur.Grosse)
- {
- if(this.ClipJoueur.x < this.PosDépartX + 20 && this.ClipJoueur.x > this.PosDépartX - 20)
- {
- if(this.ClipJoueur.y < this.PosDépartY + 10 && this.ClipJoueur.y > this.PosDépartY - 20)
- {
- this.ClipJoueur.Mort = true;
- this.Envoie_Serveur(this.$5 + this.$18);
- }
- }
- }
- else
- {
- _loc14_ = this.ClipJoueur.x;
- _loc15_ = this.ClipJoueur.y;
- _loc16_ = this.ListeFromage.length;
- _loc17_ = 0;
- while(_loc17_ < _loc16_)
- {
- _loc18_ = this.ListeFromage[_loc17_];
- _loc19_ = this.ListeFromage[_loc17_ + 1];
- if(_loc14_ < _loc18_ + 20 && _loc14_ > _loc18_ - 20)
- {
- if(_loc15_ < _loc19_ + 10 && _loc15_ > _loc19_ - 20)
- {
- this.ClipJoueur.Grosse = true;
- this.Envoie_Serveur(this.$5 + this.$19);
- }
- }
- _loc17_ = _loc17_ + 2;
- }
- }
- }
- this.IPS.Nouvelle_Valeur(1,true);
- this.ParticuleZone.Rendu();
- this.IPS.Nouvelle_Valeur(1);
- if(this.InvocationEnCours)
- {
- _loc20_ = _loc2_ - this.DébutInvocation;
- if(_loc20_ > this.TempsInvoc)
- {
- this.Validation_Placement_Objet_Fin();
- }
- else
- {
- _loc21_ = int(_loc20_ / this.TempsInvoc * 60);
- this.ClipJoueur.BarreDinvoc._M.width = _loc21_;
- this.ClipJoueur.BarreDinvoc._H.x = _loc21_;
- this.Explosion(0,this.ClipJoueur.x - 30 + _loc21_,this.ClipJoueur.y + 10,1,1,false);
- }
- }
- if(this.ObjetEnCours)
- {
- _loc22_ = this.ObjetEnCours.x - this.ClipJoueur.x;
- _loc23_ = this.ObjetEnCours.y - this.ClipJoueur.y;
- _loc24_ = Math.sqrt(_loc22_ * _loc22_ + _loc23_ * _loc23_);
- if(_loc24_ > 120)
- {
- if(!this.HorsDePorté)
- {
- this.ObjetEnCours.transform.colorTransform = this.CouleurZéro;
- }
- this.HorsDePorté = true;
- }
- else
- {
- if(this.HorsDePorté)
- {
- this.ObjetEnCours.transform.colorTransform = this.CouleurBase;
- }
- this.HorsDePorté = false;
- }
- }
- this.IPS.Nouvelle_Valeur(0,true);
- _loc6_ = getTimer() - this.TempsZéro;
- _loc7_ = _loc6_ / 33.33;
- _loc8_ = _loc7_ - this.ImagesCalculées;
- _loc9_ = 0;
- while(_loc9_ < _loc8_)
- {
- this.MondePhysique.Step(this.m_timeStep,this.m_iterations);
- _loc9_++;
- }
- this.ImagesCalculées = _loc7_;
- _loc10_ = this.MondePhysique.m_bodyList;
- while(_loc10_)
- {
- _loc25_ = _loc10_.m_userData as Sprite;
- if(_loc25_)
- {
- if(_loc25_ is $Joueur)
- {
- _loc26_ = _loc25_ as $Joueur;
- _loc26_.ParticuleZone.Rendu();
- _loc27_ = _loc26_.Grosse?0.5:1;
- if(_loc26_.Saute)
- {
- _loc27_ = _loc27_ / 2;
- }
- _loc28_ = _loc26_.Grosse?this.VitesseJoueur * 0.8:this.VitesseJoueur;
- if(_loc26_.DroiteEnCours)
- {
- if(_loc10_.m_linearVelocity.x < this.VitesseJoueur)
- {
- _loc10_.m_linearVelocity.x = _loc10_.m_linearVelocity.x + _loc27_;
- }
- _loc26_.DernierMouvement = _loc2_;
- }
- else
- {
- if(_loc26_.GaucheEnCours)
- {
- if(-this.VitesseJoueur < _loc10_.m_linearVelocity.x)
- {
- _loc10_.m_linearVelocity.x = _loc10_.m_linearVelocity.x - _loc27_;
- }
- _loc26_.DernierMouvement = _loc2_;
- }
- else
- {
- if(_loc2_ - _loc26_.DernierMouvement < 200)
- {
- if(_loc10_.m_linearVelocity.x < this.VitesseJoueur - 0.5 || -(this.VitesseJoueur + 0.5) < _loc10_.m_linearVelocity.x)
- {
- _loc10_.m_linearVelocity.x = _loc10_.m_linearVelocity.x / 1.2;
- }
- }
- }
- }
- if(_loc4_)
- {
- if(_loc26_.ParticuleZone.ListeParticule[0] == _loc26_.Anim_Invoc)
- {
- if(_loc26_.AnimDroite)
- {
- this.Explosion(4,_loc26_.x - 3,_loc26_.y - 10,2,1);
- this.Explosion(4,_loc26_.x + 9,_loc26_.y - 10,2,1);
- }
- else
- {
- this.Explosion(4,_loc26_.x - 18,_loc26_.y - 10,2,1);
- this.Explosion(4,_loc26_.x - 6,_loc26_.y - 10,2,1);
- }
- }
- }
- }
- _loc25_.x = _loc10_.GetPosition().x * 30;
- _loc25_.y = _loc10_.GetPosition().y * 30;
- _loc25_.rotation = _loc10_.GetAngle() * 180 / Math.PI;
- }
- _loc10_ = _loc10_.m_next;
- }
- this.IPS.Nouvelle_Valeur(0);
- if(!this.ClipJoueur.Mort && !this.SautDisponible)
- {
- if(this.ClipJoueur.Physique.m_linearVelocity.y <= 0)
- {
- if(!this.Monte)
- {
- this.SautDisponible = true;
- this.ClipJoueur.MAJ_Saut(false);
- this.MAJ_Position();
- }
- this.Monte = true;
- }
- else
- {
- this.Monte = false;
- }
- }
- if((this.Synchroniseur) && (this.Monde.FonctionSync))
- {
- this.Monde.FonctionSync(getTimer() - this.TempsPartieZéro);
- }
- }
- }
- public var ListeParticule:Array;
- public function Init_Serveur() : void {
- this.Serveur = new XMLSocket(this.Domaine,59154);
- this.Serveur.addEventListener(Event.CONNECT,this.Connexion);
- this.Serveur.addEventListener(Event.CLOSE,this.Deconnexion);
- this.Serveur.addEventListener(IOErrorEvent.IO_ERROR,this.Connexion_Impossible);
- this.Serveur.addEventListener(SecurityErrorEvent.SECURITY_ERROR,this.Connexion_Interdite);
- this.Serveur.addEventListener(DataEvent.DATA,this.Reception);
- }
- public var NomJoueur:String;
- public var HorsDePorté:Boolean;
- public var ObjetEnCours:MovieClip;
- public var Restriction:String;
- public const TempsInvoc:int = 500;
- public var StyleTexte:StyleSheet;
- public function Initialisation_Base(param1:MovieClip) : void {
- var Liste:Array = null;
- var Clip:MovieClip = null;
- var TrouSouris:MovieClip = null;
- var SolStatique:MovieClip = null;
- var Fromage:MovieClip = null;
- var MassePlanche:int = 0;
- var ClipFin:MovieClip = null;
- var ClipPlanche:MovieClip = null;
- var ObjetProp_Cube:b2PolygonDef = null;
- var ObjetInfo:b2BodyDef = null;
- var ObjetPhysique:b2Body = null;
- var MasseT:int = 0;
- var Masse:b2MassData = null;
- var CodeRepère:String = null;
- var NumRepère:int = 0;
- var ListeV:Array = null;
- var NumL:int = 0;
- var l:int = 0;
- var P:Point = null;
- var BASE:MovieClip = param1;
- var SolInfo:b2BodyDef = new b2BodyDef();
- SolInfo.position.Set(0,0);
- var ClipSol:MovieClip = new MovieClip();
- ClipSol.mouseEnabled = false;
- ClipSol.mouseChildren = false;
- SolInfo.userData = ClipSol;
- this.PhysiqueSol = this.MondePhysique.CreateBody(SolInfo);
- while(this.ClipStatique.numChildren)
- {
- this.ClipStatique.removeChildAt(0);
- }
- this.ClipListeMobile.addChild(BASE);
- this.ClipListeMobile.addChild(SolInfo.userData);
- this.ListeFromage = new Array();
- this.ClipFromage = null;
- var ListeRepère:Array = new Array();
- var ListeStatique:Array = new Array();
- var ListeSuppr:Array = new Array();
- var Num:int = BASE.numChildren;
- var i:int = 0;
- while(i < Num)
- {
- Clip = BASE.getChildAt(i) as MovieClip;
- if(Clip)
- {
- Clip.gotoAndStop(1);
- if(Clip.name == "TS")
- {
- TrouSouris = $Res.Pouf("$Trou_Souris");
- TrouSouris.x = Clip.x;
- TrouSouris.y = Clip.y;
- this.PosDépartX = TrouSouris.x;
- this.PosDépartY = TrouSouris.y - 20;
- ListeStatique.push(TrouSouris);
- ListeSuppr.push(Clip);
- TrouSouris.cacheAsBitmap = true;
- }
- else
- {
- if(Clip.name == "M" && false)
- {
- this.PhysiqueSol.CreateShape(this.Mobile_Statique(ClipSol,new Array(Clip.x,Clip.y,Clip.x + Clip.width,Clip.y,Clip.x + Clip.width,Clip.y + Clip.height,Clip.x,Clip.y + Clip.height)));
- ListeSuppr.push(Clip);
- }
- else
- {
- if(Clip.name == "S" || Clip.name == "M")
- {
- SolStatique = $Res.Pouf("$Sol_Dur");
- SolStatique.x = Clip.x;
- SolStatique.y = Clip.y;
- SolStatique.width = Clip.width;
- SolStatique.height = Clip.height;
- this.ClipListeMobile.addChild(SolStatique);
- this.PhysiqueSol.CreateShape(this.Mobile_Statique(null,new Array(Clip.x,Clip.y,Clip.x + Clip.width,Clip.y,Clip.x + Clip.width,Clip.y + Clip.height,Clip.x,Clip.y + Clip.height)));
- ListeSuppr.push(Clip);
- SolStatique.cacheAsBitmap = true;
- }
- else
- {
- if(Clip.name == "F")
- {
- Fromage = $Res.Pouf("$Fromage");
- if(!this.ClipFromage)
- {
- this.ClipFromage = Fromage;
- }
- Fromage.x = Clip.x;
- Fromage.y = Clip.y;
- Fromage.cacheAsBitmap = true;
- this.ListeFromage.push(Fromage.x,Fromage.y);
- ListeStatique.push(Fromage);
- ListeSuppr.push(Clip);
- }
- else
- {
- if(Clip.name.indexOf("Planche") != -1)
- {
- ListeSuppr.push(Clip);
- try
- {
- MassePlanche = int(Clip.name.substr(7));
- ClipFin = new MovieClip();
- ClipPlanche = $Res.Pouf("$Sol_Dur");
- ClipPlanche.x = Clip.x;
- ClipPlanche.y = Clip.y;
- ClipPlanche.width = Clip.width;
- ClipPlanche.height = Clip.height;
- ClipFin.addChild(ClipPlanche);
- ObjetProp_Cube = this.Mobile_Statique(null,new Array(Clip.x,Clip.y,Clip.x + Clip.width,Clip.y,Clip.x + Clip.width,Clip.y + Clip.height,Clip.x,Clip.y + Clip.height));
- ObjetProp_Cube.density = 30;
- ObjetProp_Cube.friction = 0.8;
- ObjetProp_Cube.restitution = 0.2;
- ObjetInfo = new b2BodyDef();
- ObjetInfo.userData = ClipFin;
- ObjetPhysique = this.MondePhysique.CreateBody(ObjetInfo);
- ObjetPhysique.CreateShape(ObjetProp_Cube);
- if(Clip.name.length > 7)
- {
- MasseT = int(Clip.name.substr(7));
- Masse = new b2MassData();
- Masse.mass = 1000;
- Masse.I = 100;
- Masse.center = new b2Vec2((Clip.x + Clip.width / 2) / 30,(Clip.y + Clip.height / 2) / 30);
- ObjetPhysique.SetMass(Masse);
- }
- else
- {
- ObjetPhysique.SetMassFromShapes();
- }
- this.ListeMobile.push(ObjetPhysique);
- this.ClipListeMobile.addChild(ClipFin);
- }
- catch(E:Error)
- {
- }
- }
- else
- {
- if(Clip.name.substr(0,1) == "_")
- {
- CodeRepère = Clip.name.substr(1,1);
- NumRepère = int(Clip.name.substr(2));
- if(ListeRepère[CodeRepère] == null)
- {
- ListeRepère[CodeRepère] = new Array();
- }
- ListeRepère[CodeRepère][NumRepère] = new Point(Clip.x,Clip.y);
- ListeSuppr.push(Clip);
- }
- else
- {
- ListeStatique.push(Clip);
- }
- }
- }
- }
- }
- }
- }
- i++;
- }
- Num = ListeStatique.length;
- i = 0;
- while(i < Num)
- {
- this.ClipStatique.addChild(ListeStatique[i]);
- i++;
- }
- Num = ListeSuppr.length;
- i = 0;
- while(i < Num)
- {
- BASE.removeChild(ListeSuppr[i]);
- i++;
- }
- for each (Liste in ListeRepère)
- {
- ListeV = new Array();
- NumL = Liste.length;
- l = 0;
- while(l < NumL)
- {
- P = Liste[l];
- if(P)
- {
- ListeV.push(P.x,P.y);
- }
- else
- {
- ListeV = null;
- }
- l++;
- }
- if(ListeV)
- {
- this.PhysiqueSol.CreateShape(this.Mobile_Statique(ClipSol,ListeV));
- }
- }
- this.PhysiqueSol.SetMassFromShapes();
- this.PhysiqueSol = this.MondePhysique.CreateBody(SolInfo);
- }
- public var _I:MovieClip;
- public var TempsZéro:int;
- public var Serveur:XMLSocket;
- public var Modo:Boolean;
- public var _M:MovieClip;
- public function Création_Lien(param1:int, param2:int, param3:Number, param4:Number, param5:Number, param6:int, param7:Number, param8:Number, param9:Number) : void {
- var _loc11_:b2Body = null;
- var _loc12_:b2Body = null;
- var _loc13_:b2RevoluteJointDef = null;
- var _loc14_:ApplicationDomain = null;
- var _loc15_:MovieClip = null;
- var _loc10_:Boolean = param1 == 11 || param1 == 12 || param1 == 13;
- if(param2 == -2)
- {
- _loc11_ = this.PhysiqueSol;
- }
- else
- {
- _loc11_ = this.ListeMobile[param2];
- }
- if(param6 == -2)
- {
- _loc12_ = this.PhysiqueSol;
- }
- else
- {
- _loc12_ = this.ListeMobile[param6];
- }
- if((_loc11_) && (_loc12_))
- {
- _loc13_ = new b2RevoluteJointDef();
- if(!(param2 == -2) && !(param6 == -2) && (_loc10_) || param1 == 22)
- {
- _loc13_.enableLimit = true;
- if(param1 == 22)
- {
- _loc13_.lowerAngle = -0.1;
- _loc13_.upperAngle = 0.1;
- }
- else
- {
- _loc13_.lowerAngle = 0;
- _loc13_.upperAngle = 0;
- }
- }
- else
- {
- if(param2 == -2)
- {
- _loc12_.m_userData.Sol = true;
- }
- else
- {
- _loc11_.m_userData.Sol = true;
- }
- }
- _loc13_.body1 = _loc11_;
- _loc13_.body2 = _loc12_;
- _loc13_.localAnchor1 = new b2Vec2(param3,param4);
- _loc13_.localAnchor2 = new b2Vec2(param7,param8);
- _loc13_.referenceAngle = param9 - param5;
- if(param1 == 12 || param1 == 15)
- {
- _loc13_.enableMotor = true;
- _loc13_.motorSpeed = -0.4;
- _loc13_.maxMotorTorque = 1000000;
- }
- else
- {
- if(param1 == 13 || param1 == 16)
- {
- _loc13_.enableMotor = true;
- _loc13_.motorSpeed = 0.4;
- _loc13_.maxMotorTorque = 1000000;
- }
- }
- this.MondePhysique.CreateJoint(_loc13_);
- if(!_loc11_.m_userData.Lien)
- {
- _loc14_ = this.loaderInfo.applicationDomain;
- _loc15_ = $Res.Pouf("$Objet_" + param1);
- if(_loc10_)
- {
- _loc11_.m_userData.Lien = true;
- }
- _loc11_.m_userData.addChild(_loc15_);
- _loc15_.x = param3 * 30;
- _loc15_.y = param4 * 30;
- }
- _loc11_.WakeUp();
- _loc12_.WakeUp();
- }
- }
- public var MasseSourisGrosse:b2MassData;
- public var DernierCodeClou:int;
- public var ClipIdentification:MovieClip;
- }
- }
Add Comment
Please, Sign In to add comment