Chris PlaysOldGames's Recent Forum Activity

  • I would use a variable that I incremented when the charging was triggered via whatever method/keypress and a condition that allowed the powered jump whenever the value was greater or equal to charged. Unless you want the charging to scale up and it's strength determined by its value.. in this case, I would increment the charge variable until the jump trigger (or button release) and set jump strength based on its current value on release. After either charge is reset to 0.

  • Excellent work, clouds seem to be spawning nicely too.

  • The easiest way would be to make a sprite object and clone it as many times as you need cloud spawners. Now place one of these "cloud spawner" cubes at each cloud spawn location. Then either use Every X seconds or Every X seconds with Random(0-#) as seconds to spawn clouds.

    On your cloud object itself use the bullet behavior to make it move right and a fade behavior and set the fade to begin when spawned via action and set the fade timer to be whatever lifespan you want for the clouds with a destroy action after the fade action.

    If your game doesn't scroll to right you could also put a rectangle sprite just off screen that is the height of the screen and use an On-overlapping this "cloud killer" condition on cloud to destroy clouds after they leave screen.

    Also if your game does scroll right you could put the scroll-to behavior on all your "cloud spawners" and adjust the offset so that they stay off screen behind the player/camera but follow along behind spawning their clouds.

  • I was able to create what I think you are wanting using Action: Size Set to(Sprite2.Width-5, Sprite2.Height-5) repeated 10 times on a 100 sized sprite to make it 50% smaller and then using Action: Size Set to (Sprite2.Width+5, Sprite2.Height-5) 10 times to grow it back to 100%. I put a wait 0.5 after the action and copied it 10 times. I tried using the repeat condition but it didn't allow the wait 0.5 to trigger and made the sprite shrink and grow instantly which is not what you want.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hmm I seemed to have forgotten Newton's theory.

    changing Gravity.. that was what I was trying to think of

  • Post the .capx somewhere or an image of your events and then paste the link here but put spaces in it... h t t p : \ etc till it works.

  • I know you are familiar with some of this but it helps to explain it completely to keep it organized and maybe help others less familiar:

    In Construct2 you have 2 basic types of variables, Global and Instance. A global variable is created inside an event sheet by right-clicking and selecting it, or by using toolbar. A value stored in a Global variable is available everywhere in your project. For example you could make a variable called Score=0, increment it each time the player gains a point using action "add to" inside a conditioned event and then grab or modify this value from ANY event sheet or layout.

    However, the second type Instance variable is "local" in scope. It is created inside of an object using its properties panel. Since instance variables are limited in scope you can't expect to access or modify their values simply by calling up a variable available everywhere. You also need to make sure any event sheets containing objects with instance variables are included (right click inside event sheet and choose "include") so they can be accessed outside their event sheet, You would also need to address it specifically inside its containing object:

    ie. Two variables called hitpoints, both store players hitpoints but one is global and one is instanced inside the player object. To subtract hitpoints you would:

    Global: any action simply used subtract from hitpoints

    Instance: any action would have to use player.hitpoints then subtract from

    As you can see, this isn't a lot of work to do.. so many times I will use instance variables because I can keep them all neatly stored inside their own container object and then modify and call them on the fly from anywhere with just slightly more work. I even like using a "brain" object (simply a sprite kept off screen) that is just an instance variable container for game variables (score, level, etc). I am sure others may point out some limitations to instance variables over global but for most simple-medium sized projects I have found none besides the extra work to call them. That said... I am not trying to sell you on instance variables either. Pretty much all Construct2 projects can be made using nothing but global variables without seeing any appreciable slowing.

    All that said: Most of the confusion you are probably having is with "instance variable" and "instance of an object". Such as when you create an enemy object (sprite) and then give it some instance variables like health, speed, etc. AND then clone it into more "instances" of the original. The instance variable will carry across ALL instances of the object. However, you can still modify them individually using " instance picking", this is how you can have enemies with the same instance variable of health but that will take damage at different rates... they are picked by an event condition such as "on collision" with or "is overlapping" another object. In this case a bullet "object" picks the enemy instance when it hits it. "Instance Picking" is covered in the manual and many tutorials/threads and is a core concept of Construct2, learn it and you will have won most of the battle.

  • Have you tried playing around with it's density (mass) value? Making it denser should allow you to apply more force thus making it fly faster yet still fall with same trajectory due to weight. I haven't tried it... just thinking of real world values.

  • Thanks, CJDSTU was a fun learning game to make.. I should polish it but I may just rewrite it using better "code" structure.

    Maschka, both our examples primarily rely on one basic concept, the use of variables. They are the building blocks to everything you will do in any programming language or game editor. Variables are easy to learn, and a lot of fun to use. They are just places you store values (be they numbers, strings, true/false, etc).

    I can't strongly recommend it enough to do the starter tutorials like ghost shooter, asteroid, and flappy bird clone. You will learn basically everything you need to get a solid grasp from just those three.

  • Ok I am making an assumption that you mean EVERY TIME the player reaches 20 points this happens... ie 20 (bang), 40 (bang), etc

    Use variables.

    Make a global variable for the player's level (which by your description I believe you track already).

    Make an instance variable inside player called triggered20 (or whatever) and set it to 0 on player creation (or true/false, your choice).

    Make a TempScore global var (or instance var)

    Have an event in player code that adds +1 to a TempScore var each time the PlayerScore (one used for display) is incremented. When TempScore =20 sets triggered20 to 1 and set TempScore=0 followed by a wait 6 seconds then set triggered20=0.

    Copy your spawn event and make a second one, In the original one for "normal" put condition triggered=0 in its conditions. In the second put triggered=1 in conditions. (Yes you could do this with nesting and sub-events.. but keeping this as simple as possible).

    Now the normal spawner will fire off enemies every 5 seconds at 500 until the player reaches 20 score (each 20) and then the triggered spawner will fire off enemies every 3 seconds at 600. This will happen until the 6 second wait is over and triggered20=0 again then normal spawner will begin again until 20 more score is gained in tempvar then it will repeat. An added bonus, at anytime you could set triggered20 to anything besides 0 & 1 and both spawners will stop spawning.

  • Global variable; set it +1 for each instance found. Condition StarVar=3 into your win condition, reset StarVar=0 each level. Use another like TotalStarsVar to keep track of total stars recovered in the game and use a text box object with text "You Collected: "&TotalStarsVar"Stars!"

  • Only way to go imho:

    http://pivotanimator.net/

Chris PlaysOldGames's avatar

Chris PlaysOldGames

Member since 22 Aug, 2014

Twitter
Chris PlaysOldGames has 1 followers

Trophy Case

  • 10-Year Club
  • x2
    Coach One of your tutorials has over 1,000 readers
  • Email Verified

Progress

12/44
How to earn trophies