dop2000's Forum Posts

  • Yeah, this code makes no sense, but it's working as it's supposed to.

    Pigs (Pig2 sprites) are moving in arcs because pathfinding is clashing with bullet behavior. If you disable Bullet, Pig2 sprites will move straight to the first instance of Family2. (Since there are multiple Family2 instances, an instance with the lowest UID is used as pathfinging target in event #7).

  • After you upload it, use "img" tag:

    [img=4172]

    Here is your image:

  • I think you should use TileMap.

    See this example, it's the same principle:

    dropbox.com/s/8zap7yuhwdb0pcb/Farming_TileSet.capx

    dropbox.com/s/r1em8npglbdsoeg/Tilemap_Bitwise.png

  • Not unless you have other events or behaviors preventing this.

    Why don't you just share the capx? We'll be able to tell you how to fix it straight away.

  • nicmic

    Well, like I said - check turret properties, compare them with the template. If this doesn't help, please share your capx.

  • So what's wrong - does it turn? Does it fire?

    Check turret properties - rate of fire, initial state, range etc.

    Open the default template for turret (File-New in Construct and type Turret) and compare settings with your project.

  • Are these sprites? I suggest using TileMap object.

  • What exactly are you trying to achieve?

    Angular velocity is the speed of rotation. And density is basically mass of the object. Adding them together makes little sense.

    I'm guessing you need normal (linear) velocity. You can use VelocityX if your ball is moving horizontally, or this expression to get its overall velocity:

    distance(0, 0, Ball.Physics.VelocityX, VelocityY)

    Also, you should probably multiply velocity and density together, not add them.

    .

    Add a text object to your layout and print the result of this formula to see what numbers it's generating.

  • Angular velocity value can be negative, add abs() expression.

  • Well, if the screen will only change between portrait and landscape, you can create an event "Browser on resized" or "Browser is portrait/landscape", where you reposition all physics objects relative to the new screen dimensions.

  • Yeah, you can't abuse physics objects like that..

    I'm not sure what you can do to prevent it. Maybe add another event - if box is not on-screen, return it to the center of viewport.

    But it's really not recommended to change position of physics objects using non-physics actions or behaviors.

  • This is pretty bad.. What method did you use to build the apk? Have you tried the same project in C3?

    If you can make a small capx to reproduce this bug (maybe record a video or something), you should report it.

  • You can do something like this:

    On Right key pressed -> Player start "Step" animation
    
    On animation "Step" ended
     Keyboard Right key is down -> Player start "Run" animation
     else - > Player start "Idle" animation
    
  • Your problem is in this expression:

    touch.YforID(thumbstickstick.TouchID,"Controls")

    The second parameter ("Controls") is supposed to be layer name, in case you have layers with different parallax setting. And on your layout there is no layer with this name.

    So you need to change it to ThumbstickStick.LayerName or you can simply remove it:

    touch.YforID(thumbstickstick.TouchID,ThumbstickStick.LayerName)

    or

    touch.YforID(thumbstickstick.TouchID)

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 2) Correct! Technically defining instance variables on families is the same as defining them on individual objects, but with families you can make your code more efficient and compact. If you add Health variable to each of your enemies sprites, you will have to add a bunch of almost identical events:

    If Zombie.Health<=0 then Zombie destroy

    If Vampire.Health<=0 then Vampire destroy

    ...

    If you add them to a family and define Health variable on the family, you can have just one event:

    If Enemies.Health<=0 then Enemies destroy

    .

    3) Yes, you can make one object with multiple animations instead of the family of objects. But what if you need animations to actually animate different states of the sprite (for example zombie running, zombie attacking)?

    Also, the cool thing about families is that you can add one object to several families, and use these families for different purposes!

    For example, you can have Zombie and Vampire in family Enemies, but also have Zombie, Vampire, Chicken and Player in family LivingCreatures. It will allow you to do this:

    Enemies on collision with Player -> Player subtract 1 from health

    LivingCreatures on destroyed -> LivingCreatures spawn BloodSplatter

    .

    4) In programming true is 1 and false is 0.

    So the formula (variable=0) can either return true (1) or false (0). If variable was 0, the result will be 1, and if variable was 1, the result will become 0.

    Here is another compact way to toggle a variable: Set variable to (variable=1 ? 0 : 1)

    This means "if variable=1 then 0, else 1".

    And of course you can do this the long way with two events:

    If variable=0 : Set variable to 1

    If variable=1 : Set variable to 0