lionz's Forum Posts

  • You could use tokenat to get a random 1-4 position of a string "*,+,-,/" but I'm not sure you can convert that found string back into an operator. Sounds like an unncessary workaround.

  • Rex's MoveTo plugin is good for this. You just specify an x,y or object to move to and it will move in a line to it. construct.net/en/forum/extending-construct-2/addons-29/behavior-moveto-40701

    Aside from this, you could have the moving sprite as a bullet and specify its angle of motion towards touch area. Also you could use Pathfinding to find a path to the specified location (touch.x,touch.y)

  • Hiya, you'll need to post some events or a playable C3 project to get some help with this otherwise it is just guesswork. The problem could be with your logic and picked objects or collision, multiple things really.

  • Do you pick up the key by walking over it? If so, then on player overlap key set door open; door open could be a boolean variable on the door; door.open=true. If you are picking up with mouse click or touch, then on key touched/clicked, set door.open=true. Then you have an event, player can only advance or door will only work if door.open=true.

  • I could calculate A and C as a random number, then I would have B as a variable choose(0,1,2,3) then have 4 events if B=0 A+B, if B=1 A-B, if B=2 A*B, if B=3 A/B

  • I'm not sure how text variables relate to that code as there is no text object but yes you can set a text variable to a random range in the same way.

  • Here is an array example and how I usually do this, although I do tend to be using arrays at the time for other things :) dropbox.com/scl/fi/s1um2s6re96zmcj0mjihw/pickarray.c3p

  • Yeah you don't destroy and create new text objects for text. You keep the one object there, change its visibility and change its text from a variable or something. Destroying a text object and replacing it with a different text object is redundant in this scenario. If the purpose is to set different text then you focus on the set text action with the same text object.

  • Where are the 50 actions? Can you explain how you are planning to expand it. At the moment a text box alternates between being shown for a player and a friend right?

  • You are running the same function twice, is that correct? If those are the events in the function then you don't need to use a function, they are actions that can just go in place of the function call.

  • You could run the choose and then check if that object.color=choose exists and if so run the choose again. You could have an array with 1,2,3,4 at x and pick a random x from 0 to array.width which chooses the number at random and then deletes it from the array so it cannot be chosen again i.e. it picks 3 you are left with 1,2,4 in the array for next time.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • It doesn't seem to be doing what you described but yes a function is best to cut down repeating code. You said something happens when the player fires an arrow but the logic shown suggests you are checking a variable on start of layout. Also I can't see what you've put in the function.

  • set text : ""&curVar&" / "&maxVar

  • A tick is 1/60th of a second so if it was 1/60th of a second later for each object I'm not sure how you were hoping to see this with the naked eye? :) Maybe you meant every second? If you create all objects every tick, even though events run in order from top to bottom the objects will still appear to spawn together.

  • This probably has more gameplay than No Man's Sky hehe, looks interesting, good luck with it!