R0J0hound's Forum Posts

  • Nothing looks amiss to me, and my tests result in correct results for me. Do you set the size of the ExplosionSprite anywhere else in your events?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I believe you're mistaken, it wasn't removed, it never was there.

  • Spritefonts are primarily just mono spaced fonts (aka all the same width) although it is cool you can get it working with variable width fonts as well. For the case you cited of using the Arial font why not just use the text object? It's use is basically the same as adding text in photoshop or any other program you mentioned.

  • zenox98

    Yes, and I recommend it's use in my post, but a instance variable is still needed to save what the scale is set to as there is no expression for Sprite.scale builtin.

  • I didn't address point number one but here is a possible solution to number 2:

    /examples19/wall_crawl3.capx

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

    Some more tinkering may be needed to perfect it.

  • Hi,

    I don't mean to step on toes but unfortunately Sprite doesn't have a scale expression. So here are the steps to get the effect you want.

    1. Add an instance variable to your sprite, call it "myscale" and give it an initial value of 0.1.

    2. Add an event with the "compare instance variable" condition and set it up as follows:

    Sprite: myscale<1.0
    ---> Sprite: add 1.0*dt to myscale
    ---> Sprite: set scale to myscale

    Note, the first action is the "add to" action under "instance variables" and the 2nd action is "set scale" under "size & position".

    This will need some tweaking to make it happen in one second. As it is now the expression 1.0*dt can be read as 1 per second, but we're going from 0.1 to 1.0 in a second, or just 0.9 in a second. So it should be like this:

    Sprite: myscale<1.0
    ---> Sprite: add 0.9*dt to myscale
    ---> Sprite: set scale to myscale

    Another thing you can deal with if you like is what I like to call over shooting. With this event the end scale will likely be a bit more than 1.0. You can use the min() expression to limit the highest value to 1.0 and set up your event like this:

    Sprite: myscale<1.0
    ---> Sprite: set myscale to min(self.myscale + 0.9*dt, 1.0)
    ---> Sprite: set scale to myscale

    As a final note you can make the duration longer or shorter by tweaking the dt expression.

    half second:

    2*0.9*dt

    two second:

    0.5*0.9*dt

  • Would something like this work?

    global number bspeed=100

    bullet collides with enemy

    pick all bullet

    ---> add 1 to speed

    ---> set bullet speed to bspeed

    The "pick all" condition can be used so not just the bullet that collided is selected. "bspeed" is a global so when you create new bullets you can set there speed bspeed. Of course that's just an assumption, you could also just omit the global and use bullet.Bullet.Speed +1.

  • You can get a screenshot by pressing the "PRTSC" button on the keyboard and pasting into mspaint.

    The image you posted was actually from one of my projects and the cap is in this topic:

    http://www.scirra.com/forum/how-to-make-minecraftlike-lavawater-physics_topic41488_page1.html

    There isn't a direct counterpart of custom attributes in C2 although I think you could do something equivalent with families, Boolean instance variables and some more events. Although I would opt for a different approach.

    For the example of an attribute like "left" you could do something like the following:

    1. Make a family and call it "left_attr" and add any objects that could get that attribute to it.

    2. Add a boolean instance variable to the family and call it "left".

    3. Then in events or the editor you can give the objects the left attribute by setting "left" to true. Also to reproduce and event like "sprite overlaps left" you would do the following:

    left_attr: Is left

    sprite overlapps left_attr

    Oddly enough after I answered your question about growing grass I made a capx to experiment with similar water physics. It's not perfect but it does work better than the CC version. Have a look if you like but be warned I used some math trickery to reduce the number of events.

    https://dl.dropboxusercontent.com/u/5426011/examples19/2dgrid.capx

    Left click to draw walls, right to erase.

  • Cool deal, I should have searched before posting. I may end up using this eventually anyway. It's an interesting way to make an object on the next layout without making the object global.

  • I forgot to search for existing bugs and was informed about this existing one:

    http://www.scirra.com/forum/r116-changing-layout-and-on-destroyed_topic62431_post383279.html

  • Link to .capx file (required!):

    dl.dropboxusercontent.com/u/5426011/bug/bug_negative_objectcount.capx

    Steps to reproduce:

    1. Create a project and add a second layer.

    2. Add a sprite and a particle object to layer 1.

    3. Make the particle object "one shot" and make it's timeout 0.5.

    4. Add two events:

    every 1 second -> got layout 1

    Sprite: on destroyed -> Sprite spawn particles on layer 0

    5. Run in debugger.

    Observed result:

    After the capx restarts the layout about 4 times the objectcount will be negative.

    Expected result:

    It should never go below 0.

    A few more observations about the bug

    It only occurs if the sprite is not on layer 0.

    Browsers affected:

    Chrome: untested

    Firefox: yes

    Internet Explorer: untested

    Operating system & service pack: Vista sp2

    Construct 2 version: 149

  • Aurel

    If you're able to make the object count negative then I'd most certainly say it's a bug that should be fixed. I can't find a way to reproduce it, but if you can make a minimal capx or make your capx as minimal as possible and report it to the bugs forums that would be good.

    While BluePhaze's advise is true in many programming languages, for C2 it's not. It's designed to make it completely safe to still access objects directly after they are destroyed and once they are completely destroyed you can no longer access them.

    ramones

    That seems to be some odd behavior there, so I filed a bug. I would expect no object to survive a layout change unless it were global, regardless what event it were created from.

  • Link to .capx file (required!):

    dl.dropboxusercontent.com/u/5426011/bug/bug_creation_from_destructor.capx

    Steps to reproduce:

    1. Add a sprite and add an "on destroyed" event.

    2. In that event have another object get created.

    3. Then make an event to change or restart the layout.

    Observed result:

    When the layout changes the object created in the "on destroyed" event still exists.

    Expected result:

    I would expect no objects to survive a layout change unless they were global.

    Browsers affected:

    Chrome: untested

    Firefox: yes

    Internet Explorer: untested

    Operating system & service pack: Vista sp2

    Construct 2 version: 149

  • Yes it's possible. First off just design your pages in the layout editor. With a window size of 640x480 and ten pages you'll want your layout size to be 640*10x480 or 6400x480 and just position all your text and whatnot on the layout keeping in mind that every 640 pixels is a new page. Next here is a way to setup your events to scroll around using a click drag.

    global variable oldx = 0
    
    On left mouse clicked
    ---> set oldx to Mouse.AbsoluteX
    
    left mouse button is down
    ---> Set scroll X to scrollx+oldx-Mouse.AbsoluteX
    ---> set oldx to Mouse.AbsoluteX
    

    All that's left is to move to the closest screen when not dragging. This can be done with one more event like this:

    else
    ---> Set scroll X to lerp(scrollx, round((scrollx-320)/640)*640+320, 10*dt)

    Where:

    640 is the window width

    320 is half the window width

    10 is basically a speed

  • Sargas

    In event 15 it has the condition "hex owner=0". This is where the seeming priority comes from. You can disable that condition and it will spread correctly, but base2 will overwrite areas base has and vise-versa. One idea for a remedy for that would be to add a Boolean variable to hex and call it say "owned" and replace that condition in event 15 with a "[negated] hex is owned". So with that it will spread correctly but we also need to set "owned" to true eventually so we do that by adding a sub-event to event 4:

    system: Pick all hex

    hex: owner != 0

    ---> hex: set owned to true