dop2000's Forum Posts

  • You do not have permission to view this post

  • I still not sure I understand your question. You need to set the correct position of the sprite first, and then pin it to another object.

    If this doesn't work correctly and the sprite is misplaced, check Origin image points of both objects.

  • part12studios Functions help to keep code organized and optimized. My function "StarageSave" in the example above can be called many times from different parts of the game. For example, when player finished a level, made some purchase etc.

    You didn't notice "wait for previous action to complete" before, because it was only added in version r157 :) See that video link I posted.

    Using "Wait 0.1" with asynchronous events is not a good idea, as sometimes the delay may be bigger than 0.1s

    All actions inside one event are executed in sequential order. I'm not sure I understand what's your concern here.

  • System -> Set layout scale

    Make sure your layout has layers with non-zero "Scale rate".

  • Here is how I usually do this, I read LS from Loader layout and after the data is retrieved/missing (Level variable becomes>0), I switch to the main layout. The dictionary is only used for easier storage, all keys from the dictionary are copied over to global variables.

    You can simplify these events further with this new feature:

    youtube.com/watch

  • Your ball is only 2x2 px and has square collision polygon. It will not bounce properly. You need to change the reflection angle yourself when the ball hits any wall or paddle. Try this:

  • It's possible using a small PHP script, you post data to it with AJAX and it saves it in a file. See this post:

    construct.net/en/forum/construct-2/how-do-i-18/savecsv-file-server-137535

    Other possible solutions are sending JSON strings to MySQL database or to Google Spreadsheets.

    construct.net/en/tutorials/search

    construct.net/en/tutorials/sending-data-from-construct-23-to-google-spreadsheet-1447

    construct.net/en/tutorials/create-online-database-google-1373

  • Yes - place them on the layout, as described.

    Ashley I thought the whole point of new "Load images" actions in C3 was to avoid that.

    Is it technically possible to add an option to store images in memory permanently?

  • JSON: As I understand, your mistake is that you are creating a family instance, and it creates a random family member. You need to create specific object instances.

    To do this you need to also save object names in the array, you can get them with Family.ObjectTypeName expression. Then, when you restore these objects, use "Create object (by name)" action.

    Memory issue: I actually made a very similar post yesterday. I guess adding objects to all layouts is the only way to keep them in memory..

  • Add an instance variable prevY

    On start of layout : Sprite set prevY to self.y
    
    Sprite compare Y<self.prevY : [sprite is going up]
    
    Sprite compare Y>self.prevY : [sprite is going down]
    
    On every tick : Sprite set prevY to self.y
    
  • Have you seen this SMB clone made in Construct?

    construct.net/en/forum/construct-2/works-in-progressfeedback-24/super-mario-bros1-1-remake-83433

    You can download capx file here:

    https://mfgg.net/index.php?act=resdb&param=02&c=4&id=30480
    
  • Yeah, I ended up adding all objects onto the main game layout, and it's turning into a huge mess.. Also this means that lots of unnecessary images are loaded every time (backgrounds which will not be used in this level etc.), and a lot of memory is wasted.

    .

    I think I understand what's happening - this image gets released from memory when switching to another layout, and then it's loaded again.

    Ashley Could you please confirm this is the case? Is there any way to preload images and keep them in memory even after switching to another layout?

    I think MM_Preloader plugin does that, but there is no C3runtime version of it..

  • Please see this demo project:

    dropbox.com/s/b6g18oaeljp2u0d/PreloadImage.c3p

    There are two layouts - L1 and L2. In both layouts a big sprite is created on start.

    Layout L1 has an instance of this sprite, so when I delete this instance and create a new one, it happens immediately.

    Layout L2 has no instances of this sprite. When I create it, there is a visible delay - you can see a splash of white background before the image appears. This is especially noticeable on mobile, I have an old phone and it shows the white background for about half a second!

    What I don't understand is why preloading the image doesn't make any difference?? It still takes the same long time for the image to appear on layout L2, even though it's already loaded to memory.

    Am I doing something wrong?

    Tagged:

  • Disabling physics for bottom boxes would probably not be a good idea, because other boxes will start falling through them. You can check if boxes are sleeping, and set them immovable.

    The problem with Box2D engine is that touching physics objects continue to wobble and shift a little and don't want to go to sleep. So you might need to check X/Y velocity and if these values are very small, set them as immovable.

    See this post:

    construct.net/en/forum/construct-2/how-do-i-18/detect-physics-object-finally-144877

  • It's not recommended to mix physics with other behaviors (Platform, Drag&Drop, Pin, Bullet etc.) in the same object. It's very difficult to make them work together correctly.

    You can use a different invisible sprite with Drag&Drop, and move the physics box to its position, see this example:

    dropbox.com/s/65wlg7mxfbg2y8s/PhysicsBasket4.capx

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads