Users browsing this thread: 2 Guest(s)
Stencyl (Flash game making program) help and chat thread
#1
I look up stuff on Google, YouTube etc. and I need help with Haxe programming which is used in
Stencyl
which is a Flash game making program.





Code:
[code]/*
    Stencyl exclusively uses the Haxe programming language.
    Haxe is similar to ActionScript and JavaScript.
   
    Want to use native code or make something reusable? Use the Extensions Framework instead.
    http://www.stencyl.com/help/view/engine-extensions/
   
    Learn more about Haxe and our APIs
    http://www.stencyl.com/help/view/haxe/
*/

package scripts;


//==========================================================
// Imports
//==========================================================

import com.stencyl.graphics.G;

import com.stencyl.behavior.Script;
import com.stencyl.behavior.Script.*;
import com.stencyl.behavior.ActorScript;
import com.stencyl.behavior.SceneScript;
import com.stencyl.behavior.TimedTask;

import com.stencyl.models.Actor;
import com.stencyl.models.GameModel;
import com.stencyl.models.actor.Animation;
import com.stencyl.models.actor.ActorType;
import com.stencyl.models.actor.Collision;
import com.stencyl.models.actor.Group;
import com.stencyl.models.Scene;
import com.stencyl.models.Sound;
import com.stencyl.models.Region;
import com.stencyl.models.Font;

import com.stencyl.Engine;
import com.stencyl.Input;
import com.stencyl.utils.Utils;

import nme.ui.Mouse;
import nme.display.Graphics;

import motion.Actuate;
import motion.easing.Back;
import motion.easing.Cubic;
import motion.easing.Elastic;
import motion.easing.Expo;
import motion.easing.Linear;
import motion.easing.Quad;
import motion.easing.Quart;
import motion.easing.Quint;
import motion.easing.Sine;

class Design_3_3_ extends ActorScript
{              
    //Expose your attributes like this:
    //@:attribute("id='1' name='Display Name' desc='An Attribute'")
    //public var attributeName:String;

    //Need further help? See: http://www.stencyl.com/help/view/code-mode/
    @:attribute("id='1' name='FavoriteNumber' desc='Add a number please' default='17'")
        public var _FavoriteNumber:Float;
    override public function init()
    {
    }
    
    public inline function update(elapsedTime:Float)
    {
    }
    
    public inline function draw(g:G)
    {
    }

        public inline function AddHere1(AddHere2:AddHere3)
        {
        }
    
    
    //==========================================================
    // Don't edit below unless you know what you're doing
    //==========================================================
    
    public function new(dummy:Int, actor:Actor, dummy2:Engine)
    {
        super(actor);
        nameMap.set("FavoriteNumber", "_FavoriteNumber");
                _FavoriteNumber = 17;
                nameMap.set("Actor", "actor");
        if ((_FavoriteNumber == 17))
        {
                  actor.setXVelocity(4);
        }
        addWhenUpdatedListener(null, onUpdate);
        addWhenDrawingListener(null, onDraw);
                Add Here
    }
    
    public function onUpdate(elapsedTime:Float, list:Array<Dynamic>)
    {
        if(wrapper.enabled)
        {
            update(elapsedTime);
        }
    }
    
    public function onDraw(g:G, x:Float, y:Float, list:Array<Dynamic>)
    {
        if(wrapper.enabled)
        {
            draw(g);
        }
    }
        public function AddHere4
        {
                if(wrapper.enabled)
                {
                       actor.setXVelocity(4);
                }
        }
}

^ Please read up above carefully, thank you.





If I want event (mentioned below) coded properly
what do I change all of the following 4
AddHere1
AddHere2
AddHere3
AddHere4
to?






A1: left arrow button held down

A2: Actor ID Kylee 17 is in region x: 17 y: 17

A3: Actor Kendra is in region x:28 y: 28

A4: up arrow button is released

A5: Do whichever after 14 seconds

A6: Alarm 0

A7: down arrow button is pressed

A8: If Sound sound_wave is playing
[/code]
An awesomest (best) maze game V at least in my opinion.

http://s000.tinyupload.com/?file_id=00821057748349019634




Reply
Thanked by: miyabi95_, Kosheh


Messages In This Thread
Stencyl (Flash game making program) help and chat thread - by ZeldaClassicEXPERT - 10-27-2016, 02:05 PM

Forum Jump: