Tokinsom's Recent Forum Activity

  • Aha! I tried that before but the "For Each: Sprite" condition came last which caused all sprites to be destroyed. Guess I'll always put that first from now on.

  • Item Persistence .capx

    This is an example .capx I was working on to show how item persistence works using dictionary and webstorage.

    You click on a square to destroy it. Then you press 1 to save, refresh the page, then press 2 to load (squares you clicked previously should be destroyed again.)

    However, I can't get it to work. When loading, either all of the squares are destroyed, or none of them are destroyed.

    What am I doing wrong here? I have 3 different methods of loading the save data and destroying the previously clicked squares, but none of them work!

  • Object.X/Y refers to the object's hotspot, or origin.

    Object.ImagePointX/Y refers to the object's image point.

    Both are set in the image editor, and you can make as many image points as you need.

    X/Y refers to the position relative to the layout; 0,0 is the top left of the layout.

    Absolute X/Y refers to the position relative to the canvas; 0,0 is the top left of the canvas.

    Viewport refers to whatever is on the canvas based on Scroll X/Y, for example Viewport.left (or however it's written) refers to the left side of the canvas regardless of the current scroll position.

    Canvas refers to the "game window" or resolution. The size can be adjusted in the project properties via the window size parameters.

  • I had to do something similar for Minitroid using instance variables and hash tables. Say you have 10 gems that, once picked up, never return. You want to give them an instance variable called ID and set them to 1,2,3,4, and so on for each gem. Then you make a hashtable with 10 keys - also 1,2,3,4, and so on.

    When a gem is picked up, check if the key with the same ID has a value of 0 - if so, destroy the gem and set the key value to 1.

    Now, when the level is loaded, loop through the keys and see if any of the values are 1. If so, destroy the gem with that ID.

    Alternatively you can just check if the key exists.

    Make sense? Probably not. I suck at explaining these things. I can whip up an example .capx if needed :)

    EDIT: Sorry, I keep forgetting hashtables are called dictionaries in C2. I will never get used to that -.-

  • You can try comparing values (system expressions) to make sure your player is completely stopped when next to a wall, like so..

    +Player.Platform.Xvelocity > 0

    +Has wall to right

    -Set X velocity to 0

    +Player.Platform.Xvelocity < 0

    +Has wall to left

    -Set X velocity to 0

    Or you can use collision offset instead of "has wall to." Might work, atleast ^^; I forgot how I did it for my games.

  • Whoops, my bad. 'Set canvas size' does work the same as 'set display resolution.' However, I just discovered a bug:

    When using 'set canvas size,' with unbounded scrolling enabled, objects on a 0,0 parallax layer don't account for the new resolution - they stay where they are.

    Should I post a .capx in the bugs forum?

    The first time I tried 'set canvas size,' I was using letterbox integer scaling. That on top of the aforementioned bug made me think 'set canvas size' worked differently than I had expected. Gah, confusing. I will try to do more testing before posting next time :)

  • Well, in terms of VRAM, using a 1x1 tiled BG in favor of a 1024x60 sprite would be wise.

  • Sorry for any confusion. What I'm looking for is the equivalent to CC's "set display resolution" which alters the "window size" parameter in the project properties. My game's resolution is 256x224 but the level editor is much larger; I can't switch to it during runtime without this feature, nor preview it in C2 without adjusting the window size parameters by hand every time.

    I thought "set canvas size" would do the trick but it doesn't work the same as "set display resolution."

  • Bump :\</p>

  • Is it possible to change the window size at runtime? If not, can this feature please be added?

    My level editor and game are in the same project, and I have to keep changing the window size when going from one to the other because the editor is much larger. On top of that, I have to re-export the project with the level editor as the first layout + the larger window size for team members to be able to use it.

    You can change the canvas size but it doesn't seem to be the same.

  • You do not have permission to view this post

  • Bump for justice.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
Tokinsom's avatar

Tokinsom

Member since 6 Jun, 2010

Twitter
Tokinsom has 11 followers

Connect with Tokinsom

Trophy Case

  • 14-Year Club
  • Entrepreneur Sold something in the asset store
  • Forum Contributor Made 100 posts in the forums
  • Forum Patron Made 500 posts in the forums
  • Forum Hero Made 1,000 posts in the forums
  • RTFM Read the fabulous manual
  • Email Verified

Progress

20/44
How to earn trophies