R0J0hound's Forum Posts

  • It looks like you used "Copy collision mask to each frame". It is currently broken and causes the collision mask of every frame to be empty.

    An oft used solution is to have a separate sprite for the collisions. Any behaviors are applied to the hitbox sprite, and player sprite's position, direction and animations are set with events.

    The events will look like this:

    + System: Always (every tick)

    -> Sprite: Set angle to hitbox.Angle

    -> Sprite: Set position to object hitbox (image point 0)

    + hitbox: [negated] is moving

    -> Sprite: Set animation to "idle"

    + hitbox: is walking

    -> Sprite: Set animation to "running"

    + hitbox: is falling

    -> Sprite: Set animation to "falling"

    + hitbox: is jumping

    -> Sprite: Set animation to "jumping"

  • You need to manually move the platform so the player can be moved with the same amount as the platform.

    Here's one way to do it using a dummy sprite. The motion is applied to the dummy sprite, then if the player is overlapping the platform move the player with the change of the dummy's position and then move the platform to the dummy's position.

    http://dl.dropbox.com/u/5426011/examples7/vertical_platform.capx

  • Try this for setting text to a number to two decimal places:

    int(num) & "." & int(num*100)%100

  • New version R3.

    newt

    I just noticed that alpha values have to be in the range 0 to 1. I fixed the descriptions and rgbaAt to reflect that.

    It will actually accept any CSS color value.

    http://www.w3schools.com/cssref/css_colors_legal.asp

    So you can use hsl or hsla also.

    Animmaniac

    Added a line width parameter to the "draw line" action.

    Also added a "draw circle" action. It only draws an outline, but if you want it filled use a "Fill path" action directly after.

  • New version released. Re-download from first post.

    newt

    You can draw with paths now.

    https://developer.mozilla.org/en/Canvas_tutorial/Drawing_shapes

    capx:http://dl.dropbox.com/u/5426011/plugins/pathDraw.capx

    rexrainbow

    Added fill canvas with gradient. It has horizontal,vertical,diagonal and radial.

    Pode

    It will refresh automatically now.

  • Drawing is relative to the canvas, so if the canvas has it's hotspot at the top left corner you would use:

    Draw point (Mouse.X-Canvas.X, Mouse.Y-Canvas.Y)

    newt

    That should be doable, I'll work on adding that.

  • Canvas Plugin updated 2/9/2014

    Download:

    https://app.box.com/s/vj4l7k8upl5ywoch9zf1qg0nt3064mnt

    Actions:

    Paste Object

    Resize canvas

    Draw point

    Draw line

    Draw box

    Fill color

    Clear canvas

    New R2:

    [Fix] Canvas will now automatically redraw.

    Actions:

    + Fill canvas with gradient

    Path drawing actions:

    + Begin Path

    + Move to

    + Line to

    + Quadratic to

    + Bezier to

    + arc

    + Rectangle path

    + Set line Settings

    + Fill path

    + Draw path

    Expressions:

    + rgbaAt

    + getImageUrl

    New R3:

    [Fix] pasting objects on scaled canvas'.

    + The draw line action now has a line width parameter [warning: may cause capx made with previous version not to open. + Draw circle action. [Fix] When choosing colors the alpha value is in the range of 0 to 1, rgbaAt now returns a usable value.

    New R4:

    [Fix] Now works with WebGL. (thanks to Yann)

    [Add] Additional hotspot locations top-right,top, etc...(thanks to Yann)

    [Add] Paste Layer action(thanks to Yann)

    [Change] Paste object/layer action now only paste visible objects.

    New R5:

    [Add] FloodFill. (Thanks to Pode)

    One of the interesting features this has is the way colors are chosen.

    You can use any of the following:

    "black", "blue", "orange", "gold", etc...

    "#00FF00"

    "rgb(100, 10, 1)"

    "rgba(20, 30, 40, 0.5)"

    "hsl(120, 50%, 50%)"

    "hsla(120, 50%, 50%, 0.5)"

    Note: alpha values are from 0 to 1.

    Another nice side effect of this plugin is you can now use all the effects that html5 has to offer.

    http://dl.dropbox.com/u/5426011/plugins ... index.html

    capx:

    http://dl.dropbox.com/u/5426011/plugins/effectTest.capx

    If anyone encounters any bugs or has a feature request for this let me know.

    -cheersR0J0hound2014-02-09 23:17:12

  • On xp the canvas is not currently hardware accelerated. It's only accelerated on windows systems with direct2d such as vista and 7.

    This probably will not always be the case as Mozilla's eventual plan is to use opengl to do the acceleration on systems without direct2d.

    Here's an overview of Firefox's rendering engine Azure:

    http://blog.mozilla.com/joe/2011/04/26/introducing-the-azure-project/

    And here's a forum with Azure's current progress:

    http://forums.mozillazine.org/viewtopic.php?f=23&t=2233499

  • I don't understand the question. You can set the acceleration with an action. What doesn't work? Or what happened and what did you want to happen?

    You can limit the max speed with clamp like this:

    + Always

    -> Sprite: Set Path Speed to clamp(Sprite[PathMovement].GetSpeed, 0, 'maxSpeed').

    Also keep in mind that acceleration is directional. Positive acceleration accelerates toward the end of the path, and negative toward the beginning.

  • You shouldn't need to store the card value in an array since it is easily calculated from the card number. If anything you can store the value in an instance variable for each dealt card.

    Change the order of your animation frames so that the Ace comes before the two. Then you can calculate the face value 1-13 as follows:

    (card % 13)+1

    Edit:

    I didn't see yann's post until now.

  • distance(0, 0, velocity_x, velocity_y)

    will give you the speed.

    angle(0, 0, velocity_x, velocity_y)

    will give the direction.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Only the most recently created/spawned instance is picked in the sub-events that follow. change event 4 so it's not a sub-event of event 3 and they should be able to get destroyed.

  • Why pay for what you can get for free?

    https://www.dropbox.com/s/7m8yck2a3t13s ... .capx?dl=1

    /examples7/rubber.capx

    Anyway hope you find it useful. If not, I had fun making it.

  • Adding an "if" condition is unnecessary as all conditions imply an "if".

    "else" would be nice to have as Construct Classic has it, but it can be simply done with inverted conditions.

    <img src="http://dl.dropbox.com/u/5426011/pics/ifelse2.png" border="0" />

    Which is what the branch plugin does, but if you want if/else to work with picking the you'll have to resort to events:

    <img src="http://dl.dropbox.com/u/5426011/pics/ifelse1.png" border="0" />

    "or" can be done like traditional programming by using a local variable:

    <img src="http://dl.dropbox.com/u/5426011/pics/or.png" border="0" />

    Or if you want to use "or" with picking:

    <img src="http://dl.dropbox.com/u/5426011/pics/or_with_picking.png" border="0" />

    "while" isn't really necessary as we already have the looping conditions "for" and "repeat".