Kyatric's Forum Posts

  • At global variable2 =1 => system set global variable to int(random(1,3)) should do the trick.

    random() returns a float. By setting a range and making it an int(eger) , you are sure random will return either 1, 2 or 3.

    Next time though, post directly the capx, it will be easier to answer you.

  • Nickydude: Fixed, thanks for the notice.

    Thanks everyone for the kinds words.

  • You do not have permission to view this post

  • You do not have permission to view this post

  • This is a gathering of the common questions asked and their answers in this section.

    Be sure also to check Construct 2's online manual and especialy the must read for beginners and pros alike : how events work

    You can also find a lot of information in the tutorials and the C2 academy videos playlist.

    Be sure to check those out, tutorials and videos of the C2 academy are not listed in this list, yet may contain fully blown explanation concerning elements you are looking for.

    You can also have a look at the list of third-part plugins/behaviors to find new tools to add to Construct2.

    Also don't forget to check out the examples provided directly with Construct 2 (Startup page - Browse examples)

    • Game type/mechanics specific questions/examples
      • Tile "digging" type game - LINK
      • Card game - LINK
      • Several RTS mechanics (camera movement, selecting units, etc...) - LINK
      • Example of Line of sight 1 (before official LOS behavior) - LINK
      • Example of Line of sight 2 (before official LOS behavior) - LINK
      • Do a contextual menu in events - LINK
      • Make a "tactile" keyboard - LINK
      • Making a "Pause" function - LINK
      • Make a checkpoint system - LINK
      • Countdown example - LINK
      • Example of level editor (basic, WIP) - LINK
      • Random Terrain generation via Midpoint Displacement - LINK
      • End-level animation - LINK
      • ThumbStick example (mouse and touch) - LINK
      • 3D carrousel example - LINK
      • Companion that follows the player - LINK
      • Make a twitter widget (before the official Twitter plugin) - LINK
      • Trail effect - LINK
      • Drag and drop via events - LINK
      • Simon type of game - LINK
      • Side-scrolling motorbike physics - LINK
      • Ragdoll example - LINK
      • Example of realistic rope - LINK
      • Timeline example - LINK
      • Check that an object is within an angle of another - LINK
      • Use more collision points or more objects ? - LINK
      • Procedurally create platforms - LINK
      • Example of teleportation portal - LINK
      • Tower defense-like turrets - LINK
      • Make a angry-bird clone - LINK
      • Make a quizz game - LINK
      • Game for multiple resolutions solid example - LINK
      • Flashlight type effect on an image - LINK
      • Resize handles on a sprite example - LINK
      • Implementations of a rubik's cube (with/without pseudo 3D) - LINK
      • Complex AI, dynamic aim range - LINK
      • Sprites overlapping completely each other - LINK
      • Turn-based mechanisms - LINK
      • Make a dropdown list - LINK
      • Magic/mana recharge (like in WOW) - LINK
      • Game dialog: Scenes and actions - LINK
      • Day to night cycle - LINK
      • Boids algorithm implementation in C2 - LINK
      • Ghost replays "à la" Super MeatBoy - LINK
      • Trajectory prediction - parabola - archery - aim à la Angry Birds - LINK
      • Another discussion about resolutions for mobile games/applications - LINK
      • Minimap example with relative positions - LINK
      • Obtain non-repeating numbers from a fixed set - LINK
      • Obtain random numbers without repeat - LINK
      • Another way to obtain random numbers without repeat (lottery like) - LINK
      • Ingame dialog popup example - LINK
      • Make a jelly floor like in "The floor is jelly" - LINK
      • Archery physics calculation (trajectory) - LINK
      • Take and download a Snapshot - LINK
      • Generating terrain based on random templates - LINK
      • Make a Twitter button without using the Twitter plugin - LINK
      • A logging system with backend to help out debugging - LINK
      • Share on Twitter and Facebook (using URLs) - LINK
      • Make 3D with Construct, multiple examples of different styles - LINK
      • Making a save file system with Local Storage, Dictionary, AJAX and JSON - LINK
      • A Zelda style dialogue system using XML - LINK
      • Make a beat 'em all/brawler/2.5d scrolling game - LINK
      • An example of memory match game - LINK
      • Know the maximum limit of a layout in pixels - LINK
      • Make a boid flocking type with the sine and bullet behaviour - LINK
      • Sidescroller/Platformer genre
        • Climbing a rope - LINK
        • Vertical Scrolling platform game, starting from bottom - LINK
        • Get killed if you fall from a high distance - LINK
        • Mario style: jump on top of enemy to kill it - LINK
        • Jumping through blocks and standing on top of them (mario like) - LINK
        • Climbing a ladder - LINK
        • Grabing the edges of a platform/wall - LINK
        • Another grabing edge example - LINK
        • Hookshot with the mouse - LINK
        • Get character to shoot right and left - LINK
        • Another example of climbing a ladder - LINK
        • Varied power of jump - LINK
        • Time maped directional spawning - LINK
        • Platformer: particles for snow, rain and fire effect - LINK
        • Jumping on vertical moving platforms - LINK
        • Another example of enemies patrol - LINK
        • Water/liquid modifying the movement - LINK
        • A "sandbox" example in Scirra's arcade with downloadable capx - LINK
        • Another patroling example - LINK
        • Drawing platforms ingame - LINK
        • More below in Behavior/Platformer behavior
        • Generating terrain based on random templates - LINK
      • RPG genre
        • Display health/healthmax in a text - LINK
        • Diablo-like movement (mouse+animations) - LINK
        • Visual Novel/Dialogues example - LINK
        • A dialog system with answers - LINK
        • Simple inventory mechanic for a click and play - LINK
        • Another drag-drop inventory example - LINK
        • Even more dialog systems - LINK
        • A miniRPG example using array - LINK
        • Ingame dialog popup example - LINK
      • Object moving
        • Mouse click movement - LINK
        • Patrolling and shooting enemy - LINK
        • Bouncing ball from a wall - LINK
        • Tile/Grid movement - LINK
        • Sprite push another sprite - LINK
        • Firing a laser - LINK
        • Make an object rotate around another via events - LINK
        • Another lazer example in 2 events - LINK
        • Smooth grid movement example - LINK
        • Homing missile - LINK
        • Handle predictive aim (shoot a bullet in front of a moving object) - LINK
        • Simple animation without using the animation feature of the Sprite object - LINK
        • Basic waypoint system - LINK
        • Following a path - LINK
      • Isometric
        • Isometric projections - LINK
        • Isometric projection - LINK
        • Isometric playfield - LINK
        • Isometric racing game - LINK
        • Isometric multiplayer engine (warning, not beginner friendly, read the whole thread) - LINK
      • Multiplayer/Networking
        • Set a websocket server compatible with C2 - LINK
        • Make a MMO with C2 - LINK
        • Add leaderboards with a custom plugin - LINK
        • Yet another multiplayer demo (with explainations) - LINK
        • [Behavior] MultiPlayer + online demo - LINK
      • Monetizing
        • Using paypal or other payment process - LINK
        • Ways to monetize HTML5 games in August 2012 - LINK
        • How to use the IAP official plugin - LINK
        • How to use the adMob official plugin - LINK
    • General/Misc questions
      • Native expressions in Construct 2 - LINK
      • Modify the loader screen of the exported application (before in editor options) - LINK
      • Change the color of the loading bar - LINK
      • More details on changing the color of the loading bar - LINK
      • Let others play your game - LINK
      • User text (before TextBox) - LINK
      • User text (since TextBox) - LINK
      • Draw a line from point A to point B - LINK
      • Reset Construct2 Preferences - LINK
      • Managing several behaviours/states for a character - LINK
      • Make HTTP preview mode working on win7 - LINK
      • Explanation about the logical "IF", "ELSE IF", "OR"... - LINK
      • Explanation of lerp - LINK
      • Even more clarification of LERP - LINK
      • Wrapping an exported project into .exe (Before Node Webkit export) - LINK
      • Xperia Play controls - LINK
      • Checking the distance between two instances - LINK
      • Weighted probabilities - LINK
      • How many A overlap B - LINK
      • Pass informations from the HTML page to the C2 application - LINK
      • Blur text effect with SVGCanvas plugin - LINK
      • If, else if - LINK
      • International keyboard support - LINK
      • Mathematics in game making - LINK
      • Understand the picking of newly created/spawn instances since R101 - LINK
      • Scope of events and object picking on creation - LINK
      • Best programming practices in C2 - LINK
      • The best way to do backgrounds in C2 - LINK
      • Tileable water with refraction - LINK
      • Convert rgb(r,g,b) to C2 internal color value (PHP oriented) - LINK
      • Opinions about making a website with Construct 2 - LINK
      • Calculate curve between two points - LINK
      • "Balloon tips appear to be disabled" message - LINK
      • How do I open a recent project in an older release - LINK
      • Round and limit the number of decimals of a number - LINK
      • Create a single line statement using maths operations (conditional expression) - LINK
      • Questions in relation with NW.JS - LINK
      • A deep explanation on how blend mode works - LINK
    • Legal questions
      • Intellectual property rights - LINK
    • Interface
      • Find the sprite strip dialog - LINK
      • Make configurable sliders - LINK
      • The X dialog has disappeared - LINK
    • Picking/selecting instance(s)
      • Picking as executed by C2 - LINK
      • Selecting/Picking the correct UID - LINK
      • Picking just spawned instances - LINK
      • RTS like - Selecting units - LINK
      • Picking separate instances from a same object - LINK
      • About picking - LINK
      • Understand how to use instance variables to pick specific objects - LINK
      • Even more about picking with UID and IID - LINK
      • Object(index) and "Pick Nth instance" usage - LINK
      • Understand the picking of newly created/spawn instances since R101 - LINK
      • Reference both overlapping sprites when they are the same sprite type - LINK
      • How do i check for overlap, regardless of collision enabled/disabled. - LINK
    • Layout / Layer
      • How do I import layouts from other c2 project? - LINK
      • Duplicate a layer (r63) - LINK
      • Reseting the game for a restart - LINK
      • Making a title/menu screen - LINK
      • Fading in/out between layouts - LINK
      • Navigation through layouts/levels (single event sheet) - LINK
      • Navigation through layout (with demo capx) - LINK
      • Know the maximum limit of a layout in pixels - LINK
    • Variables (Local/Global/Instances)
      • Using local variables - LINK
      • More about local variables - LINK
      • Using global variables - LINK
    • Scrolling / Camera
      • TiledBackground horizontal scrolling - LINK
      • TiledBackground vertical scrolling - LINK
      • Slow vertical scrolling - LINK
      • Sprite horizontal scrolling - LINK
      • Click and drag the camera - LINK
      • Metal Slug/Mario type of scrolling - LINK
      • Zoom in/out - LINK
      • Camera smooth zoom in/out - LINK
      • Delayed/controlable camera - LINK
      • Example of scroll, scale and parallax - LINK
      • Moving the camera with keyboard - LINK
      • More parallax example - LINK
      • Flip camera/world - LINK
      • Example of pan with mouse - LINK
      • Another example of vertical scrolling with tiled backgrounds - LINK
      • Another continuous scrolling made out of sprites - LINK
      • A scrolling where the character isn't in the center of screen - LINK
      • Smooth zooming - LINK
      • Zoom according to the distance between two objects - LINK
      • An example to simulate shaking of the camera - LINK
      • Making a split screen using third-part plugin "Canvas" - LINK
      • Another camera shake even with lower screen size - LINK
      • Another seamless horizontal scrolling with TiledBackgrounds and Function - LINK
      • Generating terrain based on random templates - LINK
      • Make a camera centred between several sprites - LINK
    • Tiling / Grid
      • Quick tiling - LINK
      • Isometric tiles spawning - LINK
      • Timed grid spawning - LINK
      • Another example of making a grid for those who did not know the previous examples already existed - LINK
    • Particles
      • Particles effect - LINK
      • Another particles effect (snow/flying leaves) - LINK
      • Platformer: particles for snow, rain and fire effect - LINK
      • Fog effect with particles - LINK
      • Have fading in particles instead of fading out - LINK
    • String manipulation
      • Text Parsing For Textadventure type of game - LINK
      • Display Number as Currency (With Commas) - LINK
    • Plugins specific questions
      • adMob
        • How to use the adMob official plugin - LINK
      • AJAX
        • Scores on a website - LINK
        • Scores on a website 2 - LINK
        • Highscore table - LINK
        • AJAX tutorial example - LINK
        • How do I pull variables out of a PHP page using AJAX ? - LINK
        • Ize's AJAX/PHP practical "Online Highscore" example - LINK
        • More about using PHP - LINK
        • Use GameJolt's API in C2 - LINK
        • Various questions and answers on using AJAX with server-side scripting to make an online game - LINK
        • Making a save file system with Local Storage, Dictionary, AJAX and JSON - LINK
      • Arrays
        • Shift values in an array - LINK
        • Randomizing an array (for a deck of cards) - LINK
        • Getting values from an array - LINK
        • String to array example - LINK
        • Filling an array with a string and tokens - LINK
        • Get the index of nested loops - LINK
        • Concrete commented example of use of arrays - LINK
        • A miniRPG example using array - LINK
        • Sorting an array - LINK
        • Simple explanations on what is, how and why use arrays - LINK
        • Saving and loading an array to/from webstorage - LINK
        • Another thread about using arrays - LINK
        • Saving/loading datas of/to an array to JSON using webstorage - LINK
        • Flood fill in an array - LINK
        • Random terrain generation - LINK
        • Endless Procedurally Generated Terrain - LINK
        • A discussion and capx about a level editor - LINK
        • Boids algorithm implementation in C2 - LINK
        • Video explaining how to fill an array - LINK
        • Randomize an array without duplicates/repeat numbers - LINK
        • Fill a list from an array - LINK
        • Save and load object's positions from an array - LINK
      • Audio
        • Example of playing sound in different browsers - LINK
        • Audio for beginners - LINK
        • An audio fix for iOS - LINK
        • Play a random sound - LINK
        • This is how audio works - LINK
        • Volume control on a sound played - LINK
        • Have a background music playing continuously and looping through several layouts - LINK
        • Have the Slider Bar plugin acting on a sound's volume - LINK
        • Play a section of a single audio file containing several sounds - LINK
      • Browser
        • Execute javascript with a browser object - LINK
        • Take and download a Snapshot - LINK
        • Make a Twitter button without using the Twitter plugin - LINK
        • Parsing JSON (that contains a boolean value) - LINK
        • Share on Twitter and Facebook (using URLs) - LINK
        • Import a JavaScript library via the Browser object - LINK
      • Button
        • How to change the style of the button plugin ? - LINK
      • CocoonJS
        • How to remove the flickering on the splash screen ? - LINK
      • Dictionary
        • Making a save file system with Local Storage, Dictionary, AJAX and JSON - LINK
      • Facebook
        • Facebook highscore list - LINK
        • Another topic about Facebook high scores - LINK
        • Get the Facebook Profile photo - LINK
        • Create a FaceBook leaderboard - LINK
        • Share on Twitter and Facebook (using URLs) - LINK
        • More explanation on sharing with Facebook - LINK
      • Gamepad
        • Get the angle of the right stick (can work for left) - LINK
        • Set player speed relative to gamepad pressure - LINK
      • IAP
        • How to use the IAP official plugin - LINK
      • List
        • Fill a list from an array - LINK
        • Change list items by selection in another list - LINK
      • Local Storage
        • How do I do High Scores with Local Storage - LINK
        • Another example how to do high scores with Local Storage - LINK
        • Making a save file system with Local Storage, Dictionary, AJAX and JSON - LINK
        • Making a simple shop system with local storage - LINK
      • Mouse
        • Hide the mouse cursor - LINK
        • Getting the correct mouse position in a zoomed layer - LINK
        • ThumbStick example (mouse and touch) - LINK
      • Scirra Arcade
      • Slider Bar
        • Have the Slider Bar plugin acting on a sound's volume - LINK
      • Sprite
        • Gradually change size and fade a sprite - LINK
        • Making a button using a sprite (and handle clicking on it) - LINK
        • Placing a sprite in the center of the window - LINK
        • Designing sprites movements - LINK
        • Flashlight type effect on an image - LINK
        • Resize handles on a sprite example - LINK
        • Sprites overlapping completely each other - LINK
        • Reference both overlapping sprites when they are the same sprite type - LINK
        • Animations
        • Import frames from a tiles sheet/sprites sheet - LINK
        • Set the animation according to a key pressed - LINK
        • Make an animation loop - LINK
        • Where is the "loop" option - LINK
        • Mirroring since r69 - LINK
  • SpriteFont
    • Generate SpriteFonts for the official plugin - LINK
    • Ingame dialog popup example - LINK
  • Touch
    • LINK
    • Make touch controls motion controls - LINK
    • Get motion control values from iPad - LINK
    • Move object based on device motion - LINK
    • ThumbStick example (mouse and touch) - LINK
    • Using orientation detection on a device - LINK
    • Double tap with touch (before r175) - LINK
    • A dash/slash effect like in "Fruit ninja" - LINK
    • Another thumbstick/analog pad example - LINK
    • Recognizing a curve gesture - LINK
  • Text
    • "Typewriter" text effect - LINK
    • SpriteFont (with events) - LINK
    • Text formatting, adding 0's - LINK
    • Using multiple webfonts with multiple text objects - LINK
    • Textbox scroll effect - LINK
  • Twitter
    • Share on Twitter and Facebook (using URLs) - LINK
  • Webstorage
    • Save variables/example of use - LINK
    • Other example of use of webstorage - LINK
    • Saving and loading an array to/from webstorage - LINK
    • Yet another concrete example of use - LINK
    • Local high scores - LINK
  • XML
    • A Zelda style dialogue system using XML - LINK
  • Behaviors specific questions

    Bullet behavior

    • Make a boid flocking type with the sine and bullet behaviour - LINK
    • Drag & Drop behavior
      • Drag and drop avoiding overlapping - LINK
      • Drag and drop limiting the area of movement - LINK
    • Physics behavior
      • Create a rubber band (elastic slingshot) - LINK
      • Get the speed and direction of an object with physic - LINK
      • Player (platform behavior) and Physic (world objects) - LINK
      • Managing movement with animation - LINK
      • Drag and throw - LINK
      • Side-scrolling motorbike physics - LINK
      • Rotate a layer and still interact with its physical objects as they appear on screen - LINK
      • Simulating gravity affected orbits between celestial objects - LINK
    • Platformer behavior
      • Get player velocity - LINK
      • Character not running smoothly - LINK
      • Jumping into and destroying blocks - LINK
      • Spawn and jump over enemies (mario-like) - LINK
      • An example of double jump - LINK
      • Managing speed and animation - LINK
      • Enemy control with platformer behavior - LINK
      • Player (platform behavior) and Physic (world objects) - LINK
      • Player (platformer behavior) push/pull a solid box - LINK
      • Another example of enemies patrol - LINK
      • Another patroling example - LINK
    • Sine behavior
      • Make a boid flocking type with the sine and bullet behaviour - LINK
    • Solid behavior
      • Conditionnal solid - LINK

    Exports

    • Remove borders from the exported EXE (Node webkit) - LINK
    • HTML5 to BAR (blackberry) - LINK

    This is only a small selection of questions. There are far more topics treated already.

    Be sure to SEARCH the forum.

    Be sure to search your keyword on the C2 general section as well as this "How do I" section !

    The answer you are looking for is probably already out there.

    /!\ Contribute to this topic /![/h2] This list is in no way exhaustive and will keep evolving with C2. Nevertheless, it is quite a hard job to compile such a list and especially the phrasing of the questions. I noticed it is often a matter of wording, with people using different terms to speak about the same thing (especially true with GM users arriving with their specific GM "vocabulary" where C2's window is named viewport, and such...) In the end, the idea is to try to abstract as much as possible to cover the most ground possible. So, if you noticed a question that has its answer in the forum (in the whole Construct2 forum, "How do I" as well as "General C2 discussions") and you feel like it should be part of the list please post using the following format:

    [quote:2dsdlqc5]

    Category: A general category where sorting the question.

    Sub Category (optionnal): For example if the question is plugin related, this is the name of the plugin.

    Question: Keeping in mind this is the "How do I..." section, the question should be clear and the most direct possible.

    Link to the answer: You can either post the url of the topic (general URL in the adress bar of your browser) or the specific post URL (to quote a specific post find its link on top left of the post, right click on the image (

    ) next to the date of the post and select "Copy link").

    When the question is covered in several posts in a related topic, post the url of the topic. When the question is covered in a specific post, and/or is not posted in a directly related topic, post the url of the post.

    If you encounter an error or a dead link, please post it in this topic. It will be corrected as soon as possible.

    This topic is not the place to ask questions. To ask questions, make sure they are not already answered by a search and then, after reading the tips for posting in the "How do I" forum post a new topic.

    Any question in this topic will purely be deleted. This is the only warning.

    Also, if you see a question here, please ignore it as it will eventualy get deleted.

    Help us keeping this list as up to date, complete and clean as possible.

  • qwiktags: post your capx please.

    We can't guess out of the blue what the quirks or glitches are.

    Also think to provide the required infos as asked in how to report a bug.

  • The webstorage plugin is even a part of C2's install for several versions now, you don't need to download it from the forum thread.

    The post is useful as documentation though.

    Also, even on Iphone it will still work in the browser, so the datas should still get saved into the browser and the plugin should work.

    I can't say for sure that it works, since I don't have an iphone or smartphone to test it on. If you do, your best shot is to give it a try.

    Another way would be to send the datas via AJAX to a website that would save them in its database. AJAX tutorial - related topic

  • In your profile tony : http://www.scirra.com/users/tonycrew

  • Fimbul: what do you mean compiling a book ?

    Also you should check here, the last posts are about a bug in the spaceship behavior.

  • Then be sure to toss a line in your file about it. The provided examples with C2 are great and every user should have at least scanned through them once. It's a mine of informations and 'How To'.

    If you want yu can compile some of my tutorials in in your guide if you feel like it have its place in.

    http://www.scirra.com/tutorials/55/new-to-construct-where-to-start

    http://www.scirra.com/tutorials/60/construct2-how-to-customize-the-exported-html5-indexhtml

  • Well mediafire will make you download a file.

    Hosting a C2 game requires to give access to the media files and several .JS files.

    Putting all your project on dropbox and giving the public link to the html file allows you to play directly the game. Mediafire propose no such service.

    Moreover, for a little file, like a capx, you have to go to a mediafire page and click a download link.

    With dropbox, you simply give a link and it directly downloads the file with no further clicks or page loading.

    So for hosting games DropBox > Mediafire.

    For hosting capx DropBox > Mediafire.

  • There is some post of Ashley somewhere that explained it indeed, but I can't recall where or the exact explanation.

    Tbh, I just go with it, pressing "Make 1:1" whenever I import sprites and don't think otherwise about it <img src="smileys/smiley4.gif" border="0" align="middle" />

  • You can check parallax in the examples provided in the C2 folder\examples.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • In group Conditions

    Event 16 turn "ScoreChecker = 500" to "ScoreChecker = 50"

    => Takes less ships before being able to test the boss.

    When boss appears=>

    FireBug error

    Spaceship_behavior.js

    l.322 this.dx is not extensible

    Quick solution:

    Group "Bosses"

    Event 147 -> Toggle Stop SpaceShip

    Long solution:

    Report the error on the spaceship movement topic and see if Fimbul can work it out.

    This is for your capx.

    My guess is that the errors you get online are related. (Error: this.s is not extensible)

    For the others, it looks like chrome errors.

    Error: this.showContextMenu is not a function

    Source File: chrome://y2layers/content/overlay.js

    Line: 34

    ??? This is not part of firefox.

    And for the last error I can't check for sure, because I will not download 16 Mo of datas with my slow connexion for now.

    Now for the gameplay itself, I think your scores are a bit too high, as the boss was really the first challenge I encountered.

    The rest of the time it is just pressing right arrow and mashing my LMB (which cause my forearm to be hurtfull atm tbh :) ).

    Make smaller waves, or smarter ennemies.

    Also, as mentionned, the size of the game is a bit heavy imo.

  • Click on "Make 1:1" in the property tab, it should switch to its normal form.