Thread: May I have some Stencyl coding help please? Thank you and my name is Jason

  1. #1
    Registered User
    Join Date
    Apr 2012
    Posts
    6

    May I have some Stencyl coding help please? Thank you and my name is Jason

    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:
    /*
        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

  2. #2
    Its hard... But im here swgh's Avatar
    Join Date
    Apr 2005
    Location
    England
    Posts
    1,688
    //================================================== ========
    // Don't edit below unless you know what you're doing
    //================================================== ========
    Was that really part of the template code or did you write that comment? Not being rude but
    it's a little absurd and arrogant to have such a comment placed in code that can/needs to be
    modified.
    Double Helix STL

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. c++ coding
    By rramyaasmi in forum C++ Programming
    Replies: 1
    Last Post: 10-19-2010, 01:02 PM
  2. Freddy Vs X || Jason VS X
    By drdroid in forum A Brief History of Cprogramming.com
    Replies: 16
    Last Post: 08-20-2003, 11:59 AM
  3. coding
    By rick1984 in forum C Programming
    Replies: 8
    Last Post: 07-29-2003, 04:23 AM
  4. jason deckard
    By sally arnold in forum C Programming
    Replies: 1
    Last Post: 01-15-2002, 12:36 PM

Tags for this Thread