R0J0hound's Recent Forum Activity

  • Try inverting an "is overlapping" condition.

  • That's good to know. It makes sense since capx files need to be unzipped somewhere to be editable. I have a suspicion that may be the main cause of capx corruption. :/

    One workaround for the future could be to use a project folder save instead of capx files.

    Ashley

    Just curious if it would be feasible to have c2 extract capx files to another location other than the temp folder when editing? Or I wonder if there's a way to block them from being deleted while the project is open.

  • You can't seed c2's random(). You'll need to use a third party plugin like the random plus or noise plugins.

  • One way is to use a variable.

    global number target= -1
    
    on right clicked on enemy
    --- set target to enemy.uid
    
    Player.selected = 1
    pick enemy by uid target
    every 0.1 seconds
    --- rotate 20*dt derees towards (enemy.x, enemy.y)[/code:1wh115d3]
  • Wouldn't it be simpler to keep the origin as the center and have another sprite for the death animation?

    Or leave it as is and when you change to the death animation just move the sprite?

    You can use a little math to rotate a sprite around any point if you wish to do that instead.

    https://www.siggraph.org/education/mate ... 2drota.htm

    global number centerx= 100

    global number centery= 100

    global number ang= 10

    every tick

    --- sprite: rotate ang degrees clockwise

    ---- sprite: set position to ( (self.x-centerx)*cos(ang)-(self.y-centery)*sin(ang)+centerx, (self.x-centerx)*sin(ang)+(self.y-centery)*cos(ang)+centery )

  • No, it just means you need to access properties with foo["bar"] instead of foo.bar.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Or you could even do this if variable1 starts as 3 or 6.

    variable1 = 9-variable1

  • One way could be to create ring sprites at the boat that grow and fade to transparent.

  • Effects could probably do some of the pixel effects. The collisions would still need the pixels read from the image, effects are of no use for that. You can read the pixels now using the canvas. It's kind of slow as it is but if you read it ahead of time into arrays (this doesn't even need to be done in game) and just compare all overlapping pixels from the arrays.

  • Sure there is, it's called math.

    The normal way to manipulate 3d points is to just change around the x, y, and z values to transform them. Then you use a perspective transform to map them to the screen.

    You can read about vectors and matrices for the nitty gritty of the math.

    To move you can just add numbers to the position to move them.

    To rotate look up 2d rotation for a formula to do it.

    Scaling is just a matter of multiplying the position by some values.

    For rotation and scaling it's always done around the center 0,0,0. To do it around some other point you need to first move everything over so the rotation point is 0 then after that move the points back be the same amount.

    Perspective in it's basic form is just dividing the x and y by the z.

    You can look around the forum for a few examples. Search for "pseudo 3d" with my username for some various examples. There's also some examples in the tutorials.

  • Looking at the source it uses a pixel array of the canvas and set's pixels individually for all drawing. It doesn't use any of the higher level stuff such as drawImage like most other games in html5 uses. In that regard it's very different than C2. The advantage is it can do those oldschool pixel effects like old dos games, for example the level transition and the dripping blood. Also do to it being low res without any scaling or rotation, per-pixel collisions can be used everywhere. The disadvantage is it has to be low res to keep up the performance, and there is no rotations or scaling of the sprites. Also no doubt they do a lot of tricks to keep things as fast as possible.

    What I got out of it that we might be able to use in C2 is a way to access pixels individually. The canvas kind of does this but things are inefficient. Basically reading pixels is pretty slow but it's much faster to write pixels, although it's probably not compatible with html5's other drawing methods. So maybe a plugin that allows you to manipulate an array of pixels that you can then copy to a texture. Only if events had zero overhead would it perform as well.

  • Here's a python library I made to do it.

    It's basically one for one what cc does when it saves. I've used it to do various things but editing events isn't really a simple thing to do, because .cap files don't store ACEs in a way that's easy to use. It's mainly just numbers and in order to decode it you need to be able to load the plugins to get at the text and such, but I haven't found a good way to do that yet.

R0J0hound's avatar

R0J0hound

Member since 15 Jun, 2009

Twitter
R0J0hound has 157 followers

Connect with R0J0hound