619_RM's Recent Forum Activity

  • brunopalermo is right, if you simply need to set different values for two variables, event groups is a huge overkill.

    If you don't like his solution, just create one variable Difficulty and a function SetDifficulty:

    > Function SetDifficulty
    	if Difficulty=1 : set life=50, lifeMax=50
    	else if Difficulty=2 : set life=100, lifeMax=100
    	else if Difficulty=3 : set life=200, lifeMax=200
    

    When player chooses game difficulty, set the variable, write it to local storage and call this function.

    On start of layout read this variable from local storage and call the function:

    > On start of layout
    	Local storage get "difficulty"
    	System wait for previous action
    	set Difficulty=max(1, LocalStorage.ItemValue)
    	Call SetDifficulty()
    

    Thanks, dop2000

    I finally make it work with continue button by putting "On Load Complete" then compare difficulty level global variable and it worked.

    What I am doing is quite lengthy, I will defiantly adopt what you and brunopalermo suggesting me to do in future. As always Thank you very much.

  • dop2000

    Could you PLEASE PLEASE help me to crack this.

    construct.net/en/forum/construct-3/general-discussion-7/help-global-variable-group-146355

    I got a solution from brunopalermo but he kind of provided some different and advanced way to doing this and I really appreciated his input but what I want here is simple global variable to store. Everything else is working fine with but the only issue continues button it loads everything expects the difficulty mode.

    Please help me pal.

  • In that case I would use a 3D array where X is the difficulty level, Y is the Enemy ID and Z is the Attribute.

    Example (in JSON format):

    > {"c2array":true,"size":[3,2,3],"data":[
    > [
    > [50,150,10], [75,100,25]
    ],
    [
    > [100,250,25],[150,150,50]
    ],
    [
    > [200,350,50],[300,200,100]
    ]
    ]}
    

    Each line is a difficulty level (Easy(line 3), Normal(line 6) and Hard(line 9)).

    Each block in a line ([50,150,10] for instance) is an enemy. In this list there are 2 enemies.

    And each item in the block is an attributes (Let's say Life, Speed and Damage for this example)

    First enemy is weaker and causes less damage, but is faster than the second. In Easy difficulty, for instance Enemy 1 has 50 life, 150 speed and 10 damage, while Enemy 2 has 75 life, 100 speed and 25 damage.

    This way, when you create an enemy just access the values in the array for the corresponding difficulty and enemy using array.At(difficulty, enemyId, attributeId).

    Let's say the difficulty is HARD and you are spawning a Enemy of the second type. Its life would be enemiesArray.At(2, 1, 0), its speed would be enemiesArray.At(2, 1, 1) and its damage would be enemiesArray.At(2, 1, 2).

    Check this example. It will ask for the difficulty the first time and afterwards it would just use the one saved. It will also list the picked difficulty and the attributes for each enemy at each difficulty.

    Thank you very much for this detailed post and for the capx, really appreciated. Let's see how far I pull from this logic as this logic is kind of pro for me.

  • Please help me.

  • Just a suggestion...

    If the only change between modes is the enemies' life and maxlife, I would drop the groups entirely.

    Just creat e lifeMultiplier variable and a difficultyLevel variable.

    When player chooses difficulty set the difficultyLevel to the corresponding valeue (0: easy, 1:normal, 2:hard). And when you create enemies just check the difficultyLevel and set their life and maxLife to the corresponding value.

    Ex.

    > Enemy "On Create"{
    Enemy Set maxLife = (difficultyLevel = 0) ? 50 : (difficultyLevel = 1) ? 100 : 200;
    Enemy Set life = maxLife;
    }
    

    You'd have far less code in your project!

    Remember to save the chosen difficultyLevel to the local storage if you don't want players ahving to choose it every time they start the game.

    Hope this helps...

    Cheers!

    Thanks for your input, actually it was a demo I need something more than just enemy life. If the user restarts the game there where the problems lie. And thanks for your suggestion I'll definitely try to implement it in other way.

  • WackyToaster One issue, Please help.

    In my platformer, I have a total of 8 worlds, When User open the game for the first time and click new game, there would be three option to select Easy, Medium and Hard.

    If a user played "Normal Mode" and go to WORLD 1, mid of the WORLD there is a checkpoint (using Save & Load) when the user collided with the checkpoint and then if he died, the game would continue from that checkpoint. When the user clicks the continue after died, the game would be started from that location and along with "Normal Mode". (Which is perfectly fine)

    But the issue is when the user closes the game (in the phone) and started to play again and click the continue button, the game start from the previous checkpoint but now there is no "Normal Mode".

    So basically system unable to save the Global Variable of the Normal Mode.

    I also tired with Local Storage completely without using the global variable, (please ref: previously attached image) but unable to make it work.

  • The groups are disabled, that means they are entirely ignored. Right click on the groups, select edit and remove the check from "active on start" instead.

    Man, thank you very much.

  • I also tried it with Local Storage, but still no luck.

  • I want to have difficulty modes like Easy, Medium and Hard. Basically what I do is make the enemy tough.

    So, for that, I have different groups, Easy, Medium and Hard Group, For each, I have programmed the tough levels.

    So what I have done?

    I have created a Global Variable and made it to 0. When the user clicks the Easy Mode (From Main Menu Layout), then the Global Variable would be 1. On Start of the game layout, If the Global variable is 1, then the "EasyModeGroup" would be activated.

    But sadly it won't work, I must have doing it wrongly, Please guide me through.

  • Use anchor only for the white sprite, remove anchor from the red sprite. Pin red sprite to the white sprite on start of the layout. And of course set the origin image point on the red sprite at the right edge.

    Thanks for your prompt response. You are awesome.

  • Health Bar Issue with Anchor.

    I have made a simple health bar for my player (a platformer game) by referring to this video https://youtu.be/7QmQXPYvpMo

    I have come across to a scenario where I need a health bar to start cutting the players health from "LeftSide". For this, I put the origin point to the other end and it worked but the issue occurs when I use the Anchor Behaviours. When I apply the Anchor, it again cuts from "RightSide" How? I didn't alter the origin point Why it cutting from the wrong side?. (No matter where I place the origin, it cuts only From Right to Left.) Please help me.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thank you so much :)

619_RM's avatar

619_RM

Member since 1 Jun, 2019

Twitter
619_RM has 1 followers

Trophy Case

  • 5-Year Club
  • Forum Contributor Made 100 posts in the forums
  • RTFM Read the fabulous manual
  • Great Comment One of your comments gets 3 upvotes
  • Email Verified

Progress

9/44
How to earn trophies