Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - aenil333

Pages: 1 2
1
Ask a Question / Re: isometric games
« on: May 31, 2013, 09:52:41 am »
what about an hex grid in isometric... the up would be up left would left etc... just iso ;P


http://stackoverflow.com/questions/6613193/transforming-screen-to-map-coordinates-in-a-isometric-hexagon-tiling-engine

2
Ask a Question / Re: Mute Button Problem
« on: May 31, 2013, 08:08:18 am »
ninja'd :P

3
Ask a Question / Re: Mute Button Problem
« on: May 31, 2013, 08:01:40 am »
hmm.. just read myself that help and its kinda hard to understand so i checked it up for you and here what i came with.

First you must create an attribute like this:

Click attribute, Game Attribute, and Create new game attribute.



Then you set it like this, a boolean is always true or false. and we will set the default to no (false)



That said it mean the mute button is false as the game start. Once the guy click the play button or whatever you must set this attribute to true. The next image show you how to set an attribute and check if its true or false: (the if the anything = anything are found in flow, the purple are those you just created in the game attribute and the sound cause i didnt know what you wanted to play or stop choose an actor if you need)


5
Ask a Question / Re: Hexagonal grid?
« on: May 31, 2013, 07:35:32 am »
This will cover everything you have to know, no real code example involved tought only how to set it up: http://www.redblobgames.com/grids/hexagons/

6
Ask a Question / Re: addChild to current scene?
« on: May 31, 2013, 06:10:32 am »
so anyone know how to get the instance name of the scene or actor so i can attach thing to them ?:\

7
Ask a Question / addChild to current scene?
« on: May 30, 2013, 10:48:16 pm »
Ok so i know FlxG.stage is adding directly on stage but it goes over the mouse and everything, when scene change it doesnt change so i want to add my stuff on the scene directly i checked the stencyl api and didnt find how. Any ideas?

8
Ask a Question / Re: Setting default value on custom block
« on: May 30, 2013, 06:03:28 pm »
Oh well i guess its not possible checked everywhere. :\ But i got it to work by just adding a [] in my array variable so it set null as default and i handle it in code. Not the best but that work. Here is what i got so far:



And for those that interest there is a couple thing i saw that might be wrong with creating block. One you cannot re-edit your custom block and have to recreate it everytime. Thats annoying. And if you have more than 10 argument the %10 take the same value as %1. Sound like it has been coded to check only 1 character after the % and not the actual number.


9
Ask a Question / Re: Setting default value on custom block
« on: May 30, 2013, 05:19:01 pm »
Or maybe someone know a way to go and edit the code generated by creating such behavior ? I dont mind doing it directly as long as i can set a default value to my function variable :P

10
Ask a Question / Re: Behavior won't stop
« on: May 30, 2013, 04:46:40 pm »
or you can add a print block to check in console what are the value of timer and speed see if it goes larger than speed like expected... but what i mean with the draw is if this is generated many time or each frame it prolly wont have the time to stop

11
Ask a Question / Re: Behavior won't stop
« on: May 30, 2013, 04:43:41 pm »
did u add this in a draw events?

12
Ask a Question / Setting default value on custom block
« on: May 30, 2013, 04:42:26 pm »
Is there a way to set a default value on a custom block variable?
I created a scene behavior into code mode. and the result of the block look like this:

public function TUWrite(__x:Number, __y:Number, __text:String, __color:uint, __size:Number, __fadeoutafter:Number, __useShadow:Array):void


I want to use the useShadow:Array = [] as a default value or even __x and __y = 0, how do i add the extra?

13
Ask a Question / Re: Coding in as3 in stencyl
« on: May 30, 2013, 11:15:31 am »
IntroMenu is a scene that i add the text utility behavior to (in the events of the scene), i tryed with a 15 second delay still not showing. Its weird :\

Edit: Ok i got it. I tought i could load the block without adding it as a behavior lol that got me confused seeing it but not being able to use it. Everything working now you should see a text utility using text field and formats and all soon on forge! :)

14
Ask a Question / Re: Coding in as3 in stencyl
« on: May 30, 2013, 10:59:51 am »
This is the actual code generated which look fine to me:

Code: [Select]
package scripts
{
import flash.display.BlendMode;
import flash.events.*;
import flash.net.*;
import flash.filters.*;

import Box2DAS.Collision.*;
import Box2DAS.Collision.Shapes.*;
import Box2DAS.Common.*;
import Box2DAS.Dynamics.*;
import Box2DAS.Dynamics.Contacts.*;
import Box2DAS.Dynamics.Joints.*;

import stencyl.api.data.*;
import stencyl.api.engine.*;
import stencyl.api.engine.actor.*;
import stencyl.api.engine.behavior.*;
import stencyl.api.engine.bg.*;
import stencyl.api.engine.font.*;
import stencyl.api.engine.scene.*;
import stencyl.api.engine.sound.*;
import stencyl.api.engine.tile.*;
import stencyl.api.engine.utils.*;

import org.flixel.*;
import mochi.as3.*;
import flash.ui.Mouse;

            import flash.display.Sprite;
import flash.events.Event;
import flash.filters.DropShadowFilter;
import flash.filters.BitmapFilterQuality;
import flash.text.TextField;
import flash.text.TextFormat;
import flash.text.TextFieldAutoSize;
import flash.utils.setInterval;
import flash.utils.clearInterval;
import org.flixel.*;


public dynamic class Design_28_28_test extends SceneScript
{
  private var xCol:int;
private var yCol:int;
private var xText:String;
private var xColor:uint;
private var xTextSize:int;
private var xVerticalText:Boolean;
private var xEnableShadow:Boolean;
private var xLifeTime:int;
private var xAnim:int;
private var distance:int;
private var angle:int;
private var color;
private var xTextInt:Array = new Array();
private function writeText()
{
    var xTextField:TextField = new TextField();
    var xTextShadow:DropShadowFilter = new DropShadowFilter();
    var xFormat:TextFormat = new TextFormat();
    xFormat.font = "Arial";
    xFormat.bold = true;
    xFormat.color = xColor;
    xFormat.size = xTextSize;
    xTextField.autoSize = TextFieldAutoSize.CENTER;
    xTextField.selectable = false;
    xTextField.defaultTextFormat = xFormat;
    xTextField.x = xCol;
    xTextField.y = yCol;

    if (xEnableShadow = = true)
    {
        xTextShadow.distance = 0;
        xTextShadow.angle = 0;
        xTextShadow.color = 0x000000;
        xTextShadow.alpha = 1;
        xTextShadow.blurX = 5;
        xTextShadow.blurY = 5;
        xTextShadow.strength = 5;
        xTextShadow.quality = 1;
        xTextShadow.inner = false;
        xTextShadow.knockout = false;
        xTextShadow.hideObject = false;
        xTextField.filters = new Array(xTextShadow);
    }

    if (xVerticalText = = true)
    {
        var textArray:Array = new Array();
        var tempText:String = "";
        textArray = xText.split("");

        for (var i = 0; i < textArray.length; i + +)
        {
            tempText + =  textArray[i] + "\n";
        }

        xText = tempText;
    }

    if (xLifeTime > = 1)
    {
        var testB:Array = new Array();
        var testA:uint = setInterval(destroyText, xLifeTime, xTextField);
        testB.push(xTextField, testA);
        xTextInt.push(testB);
        //effect of fading out
    }

    xTextField.text = xText;
    FlxG.stage.addChild(xTextField);
}
private function destroyText(textfield:TextField):void
{

    for (var i = 0; i < xTextInt.length; i + +)
    {
        var tempText2:TextField = xTextInt[i][0];

        if (tempText2 = = textfield)
        {
            clearInterval(xTextInt[i][1]);
            xTextInt.splice(i);
            FlxG.stage.removeChild(textfield);
        }
    }
}
public function TextFormats(xcol:int, ycol:int, xtext:String, xcolor:uint = 0xFFFFFF, xtextSize:int = 14, verticalText:Boolean = false, enableShadow:Boolean = false, lifeTime:int = 0)
{
    xCol = xcol;
    yCol = ycol;
    xText = xtext;
    xColor = xcolor;
    xTextSize = xtextSize;
    xVerticalText = verticalText;
    xEnableShadow = enableShadow;
    xLifeTime = lifeTime;
    writeText();
}
/* Params are:__x __y __text */
public function wText(__x:Number, __y:Number, __text:String):void
{
    TextFormats(__x, __y, __text);
}

 
  override public function init():void
    {
                  TextFormats(200,200,"test");

    }        

public function Design_28_28_test(ignore:*, scene:GameState)
{
super(scene);

}

override public function forwardMessage(msg:String):void
{

}
}
}



Btw sorry for all the big post i really want to get into this hehe :P that will simplify alot of thing for me to create my own block :)

15
Ask a Question / Re: Coding in as3 in stencyl
« on: May 30, 2013, 10:57:45 am »
Hmm i used your tile api as example and did the same to create my custom block but its not working.

When i add a event on created in my behavior and add it as a behavior on my scene i can see the text. But when i try using a custom block to add it i see nothing. Maybe you know whats wrong?

Those image are example of what i did:

(This is the on Created event that is actually working)


And those are the one that is not working...



Pages: 1 2