Cross_'s Forum Posts

  • A bit of background: I am trying to create a retro side-scrolling platformer. For this I am using a Platform behavior on my player character, and enabled Integer coordinates in the view properties. Platform max speed is set to 80. Acceleration & deceleration are set to huge values like 1000 to get instantaneous speed changes. If I also add ScrollTo behavior to the player everything works fine.

    Now I want to do some fancy custom scrolling and that's where things are breaking. I removed the stock ScrollTo behavior and added a very simple event to the bottom of the sheet:

    Every tick: Scroll To X= Player.X

    This almost works except scrolling stutters by 1 pixel. I see the player move past the center by 1 pixel and then he snaps back to the center one frame later. My theory is that the Platform behavior updates the Player.X after my events are run.

    Can anyone confirm that is the case? If so, what are some workarounds to do custom scrolling without relying on ScrollTo ?

  • Read the page that Yann linked. The original Pac-Man is not using pathfinding; as a ghost approaches an intersection it merely measures the distance to its target location and then picks one direction.

  • and during "long" sessions, it gets slower over time.Define long.

    Played it for 3 minutes on a PC with powerful CPU and a slow graphics card. In Chrome the FPS alternated between 49 and 51 with no problems.

  • Just tested it with Chrome and built-in graphics card. Graphics seem to be okay. There's an occasional stutter (garbage collection?) but it's not too noticeable.

  • Other layouts do not impact performance (much). Only the current one is being processed (unless there are global objects in other layouts).

    Off-screen sprites do not affect graphics performance since they will be culled by WebGL. However, C2 is still processing them so there is a CPU cost for each instantiated sprite.

  • There's an article about CAs for water & fire in the book "Game Programming Gems 3". Get the book or ask the author Tom Forsyth (tomf_at_muckfoot.com) for a PDF.

    Found it:

    home.comcast.net/~tom_forsyth/papers/cellular_automata_for_physical_modelling.html

  • If I set full screen mode to on, the screen size no longer seems to stay to 640x960.

    What does this mean? Of course it will be bigger or are you talking about the layout being stretched/cropped ?

  • Thank you R0J0hound for taking the time to explain this! Now it makes perfect sense.

    I thought there was some special trick going on in the destruction part, but we just destroy arbitrary healthbars/shadows and then grab whichever one is available for display purposes during the next tick.

  • Does C2 maintain one SOL per object type?

    Line3 sets the Sprite SOL to the one we clicked on. So that array will usually only contain one Sprite.

    Line4 checks that picked Sprite (array) against Health<=0. So far so good. Then we have the ForEach condition which according to the manual does not reset the SOL, thus by doing ForEach Sprite we would only iterate over that one sprite coming from line 3.

    Then we get to line 5 which is System.Pick Healthbar instance 0. So far we have not filtered any healthbars so I would expect System.Pick to operate on ALL healthbars in the layout, and instance 0 of all healthbars could be any which one not necessarily the instance we are looking for <img src="smileys/smiley5.gif" border="0" align="middle" />

  • Anyone?

  • It works, here is a example as proof:

    http://dl.dropbox.com/u/5426011/examples%209/container.capx

    It looks like this shouldn't work and yet it does.

    In conditions 5/6 you pick the first instance of healthbars / shadows why does this destroy the one that matches the underlying object and not the first instance created ?

  • Let's say I have a few dozen sprite frames as individual images; is there a way to automatically convert them to a sprite strip? (Preferrably using Photoshop instead of other 3rd party tools.)

  • <img src="smileys/smiley24.gif" border="0" align="middle" />

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Not seeing this problem in your capx. Here's a screenshot running in Chrome, zoomed in. It's blurry because of the zoom but there is no noise compared to your initial example.png

    <img src="http://i.imgur.com/XCSJS.png" border="0" />

    ETA: Testing was done on a PC with just the built in intel graphics chipset. Preview mode only, not exported. I checked the PNG inside the capx with Photoshop and it's perfect, no alpha channel problems there.

  • The lerp function can help. To fade out you could do:

    Every tick: set opacity = lerp(self.opacity, 0, 0.5*dT)

    to fade in:

    Every tick: set opacity = lerp(self.opacity, 100, 0.5*dT)

    To alternate between the two, use a sine function:

    Every tick: set opacity = 100* sin(time*50)

    scirra.com/forum/lerp-clarification_topic48641.html