R0J0hound's Forum Posts

  • eli0s

    Maybe I've become accustomed to it.

    I did a bare basic js test of motion and even then it's not buttery smooth.

    http://jsfiddle.net/us1v4sq4/1/

    Also added a graph of the frame time to inspect it further

    http://jsfiddle.net/us1v4sq4/2/

    For me there are some little spikes in the frame time, but it doesn't really correlate to the motion.

    Not sure what can be done to improve it. The issue may lie in the web browser itself.

  • Other stuff running in the background have much less of an effect than Garbage collection. Garbage collection is automatic and in javascript you can't control when it happens as far as I know. Ashley has done a lot to keep the amount of garbage made by the engine to a bare minimum according to his blog posts.

    I don't really notice the lag, but then again my pc is dog slow with html5 as it is.

  • Another interesting idea would be to use

    http://en.wikipedia.org/wiki/Dijkstra%27s_algorithm

    The idea is to use an array to store the direction to move for every spot to get to the target with the shortest distance. It's just as easy to have more than one target so it's good for many objects that need to find a path to the same set of targets.

    So after the array is calculated objects can move to the closest target by just referencing the direction of the square it's currently on.

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

    In the example I made the objects accelerate toward the direction instead of just setting the direction. The result was nice rounded turning.

    It caused a stall if I calculated the array all at once, so I adjusted it to only calculate a bit at a time.

  • JavaScript's garbage collection (GC) is one cause of stuttering. It's gotten better over time because web browsers are implementing ways so the GC causes shorter stalls. Some are better at this than others.

    Another reason is stuff running in the background, the underlining os can be as much of a culprit as other programs. The nes had a lot less variance since only the current game was running.

  • How is 0-100 limiting? Just convert a 0-255 value to 0-100 with value/255*100.

  • There's an example here:

  • Here are some topics with examples:

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • If you have a center location and a radius you can do this:

    Sprite set X to centerX + radius*cos(angle(centerX,centerY,mouse.x,mouse.y))

    Sprite set Y to centerY + radius*sin(angle(centerX,centerY,mouse.x,mouse.y))

  • If you have a center (centerX, centerY) and scale factor you could do it like this:

    x = (object.x - centerX)*scale + centerX

    y = (object.y - centery)*scale + centerY

    width = self.width*scale

    height= self.height*scale

  • Sure,

    It appears to swing because the sprite's origin point may not be in the exact center of the cog. You can adjust it in the image editor. Or it also may look like it's swinging because of the cog's shading.

  • Swinging?... Oh I see it. The sprite's hotspot may need a little adjusting.

  • For 1 you can zoom in to help or move objects to a locked layer.

    For 2 select all the objects you want, right click and select "Wrap Selection".

  • Here's one way here using detector sprites:

    For just a rectangle you can get away with having only 1 detector, I used 3 to handle crevices.

  • Sounds like this maybe?

  • Game develop actually was made a little after construct classic, before c2. The interface does look similar, but I don't think it's a ripoff. Mainly since it's author said he wasn't aware about construct when he first was making it.

    I've tried it a time or two, but it didn't really capture my interest. I didn't find the interface to be as intuitive as construct's, and it seemed that the event system requires you to be more verbose. It does have some interesting features though.

    You won't really get a lot of people saying they use it asking on this forum. Ask on their forum and you'll get a different response.