JackAttackNZ's Recent Forum Activity

  • jayderyu

    I will look into it, thanks! Because I want all the objects to rotate around a central point, I think I will need to pin them together.

    I would love some help into solving some bugs that are doing my head in. I have attached my .capx below and the program specifications are here. Ignoring the box and container on the right, the 8 boxes have a weight property allocated to them and once put on the scales, they move appropriately. The goal is for the user to use the scales to sort the boxes into sorted order (this is going to be used in an educational book teaching sorting methods). Boxes should switch if dropped onto one another, or return to their original position if not dropped on a box. All the movement for boxes between containers has been done, but I need to now animate the scales correctly depending on the weights. I've made a start, but I can't figure out:

    • When I should trigger the animations, especially in combination with the existing function. The program may need restructuring.
    • How to force the direction of the scale when it rotates
    • How to move the boxes with the scale and allow the user to move them afterwards

    If anyone could help, that would be grand! Cheers, Jack.

  • lunarray Great plugin! There are a lot of mentions of group tweening in this thread, but I can't seem to find it in the latest version of litetween. I have a few objects and when they move together, I want them all to rotate around the center point of the middle object. Can anyone help? I can provide my .capx soon, once I've tweaked a few bugs.

  • Thank you Nimos100! Your example helped loads, and with some tinkering and tuning I got it working the way I wanted. I've attached my capx.

    [attachment=0:31tu4r7y][/attachment:31tu4r7y]

    Seems like there is no bugs currently and is as optimised as I can make it.

    Thanks to everyone for their help, onto the new stage of development, animating!

  • It's still broken, but the logic makes sense to me, but I'm obviously missing something. I would love some advice on how to get it working.

  • Righto, so I got access to the standard edition of C2 today (it doesn't show up on my profile as it's a business license and this is my personal account).

    I rewrote a lot of the code to have the following functions:

    • Boxes snap to containers - DONE!
    • Boxes snap back to original container if dropped in empty space - DONE!
    • Boxes switch places if dropped on one another - Still broken!

    The code works in my head, but I'm obviously not understanding one of the ways C2 works. If anyone can have check out my .capx attached and see how to fix it, that would be grand!

    Cheers!

    [attachment=0:qj3ltdd8][/attachment:qj3ltdd8]

  • I think I have it, but it doesn't work because I'm pretty sure I need families to properly detect two of the same objects overlapping, hopefully I can get the full version in the next day or two.

    If anyone wants to download my capx and try and get the boxes to swap if overlapped (see posts above for more info), that would be terrific!

  • Thanks for that again! I'm away from my computer but that makes a lot of sense, except I have a question about one part:

    Pick bottom box (This is why you move the one you are dragging to the top, so its always the one already in the dotted box that gets returned)

    If I have 8 boxes on the same layer, wouldn't the box that is being overlapped might not be the bottom box on that layer? Or does that function select the item that is below the box and lower on the same layer?

    Tried to find some documentation on this but haven't found anything useful yet. Will try and implement what you sent me in a few hours and will let you know how I go.

    Thanks! Jack.

  • Thanks nimos100! That was really helpful. Thought about this overnight and had thought of some of those methods myself, it just learning how to do it within C2. There are some things I didn't understand from your post, hopefully you can help me understand them.

    Also you add the pin behaviour.

    For each of the boxes and the dotted areas that holds them in the bottom, you add a variable, could be the color if they are unique. This is so you know where each of them should go If they are replaced or dropped outside the dotted boxes.

    So when you have to return them you just test on this variable.

    I didn't state this properly in my original post (so my fault), but the blocks should be able to moved multiple times and reordered (so it could be green, red, purple, yellow, blue, etc). From what I presume you said, this would fix the objects to a container.

    I have been able to implement a few things based off what you said and some investigation of my own, the capx is available here. I currently only have the free version, but am in the process of getting the full version shortly so I can use families instead of objects.

    I have implemented:

    • Moving shapes
    • Boxes snapping to containers
    • Boxes returning to container if not moved to container

    What I would love help to implement is how to make objects switch positions. When a box moves into a container that has a box in it, it needs to send the box that was there to the container the new box came from, so their places 'switch'. I put a note in the .capx.

    I'm really impressed with how quickly I can prototype in Construct 2.

    Cheers, Jack.

  • Try Construct 3

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

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

    My name is Jack and I'm creating an educational game for our Computer Science textbook, and am looking for assistance in making our idea a reality. I have a few years programming under my belt (I now teach it to students) but haven't had much experience with game programming (except for text based games in Python) or Construct 2.

    The program I want to design is explained here with diagrams, and most of it is things I can implement myself, however there are a few things I don't know how to do. Construct has allowed me to quickly add the dragable squares with touch controls, however the part I'm stuck with is how to make drag-able squares only be moved to certain spots with some particular behaviour. I've copied some of the text from the link below.

    [quote:18fchstx]These diagrams show the main interface for the program. The program starts with several coloured boxes in a line at the bottom with a set of scales above. The dotted lined areas are places where a box can be moved to (also the areas where a user should be able to select the box from that area), and only one box can be in one area at a time.

    The user should be able to move the boxes (either by dragging with the mouse or with touch) from one area to another (see figure 2). If a box is 'released' (by letting go with the mouse or touch) into an area that already contains a box, the boxes switch position (as in the moved box adopts the new position and the box at the position moves to the origin of the moved box). Boxes that are released into area not surrounded by dots is returned to its original position.

    The program does not require physics, each box has a weight property that is used for determining the scales animation. When at least one box is in one of the two scale areas, the scales and box/es move depending on a comparison of the weight property of the boxes.

    If anyone could point me in the right direction on where to start, that would be a huge help! I can't seem to find any posts for my particular problem (but I might not be searching the right keywords).

    Cheers,

    Jack

    EDIT: Added text and images from link

  • Hey everyone, can't wait to start making my game idea a reality. I'm a programmer by day, but looking forward to using Construct instead of having to develop a whole framework and engine myself.

JackAttackNZ's avatar

JackAttackNZ

Member since 10 Mar, 2013

None one is following JackAttackNZ yet!

Connect with JackAttackNZ

Trophy Case

  • 11-Year Club
  • Email Verified

Progress

12/44
How to earn trophies