Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com
- {
- import com.*;
- import com.Player;
- import com.extra.Companion;
- import com.extra.Effect;
- import com.levels.Cloud;
- import com.levels.World;
- import org.flixel.FlxCamera;
- import org.flixel.FlxG;
- import org.flixel.FlxState;
- //import org.flixel.plugin.photonstorm.*;
- public class Play extends FlxState
- {
- public var player:Player = new Player(20,68);
- public var world:World = new World();
- public var cloud:Cloud = new Cloud(15,10);
- public var effect:Effect = new Effect();
- //public var companion:Companion;
- override public function create():void
- {
- FlxG.bgColor = 0xffaaddff;
- this.add(cloud);
- this.add(world);
- this.add(player);
- this.add(effect);
- FlxCamera.STYLE_PLATFORMER;
- FlxG.camera.follow(player);
- FlxG.camera.setBounds(0,-20,1000,116);
- FlxG.worldBounds.width = FlxG.width;
- FlxG.worldBounds.height = FlxG.height;
- }
- override public function update():void{
- super.update();
- FlxG.collide(player,world);
- effect.x = player.x + 2;
- effect.y = player.y + 2;
- }
- }
- }
Add Comment
Please, Sign In to add comment