R0J0hound's Forum Posts

  • My idea would be to first have a sprite pinned to the center of snap-able each edge center of each shape. Let's call them "edge".

    Then when a shape is dropped pick the closest other edge that's closest to each of the shapes edges. Of the two pairs of edges only keep the closest. A little tedious to make events for but that would give you the two edges that would need to snap together.

    The snapping could be done by moving the dropped shape by the offset of the edges and orienting them based on the normals of the edges.

    I'm attempting to come up with an elegant event setup, so stand by for a capx.

  • spacedoubt

    You can do what you described like this,at least for the first part that is.

    https://dl.dropboxusercontent.com/u/542 ... w_rot.capx

    The bounding box of a rotated triangle can be found by adding an image point at each corner of the triangle and then finding the min and max horizontally and vertically.

    And like you said you can make the bounding box only update after rotation. The only tricky part was positioning the bounding box while rotating, but there's a useful formula for that here:

    https://www.siggraph.org/education/mate ... 2drota.htm

    And while I was at it I added the ability to rotate around any point for little extra effort,

    The only aspect of that can't be done is resizing in relation to the screen, as that would introduce skewing, which C2 can't do. So you'd be limited to only resizing relative to the object.

    Edit:

    Here it is working with multiple objects. Shirt click to toggle selection.

    https://dl.dropboxusercontent.com/u/542 ... multi.capx

  • Chigabooga

    To do that you won't be able to use the particle object as the particles don't interact with anything. You'll have to use sprites with maybe the bullet behavior.

  • For something like this you'd have to install to a different location and use a diff program like winmerge to see exactly what changed in the files.

  • It doesn't work because of your second else. If you're over object 1 the first event works and sets the text, but then event 2 runs and since you're not over object 2 it sets the text to "".

    Do this instead.

    always

    --- set text to ""

    player is overlapping object1

    --- set text to "object1"

    player is overlapping object2

    --- set text to "object2"

  • A function is run as if it was instead placed where the function call was. Minus any picking. So it doesn't count as a toplevel event.

    "Wait 0" is a fix since it waits to run the following actions and sub events till the end of the event sheet where created objects are pickable as normal.

    As for what is happening consider

    start of layout

    ---- create sprite

    Before the event you can think of the state of the engine like this:

    sprites=[0,1,2] // A list of all the sprite instances

    picked=[] // A list of picked sprites

    new=[] // A list of new sprites

    Inside the event "picked" gets a list of all the sprite instances

    sprites=[0,1,2]

    picked=[0,1,2]

    new=[]

    The "create" action adds the the new object to "new" and picks only that.

    sprites=[0,1,2]

    picked=[3]

    new=[3]

    Then upon leaving the event the "new" list is moved to the "sprites" list:

    sprites=[0,1,2,3]

    picked=[]

    new=[]

    So the main point is the "new" list is only merged with the "sprites" list between toplevel events.

  • If you want to do it with events you can give the animations number names like (1,2,3,...). Or even better numbers in combination with a word like (run1,run2,run3...). Then you can use the set animation action with the expression "run"&n where n is an index.

    If you want to do it in a plugin with the javascript sdk then look here:

    https://www.scirra.com/manual/29/object-type

    If the object has animations you can use something like type.animations[0] to get the name at index i. You can glean more info about it by looking at the sprite object's source.

  • You could use one of these:

  • http://stackoverflow.com/questions/9403 ... javascript

    Add the browser object and use these expressions to convert over and back.

    Browser.ExecJS("'"& char & "'.charCodeAt(0)")

    Browser.ExecJS("String.fromCharCode("& ascii &")")

  • Instead of building the first text right away store the two numbers in variables and the operator in another variable. Then you can build the first text with number1&operator&number2. Then just add some conditions checking what the operator and set the second text depending on the operator.

    global number number1=0

    global number number2=0

    global text operator=""

    Start of layout

    --- set number1 to round(random(1,100))

    --- set number2 to round(random(1,100))

    --- set operator to choose("+","-","/","*")

    --- set Text1 to number1&operator&number2

    operator = "+"

    --- set text2 to number1+number2

    operator = "-"

    --- set text2 to number1-number2

    ... etc

  • Here's the reverse.

    x = iy-320+ix/2

    y = iy-320-ix/2

  • By platforms do you mean android and ios? My guess there is a tag in the manifest that says if it's a game, app or anything else. That said I'm unfamiliar with the export process, and weather or not you can access it or if the process is fully automated.

  • I agree with Katala's idea of having a top view layout in the back.

    For pathfinding and other motion in iso the simple thing is to do it in top view and then position some isometric objects from the top view positions to isometric positions.

    The math is simple:

    IsoX = x-y

    IsoY = 320+(x+y)/2

    Example:

    https://dl.dropboxusercontent.com/u/542 ... nding.capx

    I left the top view stuff visible but in practice you would make it completely invisible. The advantage of doing it that way is all behaviors can now work as an isometric motion.

    The animation aspect is basically the same as changing animations in 8-direction.

    viewtopic.php?f=147&t=90880&p=713920&hilit=animation#p713920

    To me z-sorting is the hardest aspect of isometric. In the capx I sorted by Y which doesn't sort right in some cases.

  • Yes, that would work.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Glad they helped. I found the topics using the forum search with "comma number".