R0J0hound's Recent Forum Activity

  • To do that you just need to pick the other block to swap with. This is where the family comes in so you can pick two separate instances of the block. Basically create a family, call it "other" and add the block type to it. So for example if you wanted the block you click on to swap with the block to the right you could do this:

    global number tempx=0

    global number tempy=0

    on right clicked on block

    other: x = block,x+32

    other: y = block.y

    --- set tempx to block.x

    --- set tempy to block.y

    --- block: set position to (other.x, other.y)

    --- other: set position to (tempx, tempy)

  • I wouldn't download that dll. It's core to the windows operating system, if it's crashing then something is very wrong with your system. Have you tried upgrading your graphics card driver?

  • Yes, you could use overlapping at offset and some picking with a family I suppose.

  • The canvas plugin is causing the cpu usage when webgl is on. Basically it has to copy the canvas to a texture every tick. If you disable webgl it's fast or alternately you could use the paster object instead.

    dellong

    Nice examples. I didn't think of using the circle for the rainbow, but it looks effective. The only issue you'll run into by fading the canvas like that is the images never fade away completely do to rounding, unfortunately there's nothing that could be changed to make it better. It's more noticeable on certain monitors or if you look at the screen from an angle. Still it's a good effect that I'll use again.

    bilgekaan

    If you're interested in existing solutions you can look here for one using sprites:

    viewtopic.php?f=147&t=164029&p=992930&hilit=trail#p992930

    It can be tuned to not use as many objects if performance becomes an issue.

    For trails with textures the paster object would need to be used.

    newt

    Paster's draw textured quad action handles this well, notion special needed to be done for repeating textures.

    /examples31/draw_path_paster.capx

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

  • You'll have to destroy and re-create the joints.

  • Here's a simplified capx that most of the time creates all the combinations without two of the same type next to each other. It uses an array that stores all the combinations with some text like "sprite:0". Then the array is shuffled by swapping values while trying to keep each two of the same type from being next to each other.

    https://dl.dropboxusercontent.com/u/542 ... ndom2.capx

    As far as moving the objects or using families, you can do anything you like there. All this does is create the objects. Think of the "create" function as a create action with a family as a parameter, only this follows your controlled random requirement.

  • Considering you're using the physics behavior you can do it by changing the rotation of the layout and setting the direction of the gravity.

    eg:

    set gravity to 10*cos(layoutAngle), 10*sin(layoutAngle)

  • I'm not super familiar with what i did in the example anymore and it's too much trouble for me to use a multitouch device to test but you could possibly do the following. Considering I haven't made any math errors.

    Basically keep track of the current and previous positions of the touches and then use a dot product to get a signed distances in particular directions (parellel and perpendiculat to the box's angle). Basically that's to get the scaling factors in either direction. Next in order to actually scale in those directions I used another dot product like above and then used some trig to get a resulting position. Likely the math could be simplified further if you like.

    global number oldtouch0x=0

    global number oldtouch0y=0

    global number oldtouch1x=0

    global number oldtouch1y=0

    on touch 0

    --- set oldtouch0x to touch(0).x

    --- set oldtouch0y to touch(0).y

    on touch 1

    --- set oldtouch1x to touch(1).x

    --- set oldtouch1y to touch(1).y

    touch id 0 is touching

    --- box: set position to self.x+(touch(0).x-oldtouch0x), self.y+(touch(0).y-oldtouch0x)

    global number ang=0

    global number xscaling=0

    global number yscaling=0

    global number dotn=0

    global number dotd=0

    global dotx=0

    touch id 1 is touching

    --- set dotn to cos(box.angle)*(touch(1).x-touch(0).x)+sin(box.angle)*(touch(1).y-touch(0).y)

    --- set dotd to cos(box.angle)*(oldtouch1x-oldtouch0x)+sin(box.angle)*(oldtouch1y-oldtouch0y)

    --- set dotx to cos(box.angle)*(box.x-touch(0).x) +sin(box.angle)*(box.y-touch(0).y)

    --- set xscaling to dotn/dotd

    --- set dotn to cos(box.angle+90)*(touch(1).x-touch(0).x)+sin(box.angle+90)*(touch(1).y-touch(0).y)

    --- set dotd to cos(box.angle+90)*(oldtouch1x-oldtouch0x)+sin(box.angle+90)*(oldtouch1y-oldtouch0y)

    --- set doty to cos(box.angle+90)*(box.x-touch(0).x) +sin(box.angle+90)*(box.y-touch(0).y)

    --- set yscaling to dotn/dotd

    --- box: set x to touch(0).x+xscaling*dotx*cos(box.angle)+yscaling*doty*cos(box.angle+90)

    --- box: set y to touch(0).y+xscaling*dotx*sin(box.angle)+yscaling*doty*sin(box.angle+90)

    --- box: set size to (self.width*xscaling, self.height*yscaling)

    touch id 0 is touching

    --- set oldtouch0x to touch(0).x

    --- set oldtouch0y to touch(0).y

    touch id 1 is touching

    --- set oldtouch1x to touch(1).x

    --- set oldtouch1y to touch(1).y

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Kat Editor

    The cap file is a lost cause. The most I could retrieve is 48 of the 52 images in the file. After that the file is all zeros, so events, object types, etc cannot be recovered.

    I pm'd you a zip with the recovered images.

  • The rules as written don't really give good results:

    https://dl.dropboxusercontent.com/u/542 ... andom.capx

    A few notes on the capx:

    An array instance for each object type is used to keep track of what frames can be picked.

    A family isn't used since you can't specify what member of the family to create, but no matter it only added two events.

    There are a total of 9 different frames in the capx so it just created nine rows of nine to test the idea.

    It looks good toward the beginning of the run but the end of the run almost always looks the same. However it may look better if each sprite had the same amount of frames.

    Probably these rules would work better to run through all the frames in a more distributed manner:

    never create the same sprite twice in a row. (unless there are no other choices)

    the random object picked should be based on how many frames are left for a object. (So an object with more frames are more likely to be picked)

    Once all frames are picked, reset.

    mindfaQ's link may be applicable.

  • An action like this would do it

    set text.text to replace(text.text, "5", "")

  • You could use the Keyboard object and use Keyboard.StringFromKeyCode(Keyboard.LastKeyCode) to get the last key pressed.