R0J0hound's Forum Posts

  • 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.

  • 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.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 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".

  • If not using families you'll have to do it like this for each object type:

    On Function "Properties"

    System Compare: Function.Param(1) equal to "ObjectA"

    ----Set Array(1) ObjectA.X

    ----Set Array(2) ObjectA.Y

    System Compare: Function.Param(1) equal to "ObjectB"

    ----Set Array(1) ObjectB.X

    ----Set Array(2) ObjectB.Y

    But bear in mind that only the first instance of of a object type will be used. To get around that pass a second function parameter with the UID of the particular instance you want saved, and pick it with the "Pick by UID" condition.

  • The % symbol gives the remainder of a division.

    So with loopindex % 5 you get:

    0 % 5 => 0

    1 % 5 => 1

    2 % 5 => 2

    3 % 5 => 3

    4 % 5 => 4

    5 % 5 => 0

    6 % 5 => 1

    7 % 5 => 2

    8 % 5 => 3

    9 % 5 => 4

    so each frame each animation frame is used twice.

  • Your link isn't working. Since Construct stopped working in the middle of the saving process the whole cap may not be recoverable. Post the cap again and I'll at least be able to recover most of the images.

  • The chrome and antivirus issue may be this one:

    http://chrome.blogspot.com/2011/09/problems-with-microsoft-security.html

    It's likely slow because firefox doesn't use canvas acceleration in winxp.

    This is talking about ff5 but ff7 seems the same.

    http://www.favbrowser.com/firefox-5-and-hardware-accelerated-canvas-for-mac-os-linux-xp/

  • I wouldn't use a different object type for each card. You should just need two. One for the positions and on with all the different cards as animation frames.

    Then it can be done simply with two events:

    http://dl.dropbox.com/u/5426011/c2/cards.capx

    You can then pick a card at say position 6 with two conditions:

    Sprite: instance variable position=4

    Pick Card by UID: Sprite.card

  • Just give the enemy sprites a high x speed away from the player:

    http://dl.dropbox.com/u/5426011/examples7/knockback.cap