※現在、「wonderfl build flash online」求人コンテンツ制作に関してのアンケートを実施中です!みなさまのお力添えを頂いて、続々とアンケート結果が集まっていますが、まだまだ募集しております。ご協力のほど、どうぞよろしくお願いいたします!
wonderfl運営事務局
→アンケートページ(※ログインしてからお答えいただけるようになっています。)
Stars
Star Field forked from: Star Field
- // forked from butr0s's Star Field
- // Just a star field!
- package {
- import flash.display.Sprite;
- [SWF(width="465", height="465", backgroundColor="0x000000", frameRate="30")]
- public class StarField extends Sprite {
- public function StarField():void { main = this; initialize(); }
- }
- }
- import flash.display.*;
- //import flash.geom.*;
- import flash.events.Event;
- var SCREEN_WIDTH:int = 465, SCREEN_HEIGHT:int = 465;
- var main:Sprite, g:Graphics;
- //var stars:Vector.<Star> = new Vector.<Star>;
- var stars:Array = new Array(1000);
- function initialize():void {
- g = main.graphics;
- main.addEventListener(Event.ENTER_FRAME, update);
- for(var i:int = 0; i < 500; i++) stars[i] = new Star();
- }
- function update(e:Event):void {
- g.clear();
- for each(var s:Star in stars) s.update();
- }
- class Star extends Sprite {
- public var position:Object = new Object();
- public var velocity:Object = new Object();
- public function Star():void {
- position.x = Math.random() * SCREEN_WIDTH;
- position.y = Math.random() * SCREEN_HEIGHT;
- position.z = Math.random() * 8;
- velocity.x = position.z * -1/4; // 5 being an arbitrary "speed up" number
- velocity.y = velocity.z = 0;
- }
- public function update():void {
- //position.incrementBy(velocity);
- position.x += velocity.x;
- if(position.x < 0) position.x = SCREEN_WIDTH;
- alpha = position.x;
- g.lineStyle(position.z, 0xffffff, 0.8);
- g.moveTo(position.x, position.y);
- g.lineTo(position.x + 1, position.y);
- }
- }
Star Field forked from: Star Field
- // forked from butr0s's Star Field
- // Just a star field!
- package {
- import flash.display.Sprite;
- [SWF(width="465", height="465", backgroundColor="0x000000", frameRate="30")]
- public class StarField extends Sprite {
- public function StarField():void { main = this; initialize(); }
- }
- }
- import flash.display.*;
- //import flash.geom.*;
- import flash.events.Event;
- var SCREEN_WIDTH:int = 465, SCREEN_HEIGHT:int = 465;
- var main:Sprite, g:Graphics;
- //var stars:Vector.<Star> = new Vector.<Star>;
- var stars:Array = new Array(1000);
- function initialize():void {
- g = main.graphics;
- main.addEventListener(Event.ENTER_FRAME, update);
- for(var i:int = 0; i < 500; i++) stars[i] = new Star();
- }
- function update(e:Event):void {
- g.clear();
- for each(var s:Star in stars) s.update();
- }
- class Star extends Sprite {
- public var position:Object = new Object();
- public var velocity:Object = new Object();
- public function Star():void {
- position.x = Math.random() * SCREEN_WIDTH;
- position.y = Math.random() * SCREEN_HEIGHT;
- position.z = Math.random() * 8;
- velocity.z = 1;//Math.random() * 100;
- velocity.x = position.z * -1/4; // 5 being an arbitrary "speed up" number
- velocity.y = velocity.z = 0;
- }
- public function update():void {
- //position.incrementBy(velocity);
- move();
- position.x += velocity.x;
- position.y += velocity.y;
- position.z += 1;
- if(position.x < 0) {position.x = SCREEN_WIDTH;position.z = 0;}
- g.lineStyle(position.z, 0xffcc00, 0.8);
- g.moveTo(position.x, position.y);
- g.lineTo(position.x + 1, position.y);
- }
- public function move():void{
- velocity.x = position.z * -1/ 4;
- }
- }
Star Field forked from: Star Field
- // forked from butr0s's Star Field
- // Just a star field!
- package {
- import flash.display.Sprite;
- [SWF(width="465", height="465", backgroundColor="0x000000", frameRate="30")]
- public class StarField extends Sprite {
- public function StarField():void { main = this; initialize(); }
- }
- }
- import flash.display.*;
- //import flash.geom.*;
- import flash.events.Event;
- var SCREEN_WIDTH:int = 465, SCREEN_HEIGHT:int = 465;
- var main:Sprite, g:Graphics;
- //var stars:Vector.<Star> = new Vector.<Star>;
- var stars:Array = new Array(1000);
- function initialize():void {
- g = main.graphics;
- main.addEventListener(Event.ENTER_FRAME, update);
- for(var i:int = 0; i < 500; i++) stars[i] = new Star();
- }
- function update(e:Event):void {
- g.clear();
- for each(var s:Star in stars) s.update();
- }
- class Star extends Sprite {
- public var position:Object = new Object();
- public var velocity:Object = new Object();
- public function Star():void {
- position.x = Math.random() * SCREEN_WIDTH;
- position.y = Math.random() * SCREEN_HEIGHT;
- position.z = Math.random() * 8;
- velocity.x = position.z * -1/4; // 5 being an arbitrary "speed up" number
- velocity.y = velocity.z = 0;
- }
- public function update():void {
- //position.incrementBy(velocity);
- position.x += velocity.x;
- if(position.x < 0) position.x = SCREEN_WIDTH;
- g.lineStyle(position.z, 0xffffff, 0.8);
- g.moveTo(position.x, position.y);
- g.lineTo(position.x + 1, position.y);
- }
- }
notice: 

