techdojo's Forum Posts

  • 3 posts
  • Bingo, I think that’s exactly it.

    Thanks for pointing it out to me 👍

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hi Kyatric,

    Thanks for the quick reply, I can sort of see how that works if I add the compare as an event, but I'd like to add it as an (conditional) action within a function.

    I think I'm missing something fundamental here - under what circumstances would the construct runtime execute the code as this is a comparison not an event.

    Would the runtime run this code every frame as long as the condition is true - because I'd have expected that to have been handled by the system "every tick" event, or is an event generated whenever the value of tongueState changes and satisfies the condition.

    Thanks in advance for the help and sorry for the noob questions :)

  • I'm new to the event system of Construct 3 and this makes me feel like a total noob as I know this would take less than a second in a "traditional" language / system.

    I'm making a game where a monster tracks the current mouse position and "shoots" out his tongue when the user clicks the left button (by increasing the size of the sprite) .

    I'm using an instance variable inside the tongue object to hold it's current state (static, shooting forward or pulling back) and I've created two functions - one that's called when the user clicks the mouse to start the animation and one that's called every tick to update the current tongue size based on it's state.

    This is the thing - I can't for the life of me work out how to put an if statement (or a basic comparison) into the action associated with the function - I want something like this...

    	function UpdatedTongue() {
    		if (tongueState > 0) { 
    			// increase size up to max - then set state to -1
    		} else if (tongueState < 0) {
    			// decrease size down to zero - then set state to 0
    		}
    	}
    

    Any help is greatly appreciated.

    8-)

  • 3 posts