EndoSkull's Recent Forum Activity

  • Ah!

    Okay let's see if this work!https://dl.dropbox.com/u/11212446/test.capx

  • Um... Please help?

  • So far - I haven't had any of my questions answered so I'm starting to wonder if I'm asking dumb questions...

    Anyway here is another one...

    I've been searching the forums a lot - and I see a lot of grid based movement and board movement etc - but I think I'm trying to do something really simple and I'm just dumb...

    So here is what I'm trying to do:

    Have a map - I set the sprite to the target - i move the sprite x amount of pixel each turn to the position - there is no objects or anything that will block it's path.

    And here is what I came up with:

    VAR speed = 32 (pixels)

    SPRITE.X = 10

    SPRITE.Y = 10

    VAR x 300

    VAR y 300

    VAR distanceToMove = 0

    Every Tick

    distance != speed

    Round(Sprite.X) != Round(x)

    Round(Sprite.y) != Round(y)

    ---------Action = Sprite set angle toward (x,y)

                      Sprite move forward 1 pixels

                      Sprite Add 1 to distToMove

    This makes it move as I wanted - but this sits in the main event and I wanted it as a function which I could pass in X,Y Speed etc - but I couldn't get it to move to the location pixel by pixel turn by turn...

    How dumb am I?

    Thanks!

  • I just found this thread.

    FYI

    I think I love you.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Not sure if this is my error or a functional error:

    Or if it is even related to this...

    Example:

    SYSTEM - On Start of Layout

    Create TEXTBOX

    Dictionary add Key BOX1 with value TEXBOX.UID

    Create TEXTBOX

    Dictionary add Key BOX2 with value TEXBOX.UID

    Function SetBOX1

    Function SetBOX2

    Function FillBOXES

    FUNCTION FillBOXES

    TEXTBOX Pick Instance with UID Dictionary.Get("BOX1")

    TEXTBOX set text to Array.At(0,0,0)

    TEXTBOX Pick Instance with UID Dictionary.Get("BOX1")

    TEXTBOX set text to Array.At(0,1,0)

    FUNCTION SetBOX1

    Array Set value at(0,0,0) to "John"

    FUNCTION SetBOX2

    Array Set value at(0,0,0) to "Doe"

    ================================================

    The Issue:

    ================================================

    In runs through fine and fires the FillBOXES function but will NOT fire the:

    TEXTBOX Pick Instance with UID Dictionary.Get("BOX1")

    TEXTBOX set text to Array.At(0,0,0)

    TEXTBOX Pick Instance with UID Dictionary.Get("BOX1")

    TEXTBOX set text to Array.At(0,1,0)

    UNLESS I put a "Wait" on action of the Function FillBOXES like this:

    FUNCTION FillBOXES SYSTEM Wait 0.5

    TEXTBOX Pick Instance with UID Dictionary.Get("BOX1")

    TEXTBOX set text to Array.At(0,0,0)

    TEXTBOX Pick Instance with UID Dictionary.Get("BOX1")

    TEXTBOX set text to Array.At(0,1,0)

    ==================================================

    Is it me not understanding the order of events to fire or is there something else?

    Thanks

EndoSkull's avatar

EndoSkull

Member since 20 Feb, 2013

None one is following EndoSkull yet!

Trophy Case

  • 11-Year Club
  • Email Verified

Progress

12/44
How to earn trophies