R0J0hound's Forum Posts

  • It's needed in that case since the rotation is being done manually. "Rotate" is not part of the behavior.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • If you want to create a gradient at runtime you can use the canvas plugin for that.

  • There are a few ways.

    One is to give the the object the bullet behavior and add an event like this:

    Every tick

    --- sprite: rotate 10*dt degrees toward -90

    Where 10 is the turning speed in degrees per second and -90 is the end angle.

    Another way that is useful from a trigger is to add a instance variable "turningSpeed" to the sprite to tell how fast it turns.

    Every tick

    --- sprite: rotate clockwise self.turningSpeed*dt

    start of layout

    --- sprite: set turning speed to -90

    --- wait 1.0 seconds

    --- sprite: set turning speed to 0

    --- sprite: set angle to -90

  • Not with the canvas plugin, it wasn't designed for it. It can be done if you wish to delve into the plugin sdk.

    With webgl off html5 canvases are as easy to draw as any other image so the main thing you'd need to change in a plugin is the draw() function to basically this:

    instanceProto.draw = function(ctx)
    {
    ctx.save();
    ctx.rotate(this.angle);
    ctx.drawImage(document.getElementById("myCanvas"),
    		0 - (this.hotspotX * this.width),
    		0 - (this.hotspotY * this.height),
    		this.width,
    		this.height);
    ctx.restore();
    };
    [/code:34paskcx]
    Where "myCanvas" is the id of the canvas you want to draw in C2.  It has to exist somewhere on the webpage.
    
    Making it work with webgl "on" requires converting the canvas to a webgl texture every time and that's not exactly a fast operation.  You can reference my canvas plugin to see one way to do it.
  • Sargas

    It is picked by default in sub-events, hence event 19 is working with the new object. It's the "pick all" that won't be able to pick it since the new objects aren't in the object list yet.

    This topic explains the reason:

  • Newly created objects can't be picked until the next top level event. So the object you just spawned is not picked in event 18 by the "pick all" condition. The new object is picked right after creation though, so you could do something like this:

    16|Block : on detroyed            | System: set blockY2 to Block.y1
      |System: move=0                 | System: set blockX2 to Block.x1
      |                               | System: set Move to 1
      +-------------------------------+
       17|System : for each block     | Spawner: Spawn Block on layer 2 (image point 0)
         |Spawner: Position=block.x1  | Block  : Set x1 to Spawner.Position
         |System : move=1             |
         +----------------------------+
          18|System: Pick all block   | Block : Add 1 to y1
            |Block : y1<blockY2       |
            |Block : x1<blockX2       |
            +-------------------------+
          19|Block : y1<blockY2       | Block : Add 1 to y1
            |Block : x1<blockX2       | System: set Move to 0
            +-------------------------+
    [/code:32dhaeow]
    You can simplify it further. The "move" variable events can be removed since it starts and ends as 0. Also the "for each" can be removed since "on destroyed" is run once for each destroyed object.
    [code:32dhaeow]
    16|Block : on detroyed            | System: set blockY2 to Block.y1
      |                               | System: set blockX2 to Block.x1
      +-------------------------------+
       17|Spawner: Position=block.x1  | Spawner: Spawn Block on layer 2 (image point 0)
         |                            | Block  : Set x1 to Spawner.Position
         +----------------------------+
          18|System: Pick all block   | Block : Add 1 to y1
            |Block : y1<blockY2       |
            |Block : x1<blockX2       |
            +-------------------------+
          19|Block : y1<blockY2       | Block : Add 1 to y1
            |Block : x1<blockX2       |
            +-------------------------+
    [/code:32dhaeow]
    
    One final observation, since you create a block for each destroyed block couldn't you instead just move the block instead of destroying it?
  • Sir, that is quite the run on sentence.

    So basically you have a ball on a box. When the box is clicked it's destroyed and the ball falls. The ball then hits a slope, bounces and then hits a triangle.

    At least that's the desired effect. So you're saying that when the ball hits the slope it gets destroyed instead of bounces? Again as stated in previous posts it's near impossible to guess what's wrong without seeing a capx. Making a copy of it and removing everything you don't want to share is one option.

    A few points though.

    * You said you gave the ball the physics behavior and then the bullet behavior do you can tell it to bounce. A rule of thumb is to not use other behaviors with the physics behavior, otherwise they'll clash. Furthermore the physics behavior should handle the bouncing automatically. The only parameter you have to control the amount of bounce is the elasticity of the ball and slope. After that motion should follow a realistic path.

    * Unless you have an event to destroy the ball I don't think it's being destroyed. Rather I'd say it's flying off screen at a high rate of speed. Just a guess though.

  • Beaverlicious

    Sure, feel free to hit me up on skype.

  • No other way other than maybe using the browser object to do the same thing as that plugin. But why not use the plugin to abstract away all the tediousness, not to mention there may be aspects of it that only can be done from the plugin.

  • Here's a plugin that may help:

  • You could use this mod of the canvas plugin that allows you to make gifs:

    I haven't tried it myself , and I don't know if it modified the latest version of the canvas plugin.

  • The gyro effect can be faked by adding some torque I think.

  • The problem of 3 holes being made is solved by adding a stop loop action when the terrain it hit.

    My second idea is flawed when I tried it myself, it would need a bit of tweaking to get it to work. The general idea is to move a pixel at a time until either terrain is encountered or the new position is reached.

  • It does create 32 objects in the loop, every time. The ones you don't see on screen are off screen, they were pushed there by the physics collision resolution. Notice how the sprites stack vertically before spreading horizontally. The two best things you can do is not create the objects on top of each other and make the walls thicker so it's harder for the objects to be pushed through the walls. Also enabling "bullet" in the physics properties may help. It could also be that some of the blocks are falling out over the side walls since there is no top wall.

    Edit:

    If you're on not getting 60 fps on mobile then physics will go slower. You can change the "stepping mode" to "framerate independent" to fix that. By default "fixed" is used because it makes physics simulations more stable. That just means that instead of dt being used, 1/60 is.

  • Nothing's wrong from the look of it. Is numbers.Count not equal to 32 after the loop?