Guest User

Untitled

a guest
Nov 24th, 2017
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package com
  2. {
  3.     import com.*;
  4.     import com.Player;
  5.     import com.extra.Companion;
  6.     import com.extra.Effect;
  7.     import com.levels.Cloud;
  8.     import com.levels.World;
  9.    
  10.     import org.flixel.FlxCamera;
  11.     import org.flixel.FlxG;
  12.     import org.flixel.FlxState;
  13.     //import org.flixel.plugin.photonstorm.*;
  14.    
  15.     public class Play extends FlxState
  16.     {
  17.         public var player:Player = new Player(20,68);
  18.         public var world:World = new World();
  19.         public var cloud:Cloud = new Cloud(15,10);
  20.         public var effect:Effect = new Effect();
  21.        
  22.         //public var companion:Companion;
  23.        
  24.         override public function create():void
  25.         {
  26.             FlxG.bgColor = 0xffaaddff;
  27.             this.add(cloud);
  28.             this.add(world);
  29.             this.add(player);
  30.             this.add(effect);
  31.            
  32.             FlxCamera.STYLE_PLATFORMER;
  33.             FlxG.camera.follow(player);
  34.             FlxG.camera.setBounds(0,-20,1000,116);
  35.             FlxG.worldBounds.width = FlxG.width;
  36.             FlxG.worldBounds.height = FlxG.height;
  37.         }
  38.        
  39.         override public function update():void{
  40.             super.update();
  41.            
  42.             FlxG.collide(player,world);
  43.  
  44.             effect.x = player.x + 2;
  45.             effect.y = player.y + 2;
  46.            
  47.         }
  48.            
  49.     }
  50. }
Add Comment
Please, Sign In to add comment