inquiesco's Recent Forum Activity

  • fscopel To be honest, since you're using exact measurements for checking distance rather than rounding them up, the chances of you getting equal distance between two cannons is very, very low. I tried in your example to get somewhere in the middle of 290.181271743284 (or something equally hard, ha ha) and I couldn't even equalise the .18 part because of mouse sensitivity. If you were rounding up the numbers to whole numbers then yeah, it'd be more of a problem and require solving.

    As for bullets per cannon, you can give each cannon an instance variable of bullet_count, then give them 500 or however many you're wanting. The logic of the engine when objects are in a family is that they interpret the objects in them individually, so only objects meeting the required conditions you've put to the family are triggered. Based on that you should be able to then just set fam_cannons -> Subtract 1 from bullet_count. It's a bit different moving from programming languages where we need to explicitly check each object to see if it meets conditions, which is a good thing, I think, . Though I still get caught out sometimes wanting to write JavaScript to pick out specific objects and have to hunt down the equivalent method of thought, lol.

    As for your game mechanics, looks fun, I like those games as I'm heavily nostalgic, . Hence why I'm making a space shooter, and possibly an RPG after, ha ha. Keep up the good work!

  • TrapInc Fixed it for you, you needed a check for when the player is not moving and is not holding the down arrow. Because you stop moving when attacking the idle movement took precedence. No else statements are required.

  • fscopel I'll have to check this out as a possibility, I ended up binding my ship movement to left mouse button hold to achieve the smooth movement, so that's an option too unless you'd prefer keys, .

  • One method you could try is giving the family the LineOfSight object behaviour, and then set the range to 500 or so. LineOfSight automatically checks range and will apply it to each cannon, so if your cannons were 100 pixels apart, each cannon farther away wouldn't see a target because they're 500 plus the 100 pixels to the next cannon away. You can then replace all those cannon distance checks with a check for Cannons -> Has LOS to object and set the object to be checked to be a family of enemies. You can then spawn Bullet1 off Cannons and it should automatically spawn it at the cannons which actually have range on the target.

  • Remove the Set angle to 0 degrees, and instead of having System create the object of the bullet, set it so that the Player object spawns the bullet. It should then travel from the player and their facing direction.

  • I'm guessing you want the camera to follow a character as it slides down? If it's a platforming game, get the Y value of your normal floor level and store that in a variable. Give your player character the ScrollTo behaviour and set it to Disabled in the player properties window. Then when you enter a sloping floor, you obviously go up or down gradually, so as soon as the player hits that block (on collision check maybe) set player -> Set enabled (in the ScrollTo section) and select the enabled state. Then you just need to add an else statement to it turning it off.

    Hope this helps, .

  • Have a text object called dc_xxxxx_input or something you think makes sense for easy code readability. Also make a form button that matches whatever naming scheme you're using but _button at the end. Then use the following Event code:

    dc_input_xxxxx_btn -> On clicked

    Then add a sub-event of:

    dc_xxxxx_input -> Compare text

    Set the compare value to be "325".

    Then, add the success events you want to happen. Also add an Else for if it fails and you have fail events. If you wanted to keep track of the correct codes, such as if the player can discover the code, it should be in a text instance variable for the dc_input_xxxxx_btn, and instead of doing the dc_xxxxx_input -> Compare text, you want to instead do:

    dc_input_xxxxx_btn -> Compare instance variable

    Then check if dc_input_xxxxx_btn is equal to dc_xxxxx_input.Text, then have success and fail events.

  • I'll explain what he was meant by using arrays, .

    Arrays store data in an orderly fashion, and you can call and insert data wherever you want. Arrays always start from 0, so the first spot for data is 0. To apply this to how you want to save data, you need to make an Array object. This is handy because you can store your level data in the order of levels, making it easy to select data and add it to an overall scoring list, for example. We'll call it array_name for ease of example, . On the Array properties window you'll see a Width, Height and Depth. Width is the total amount of levels you want minus 1 (since it starts at 0, so 13 levels is 12 in the array), and it also represents X, whereas the Height and Depth represent Y and Z respectively. Once made, in an overall Event sheet (one you include on each local Event sheet for each layout) you need to click the following then read on:

    System -> Set at X - NOTE: this is found under the Array section

    Arrays can hold up to three parts of data in one section, for example 'array = [0,01,02], [1,11,12]'. Each has a X, Y, Z number, but you can use only the X, or the X and Y... totally up to what you need to store, but for what you want you just need X, so you use the above Event code for Set at X. For the X value, put the level number. For the value, put the score variable from that local Event sheet. Let's say the score variable is user_score and represents 16. You should now have the following Event code once you hit the Done button:

    array_name -> Set value at 0 to user_score

    The above score of user_score (16) is now set to be array_name[0] in terms of positioning. If you want to grab it from the array to have on the screen to check the score, all you have to do is have an element of your choice set the value to array_name.At(0) (0 is the X, if you had three, you'd need 0, 0, 0 or whatever positions you're wanting to grab) and it will retrieve it. That will retrieve the score which is 16 in this example.

    Hope this helps!

  • If you wanted to save having to transfer through what is essentially a blank layer, spawn the spikes on the menu screen but hide them. When the layout loads, set them to Visible and the positions should be loaded, and you save the user a meaningless click, .

  • Let me know how it goes, I didn't try test this out myself but the code makes sense, . You can, of course, change the figures to your liking.

  • What do you mean by "keep the default value as blank"?

    Edit: okay so what you said worked, but one of my files will not show text objects when i run the game. It's visible in the editor, but not in the game. And its on the top layer, and set to visible, i don't know what's going on. is there a know glitch that causes text objects to disappear?

    Not that I know of. Can you export your project .capx file so I can take a look at debugging it?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I'm experiencing no issues either, not sure what's causing your problem, unfortunately. Could be it another counter in your code somewhere, perhaps?

inquiesco's avatar

inquiesco

Member since 26 Jan, 2013

None one is following inquiesco yet!

Trophy Case

  • 11-Year Club
  • Email Verified

Progress

12/44
How to earn trophies