Santhenar's Forum Posts

  • Solved, it was because the canvas object was not the same size as the game area.

  • Hi all,

    I've been trying to make dynamic shadows using the Canvas plugin.

    Basically by copying this:

    dl.dropbox.com/u/5426011/examples14/shadow_cast.capx

    However although as far as I can tell I've copied it exactly, my shadows are not appearing in the right places.

    <img src="http://i.imgur.com/HxAgBRw.jpg" border="0" />

    The shadows are working as intended, however their position is offset on the Y axis by a couple hundred pixels, and it looks like a few pixels on the X as well.

    <img src="http://i.imgur.com/JX0fnHA.jpg" border="0" />

    I can't see anything which could cause that, but admittedly I am copying this code more than understanding it.

    Any help would be great!

  • Try changing from (on key pressed) back to (space is down), but now add a (trigger once) condition together with them.

    Already tried that I'm afraid to say, it also makes no difference at all.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You are over thinking your custom jumping. Your desired effect can be achieved in two or three events.

    The reason I have set it up like this is so that the attributes of the jump can be modified as the player collects powerups.

    However if you've got an easier way, please, tell me more!

  • Try putting your other conditions together with the condition on space key is pressed instead of using them as a sub condition.

    Thanks, but sadly this makes no difference to anything at all.

    <img src="http://i.imgur.com/gjLpT2D.jpg" border="0" />

  • That was my thought too, but it doesn't make any difference. I can find no difference between the two functions.

  • I'm creating a custom movement system for a platforming character.

    This is the Jumping.

    The problem is that when I hold down the space bar, the Player rises into the air, not falling until the spacebar is released.

    What I want to happen is for the player to do one jump per each press of the spacebar, no matter how long it is held down.

    I can't see why it doesn't do that with this piece of code...

    When the spacebar is pressed it sets Jumping to true, which should prevent the velocity from increasing until the spacebar is released and jumping is set to false again. But it doesn't do that. The player just keeps on rising into the air.

    Pls help.

    <img src="http://imgur.com/X0Mz62G.jpg" border="0" />

  • Ok, so I want to make a rope which is build out of sprites linked by the pin behavior. I also want to be able to increase the length of the rope dynamically by adding more segments.

    The reason I am using the pin behavior rather than joints is that I want to be able to control the physics myself and not rely on any other physics engine.

    The problem comes when a new segment is created I need it to be able identify the preceding rope segment and pin to that, however each segment in the rope is an instance of a family and it's not possible to specify a family.UID as target for the pin behavior.

    Any help would be much appreciated! :)

  • Test post

    (If I can post I will do the proper body in the next post.)

  • Haha, thanks so much!

  • I want to set the default layer for when I drag objects into the layout.

    I had it set earlier but I can't remember where the option is :S

    Cheers!

  • Hi!

    Capx file here:

    www1.datafilehost.com/d/00c621cc

    So I have a cat with a tail, the tail is made of segments joined together by the Pin behaviour. I want to be able to add segments to the tail at runtime, but I'm not too sure how to go about it.

    The problem is that each segment has to be correctly pinned to the preceding segment, so the code has to be able to identify how many segments there are... I suppose I could use the count functionality to determine the number of instances and then use an asston of IF statements to determine where to add the segment.

    A further problem is adding the segment in the right place, the best way to do this is to call the "create object" function from the preceding segment and then attach the new segment to an image point. But I'm not sure how to make that work correctly at runtime no matter how many segments you already have.

    Any help would be great!

    And feel free to use the tail script for whatever, it's not perfect but I'm pretty pleased with how it works.

  • Thanks, I think I've found a workaround for my original problem, but the reason I don't want to use IF statements is as follows:

    What I'm doing is setting a value AngleOfMotion which dictates the movement of an object. I want to set AngleOfMotion each tick using the variables AngleOfMomentum and AngleOfGravity. So what I want is for AngleOfMotion to start off as AngleOfMomentum and then move towards AngleOfGravity. But there are constantly random forces acting on the object which change the AngleOfMomentum, so I'm basically trying to figure a way to get an object to fall in a natural arc, but still react to any forces applied to it. Without using built in physics (they <img src="smileys/smiley35.gif" border="0"> everything up).

    And I confuse myself just thinking about it :P

    So I suppose what I was looking for was:

    AngleOfMotion = (Half way between AngleOfMotion and (Half way between AngleOfMomentum and AngleOfGravity))

    That's where it starts to get complex.

  • Hi again mathemancers!

    Okay so I need to normalize a variable.

    i.e. I have variable X and variable Y, and I want Y to always tend towards X. So if Y is greater than X, reduce Y. And if Y is less than X, increase Y.

    Normally I would of course do this using IF statements, but that's kinda infeasible (or unreasonably complicated) for what I'm currently working on and I'm really hoping there's a maths algorithm than can be used here.

    Cheers!

  • I've managed to get it working pretty nice with my own little physics system, the tail flows about and flaps in the breeze like a scarf.

    The only problem left is gravity. Just moving each node of the tail towards the floor doesn't work properly.

    I need to... I need to add a gravity function to my custom physics thing. Yes that's what I need to do. But how would I do that. Currently it takes an angle of motion and a velocity to work out momentum. What I ideally want is for the angle of motion to slowly move towards 90 degrees (downwards), that way things will fall in a realistic arc. And when the angle is below the horizon I need the velocity to increase rather than reduce.

    Hmmm.... . .. . ... .. . .. . . . . . ..... . . .   

    The problem is that currently the angle of motion is set every 0.00001 seconds, so it can't gradually change. I guess I'd need a separate variable for the angle of momentum which would affect the angle of motion. So the angle of motion would take in the effects of gravity alongside momentum.

    Hmmm... I think maybe I need some coffee.