calminthenight's Recent Forum Activity

  • It's caused by minute errors that are inherent in the values. Change your numbers to whole numbers and add 1 each time and it works fine.

  • Parents/children are known as the Scene Graph in Construct 3 and they allow child objects to transform with certain aspects of the parent object e.g X&Y pos, size, Z-elevation etc.

    Containers allow for the automated picking of objects within a container, meaning you do not have to specify the specific instance of an object you are trying to pick when referencing that object in relation to another within the container.

    But I believe you may be looking for 'families'. You can add many object types to a family and then execute code on the family. Families can also have instance variables that are inherited by the objects within the family. Families is a paid only feature however.

    Elsewise an easy and simple way is to use a single object for your icons and use different animation frames to represent the different buildings.

    You could use something like:

    On Icon clicked:

    if icon is animation frame 1 - create buildingicon at mouse.x,mouse.y & set animation frame to 1

    if icon is animation frame 2 - create buildingicon at mouse.x,mouse.y & set animation frame to 2

    etc.

    Every tick if buildingicon exists - set position to mouse.x,mouse.y

  • No Worries. Have a read up on how the code/event sheet is executed. It can take a little while to wrap your head around but once you do your code will be much more efficient and you will run into less problems like these.

    construct.net/en/make-games/manuals/construct-3/project-primitives/events

    construct.net/en/make-games/manuals/construct-3/project-primitives/events/how-events-work

    construct.net/en/make-games/manuals/construct-3/project-primitives/events/sub-events

  • Ok I understand the performance difference now using the erase tile action. I'll play with it in my spare time and see if I can come up with anything

  • The pick nearest/furthest condition is found in the size & position section of the object you are trying to pick. That being said, using containers like suggested is a much better solution. If you add the text into a container on the block object, the current method you are using should work as the block is picked by the collision and then when you reference the text it will automatically pick the instance that is in the container with that block.

  • You have a lot of conflicting animation calls. In some events you are telling one animation to run based on a condition, and in another event you are telling a different animation to run based on the same condition. Your structure was causing some problems also. I have disable all your other events that trigger animations and re structured the "pickup and drop pick" section so that the pick animations work as intended. You should compare it to your original structure to see what the differences are. You will also need to go back through your other events that trigger animations and define more conditions that determine if those animations are played or not so that they don't interfere with any others.

    1drv.ms/u/s!AkmrWgxeuxlKhIcyyzqC6bgjuML71Q

  • Post a link to your project file and I'll have a look

  • Add trigger once while true beneath the inverted 'animation is playing' condition and see. It could be because you are using a boolean state to trigger the animation that every tick that that condition is true it is starting the animation, thereby never getting passed the first frame.

  • Post your project file so people can see what you have done. This is impossible to analyse without it.

  • You need to use a container. Add the enemy sprite into a container on your controller object, then when you create/spawn a controller, the enemy sprite will be automatically created at the same location. After the create action, in the same event, you can add the enemy sprite as a child of the controller.

    Then for the collision event you need: Controller on collision with XYZ - set Enemy Sprite animation to "collision animation".

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Something like: Ball - On collision with block - pick text nearest to ball - set text to XYZ should work

  • If you have chosen to have the child object transform with the x and y positions of the parent then this will interfere with any independent movement of the child object.

    If not, you can use instance variables to store the X and Y coordinates of the object and then use them to navigate back to.

    For example.

    On left click

    - Set object var_x to self.x

    - Set object var_y to self.y

    - set position to mouse.x, mouse.y

    On right click

    - set position to self.var_x, self.var_y

    If you want it to transform with the parent object and the parent object is also moving, you can still use variables to store the position but you would use distance and angle to the parent instead of self.x self.y.

    For example.

    On left click

    - set object var_distance to [distance(parent.x,parent.y,self.x,self.y)]

    - set object var_angle to [angle(parent.x,parent.y,self.x,self.y)]

    - move to mouse.x, mouse.y

    On right click

    - Set position to

    X: [parent.X+cos(self.var_angle)*self.var_distance] Y:[parent.Y+sin(self.var_angle)*self.var_distance]

calminthenight's avatar

calminthenight

Member since 28 Jan, 2018

Twitter
calminthenight has 6 followers

Trophy Case

  • 6-Year Club
  • Forum Contributor Made 100 posts in the forums
  • Forum Patron Made 500 posts in the forums
  • Regular Visitor Visited Construct.net 7 days in a row
  • RTFM Read the fabulous manual
  • Email Verified

Progress

11/44
How to earn trophies