Skip to content

Commit

Permalink
system update
Browse files Browse the repository at this point in the history
  • Loading branch information
akadjoker committed Feb 21, 2014
1 parent 3811af0 commit 95ef4ab
Show file tree
Hide file tree
Showing 22 changed files with 1,266 additions and 469 deletions.
Binary file modified assets/hxlogo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified bin/html5/bin/assets/hxlogo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1,279 changes: 943 additions & 336 deletions bin/html5/bin/glframework.js

Large diffs are not rendered by default.

Binary file modified bin/windows/neko/bin/assets/hxlogo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified bin/windows/neko/bin/glframework.exe
Binary file not shown.
Binary file modified bin/windows/neko/obj/ApplicationMain.n
Binary file not shown.
5 changes: 4 additions & 1 deletion src/com/djoker/glteste/Main.hx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ override function begin()



this.setScreen(new TesteBatch());
//this.setScreen(new TesteBatch());
//this.setScreen(new TesteAtlas());
//this.setScreen(new TestneBatch());
//this.setScreen(new TesteCloud());
Expand All @@ -64,6 +64,9 @@ this.setScreen(new TesteBatch());
//this.setScreen(new TestePrimitives());
//this.setScreen(new TesteBitmap());
//this.setScreen(new TesteDraTiles());
this.setScreen(new TestTrasform());




}
Expand Down
109 changes: 109 additions & 0 deletions src/com/djoker/glteste/TestTrasform.hx
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
package com.djoker.glteste;


import com.engine.game.Entity;
import com.engine.game.Screen;
import com.engine.render.SpriteBatch;
import com.engine.render.Texture;
import com.engine.render.BlendMode;

import flash.events.Event;
import flash.text.TextField;
import flash.text.TextFormat;

/**
* ...
* @author djoker
*/
class TestTrasform extends Screen
{

var tex :Texture;
var batch:SpriteBatch;



var child:Entity;

var player:Entity;
var logo:Entity;


var playerTex :Texture;
var skew:Float = 0;


override public function show()
{

playerTex = new Texture("assets/zazaka.png", true);

batch = new SpriteBatch(500);


var caption:TextField = new TextField();
caption.x = game.gameWidth / 2-100;
caption.y = 20;
caption.width = 200;
caption.defaultTextFormat = new TextFormat ("_sans", 12, 0xffff00);
caption.text = "Test trasform sprites by parent ";
caption.selectable = false;
game.addChild(caption);

logo = new Entity(this.width / 2, this.height / 2, new Texture("assets/hxlogo.png", true));
logo.blendMode = BlendMode.SCREEN;

player = new Entity(300, 200, playerTex);
child = new Entity(0, 0, playerTex);
child.blue = 0;

player.add(child);



game.clarColor(0, 0, 0);


}

override public function render(dt:Float)
{

player.rotation += dt * 2.1;
child.rotation -= dt * 2.5;
player.skewX += dt * 0.1;

skew += dt * 1;

logo.skewX = Math.sin(skew)*1;
logo.skewY = Math.cos(skew)*1;


batch.Begin();


batch.drawEntity(logo);
batch.drawEntity(player);
batch.drawEntity(child);


batch.End();


}






override public function mouseDown(mousex:Float, mousey:Float)
{

player.x = mousex;
player.y = mousey;
}



}
43 changes: 34 additions & 9 deletions src/com/djoker/glteste/TesteBatch.hx
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,13 @@ package com.djoker.glteste;

import com.engine.game.Entity;
import com.engine.game.Screen;
import com.engine.render.BlendMode;
import com.engine.render.SpriteBatch;
import com.engine.render.Texture;
import com.engine.render.BlendMode;

import flash.events.Event;
import flash.text.TextField;
import flash.text.TextFormat;


/**
* ...
* @author djoker
Expand All @@ -21,15 +20,23 @@ class TesteBatch extends Screen
var batch:SpriteBatch;



var child:Entity;

var player:Entity;
var logo:Entity;

var particles : Array<Particle>;

var playerTex :Texture;
var skew:Float = 0;


override public function show()
{

tex = new Texture("assets/texture.png",true);
tex = new Texture("assets/texture.png");
playerTex = new Texture("assets/zazaka.png");

batch = new SpriteBatch(500);
particles = [];
for(i in 0...200)
Expand All @@ -42,23 +49,38 @@ class TesteBatch extends Screen
caption.width = 200;
caption.defaultTextFormat = new TextFormat ("_sans", 12, 0xffff00);
caption.text = "Test 200 sprites with SpriteBatch ";
caption.selectable = false;
game.addChild(caption);

player = new Entity(200,200, tex);
player = new Entity(300, 200, playerTex);
child = new Entity(0, 0, playerTex);
child.blue = 0;
player.add(child);

logo= new Entity(this.width/2,this.height/2,new Texture("assets/hxlogo.png"));

game.clarColor(0, 0, 0);


}

override public function render(dt:Float)
{

//player.rotation += dt * 0.1;
player.skewX += dt * 0.1;
player.rotation += dt * 2.1;
child.rotation -= dt * 2.5;
// player.skewX += dt * 0.1;

skew += dt * 1;

logo.skewX = Math.sin(skew)*1;
logo.skewY = Math.cos(skew)*1;


batch.Begin();
batch.Begin();

batch.drawEntity(logo);

for(p in particles)
{
p.move(dt);
Expand All @@ -67,6 +89,7 @@ class TesteBatch extends Screen
}

batch.drawEntity(player);
batch.drawEntity(child);

batch.End();

Expand Down Expand Up @@ -96,6 +119,8 @@ public function addParticle2(x:Float,y:Float)
override public function mouseDown(mousex:Float, mousey:Float)
{
addParticle2(mousex, mousey);
player.x = mousex;
player.y = mousey;
}


Expand Down
19 changes: 14 additions & 5 deletions src/com/engine/game/Entity.hx
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,30 @@ public var image:Texture;
public var blendMode:Int;
public var clip:Clip;
public var name:String;
public var red:Float;
public var green:Float;
public var blue:Float;
public var alpha:Float;
public var depth:Float;

public function new(x:Float,y:Float,image:Texture,?name:String='solid')
{
super();
flipx = false;
flipy = false;
flipy = true;
this.image = image;
this.blendMode = BlendMode.NORMAL;
clip = new Clip(0, 0, image.width, image.height);
this.x = 100;
this.pivotX = clip.width/2;
this.pivotY = clip.height/2;
this.x = x;
this.y = y;
this.depth = 0.0;
this.name = name;



red = 1;
green = 1;
blue = 1;
alpha = 1;



Expand Down
Loading

0 comments on commit 95ef4ab

Please sign in to comment.