Chris PlaysOldGames's Forum Posts

  • All you need to do to log the position is to know the Y values from start to finish in the meter area and translate those values to your reading value. Then you just grab the current Y value (assuming X is constant) with Pointer.Y stored in instance variable that you compare with your actual values.. ie Y for meter = 100-300 you could output using Pointer.Y = <50 text = POWER: 100% or whatever...

    If your meter was exactly 100 pixels tall (or wide.. using X instead) it would be easy to translate to a 1-100% value to post to player (or show on meter) using (gulp) math... say you use Y pixel value 200-300 you could simply assign the Pointer.Y to a variable and subtract 200 for a 1-100% value... etc otherwise you would need to use complex math or a long series of value = result = value conditions.

    You could use a SINE behavior to make the pointer actually move up and down and use stop SINE behavior to make it stop at any point you choose.

  • As your code currently reads.. you may destroy the spite15 every time the layout starts and when his health is 0 or less but as long as the score value is over 20 he will respawn.

    Assuming you initialized BossIsDead to 0 when you made it.. otherwise add an action to On start of layout that sets value of BossIsDead to 0;

    You need to either add the condition BossIsDead=0 to the Create object Sprite15 on score over 20 event.

    OR you could add BossIsDead DOESNOT equal 1 condition to Sprite15 spawn event by creating a condition that says it DOES equal but then right click the condition and choose the red X to invert it to mean NOT.

    You will also need to move the System Add 1 to BossIsDead action to ABOVE the destroy action so he doesn't pop in for a split second before the variable stops him spawning.

    You add more conditions to events by right clicking the small area behind the current condition and choosing Add another condition... you can make many conditions inside a single event.

    Also not sure what the last System BossOneDead=0 is doing.. nothing at this point.... clear as mud?

  • I managed to do it using a simple sprite containing an instance variable called "Number" as a "brain" that obtained a random 1-3 via choose action and called on the box with that number in three events... the extra actions/events you see were a separate text box to bug test choose result to screen and to make the chosen text box spin around when chosen.

    Pic:

    https://drive.google.com/open?id=0Bx-ufu2WID53TV9PSnZWbG1lazQ

    [quote:bci02l6p] How can you say not equal to in C2? I tried the symbol and didn't work

    Use invert, right click the condition in the event and select the red X. It inverts the condition to a NOT state.

  • I played it for a bit (longer than I should have....) It looks and feels right to me. I tried to get it to get weird against objects but it functioned like I thought it should for a N,S,E,W control. What am I missing?

  • Make a global variable by right clicking canvas in event sheet and creating one. Name it BossOneDead and set its initial value to 0.

    Now wherever you create the boss right click in the left side boxes (not the actions, the conditions.. like On level start, etc) and choose add new condition and use system (gear) and select Compare global variable. Set it to BossOneDead=0. Now that event will not fire unless BossOneDead is equal to 0.

    Now go to where you destroy the boss after player kills him. Add the action Set global variable BossOneDead=1 right above the destroy action.

    Now once the player kills the boss he will stay dead.

  • For left and right you could use gravity along with bullet behavior to make it drop after thrown, your timer should make it break simulating hitting the ground when really it just looked like it, collisions with other objects could break it as normal.. Up and down shouldn't show drop, if so it could be done with scaling object size down to simulate fall when thrown up...

    as for direction of throw, set bullet angle of motion to player.angle wouldn't work?

  • You just have to make him stay dead.

    You will need to remind the game that he is dead whenever it thinks he needs to be active. A global variable boss1Dead=1 (or boolean if you like) and start it at boss1Dead=0 then set it to 1 whenever he dies, then you just have to add the condition boss1Dead=0 into the conditions for his spawn.

  • Dropbox or other file source the capx so we can see the complications, it will make it easier to sort out.

    At a glance I would say make a separate charging animation that you can set before attack and then switch to attack from.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Is the bar "filled"? Ie. do you have a second sprite of an empty bar with an internal color fill? Have you tried simply setting the bar width to 100 or another set value and reducing its width the amount of damage taken? If its doesn't drain and show an empty sprite you could also put the bar on a lower layer than the end cap and put a background colored sprite behind the end cap to edge of screen and then shift the health bar to the left "behind" them with each increment of damage.

  • How are you picking it up?

    I would say the best way would be to destroy the one you picked up, spawn another at the same time with a bullet behavior attached, have that one also with a timer behavior set to a "distance" of whatever time looks right (0.3,0.5, etc) have the angle set the same as player angle. On "distance" timer tag have destroy animation play and destroy pot.

    Am I missing something?

  • Can you share your capx via dropbox or other file share?

  • [quote:3ab0pqrz]Random doesent work because it gives a number between 0 and 13 which could be 5,654365764 for example.

    I guess it would work with round(random(13)) or floor(random(14).

    That's right.. you would need to use floor(random(0,4)) for whole numbers.

    Glad you worked it out!

  • No they still stack up from first to latest.. just now the expressions window is directly over the action one... this tells me somehow it stored the location before.. just have to figure out what I did to make it remember the moved position between sessions.

  • I am not sure what version it started with but it seems that now all new pop-up info windows open directly over top of the one below, or slightly down just covering the accept option... I don't recall it doing this when I first started, it makes projects tedious now, and its driving me nuts.

    Example: double click layout to open sprite manager, color picker is directly on top of sprite window.

    Example: Choose create action or event, "objects with expressions" window is over top of done/cancel buttons!

    I have looked all through preferences and search forums for a solution or explanation but came up short.

    Anyone have a similar problem that can tell me whether this is something I have done or just "the way it is"?

  • You could always use "Pick instance with UID" along with Choose(0,1,2,3,4,5,6,7,8,9,10,11,12). I tried multiple ways to use random(0,13) but random doesn't seem to work well with Pick UID...

    Of course the UID numbers I use assume your spawners are the first 12 sprites made in the project, otherwise you will need to use your UIDs.

    but then if your spawner objects are all the same instance you could just use "Pick random instance".

    Regardless, you will need to choose the spawn point first and then fire off the spawn.