Chris PlaysOldGames's Forum Posts

  • I will add that while you "can" do many levels in a single layout it will soon get pretty cluttered and navigation will become a pain. Say you have 30 levels to your game, you could make a layout for the first easy levels, a layout for the middle ones, and a layout for the end game levels and maybe even a another for the bonus levels. This would make navigation easier.

    Layouts just give more flexibility, and the new global layout is no exception.

    Plus you can use layouts to simply do things like store objects so they don't clutter up the edges of your main game layout...

  • As you will soon learn using Construct2... there are a dozen ways to do most anything you are trying to accomplish, its really about finding what looks good to you and doesn't slow down your game (on mobile).

  • I use the choose method in my space shooter (in my sig) when the supply ship comes it does a random(choose 1,2,3,4,5,6,7,8,9,10) and on 1,2,3,4 you get a heal power-up, 5,6,7 a shield power-up, 8,9 a weapon upgrade power-up, and on 10 a +1 life power-up... it works swimmingly.

  • Let me start by saying... THAT LOOKS AWESOME!

    The original SimCity and its later versions all had a small delay when building lost and gained power, I am sure it was for the reasons you speak of, overhead. A periodic check for connection will not significantly affect gameplay. Could you not make is so it only reset the power grid when the bulldozer killed a power line or power transmitting object instead of every time its used?

    Also make sure you are working in reverse on your power, ie. its shouldn't be powered until it has no power, it should be un-powered until it has power... ie. make sure everything is being set to un-powered state periodically until its state is then changed to powered as opposed to just setting there until its powered... this will help avoid overlooked variable changes that cause all kind of silliness.

  • [quote:3opdfsg1]didn't understand the last part ? when i add the text box to the score layer near the time can the payer write his name and save it and every one on the world can see it ? this game is not multilayer.

    Not multilayer! Even free version gives you 3 layers.. that is like making apple pie without a crust...

    OK, what I meant by "Then simply text box "Total Time: "&time" was anywhere you needed to display the "time" variable you were filling with the time-since-start number... In order to do what you are wanting you would need to put a text box like I show ("Total Time: "&time) [The "Total Time" can be changed to anything you want between the ""] You would then need a blank type box object beside your text object if you want them to write their name. HOWEVER, unless you are storing both the name and time value in webstorage or some other method the data will be gone as soon as they close the game.

    I have done a tutorial on webstorage if it helps (https://www.scirra.com/tutorials/1152/introduction-to-webstorage-simplified).

    A better way would be to have to player input their name somewhere before the game starts and save it to a name variable, then at finish display both variables like so: "Awsome, "&name "you lasted "&time "seconds!" and then store these to a persistent website location (several tutorials out there for this type thing).

    [quote:3opdfsg1]here is what happening

    Evey 10 second this object appear and throw things. this things move in different angle and stop. now the problem is when the next 10 second come the object appear and throw new things but also the old things moving again ? so how to stop it for ever

    This is happening because Construct2 doesn't know which instance of the object you are wanting to perform actions on. You will need to "pick" the newly spawned objects and not the old ones. In order to "pick" an instance it must be referenced in the Conditions portion of the event.

    An easy way off the top of my head is to put an Instance variable inside the spawned object and say call it "finished = 0", now right after your stop action after they have spawned and run their course you would add a set Instance variable action to finished=1. Now in your initial spawning Conditions you would add a (object type)-instance variable finished (doesnot) = 1 (or either = 0 your preference).

  • If your doing it in Construct2 then it only needs to be as big as what looks good in a browser, from what I understand, even the Windows port still uses the Chrome browser workings.

    My space shooter (in my sig) was done in like 800x400 and it sizes nicely in a browser windows at full screen. It really depends on how awesome your sprite images are and at what resolution everything scales right for you.

  • I am assuming you have it set so the first power line instance sets itself to powered if its connected to a plant and then each one sets its variable to powered if the one next to it is powered?

    If this is the case you would simply need a global running event every 0.1 seconds or so that set all power lines to unpowered. The powered ones would instantly repower and the unconnected ones would be set to unpowered...

  • On start of layout- Every x seconds (1) - Add 1 to variable (time). Then simply text box "Total Time: "&time.

    Although there is probably an internal way to grab time since start of layout... anyone?

    I am assuming on the second part you mean throw objects a random distance from a center point?

    You could spawn as many objects (even random amounts) at the center object that you want with bullet behaviors in them... set their bullet speed to 100, bullet angle to random(360), wait random(0.25,3), bullet stop.

    You could either set them visible when they spawn or after they stop... whatever effect your after.

    If you want it less random, more like the picture you could use choose instead, ie. random(choose 45,90,110,234,350) to have better control of what angles it can send objects in...

  • The default buttons of Construct2 are very limited, if its not wanting to cooperate, I would recommend making your own sprite button and simply writing your own control events for when the sprite is clicked on, hovered over, etc. This will allow you to use all the cool sprite actions as well.

    That said, have you tried simply setting the other buttons invisible during this period (and then spawning fake ones that do nothing), or overlaying them with an invisible sprite on another higher clear layer so they can't be clicked, or giving each a variable condition you can toggle on/off when play is active...

  • One work around if only one thing can be highlighted at a time would be to have an event turning them ALL off every 0.1 seconds (you could do every tick, but 60x a second is over kill) unless the mouse cursor is over them. This should keep the lagging ones reset.

  • Its generally easier to only use 8-direction for player controlled object and use bullet behavior for enemy units setting the angle and speed, etc. within a bullet behavior event.

  • Make sure your not setting the ball back to original in another event that is overwriting the changes being made here.

    If only one type of ball can exist on screen at a time you could also make a global for each type and set it to 1 (and rest to 0) when that ball is active and then have your spawn only spawn the type set to 1, then reset when it changes.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I understand now, did you get it working correctly?

  • I didn't have time to install timeline object but I will take a shot in the dark...

    Is the problem that the one underneath gets selected when you click on the top one?

    If this is the case then put the bottom ones on a lower layer of their own, say a "solution" layer and the problem ones on a "problem" layer. This way only the top one will be selected and you can then hide it after its clicked or whatever to reveal the solution..

    A second way would be to make an invisible object where you want the solution to show and then simply spawn the solution sprite to that invisible object when its needed to be displayed...

  • I still think you could say make 3 more variables called the three names +temp (like Score_temp) and put them all 3 in a group called say "Temp", then right before you wipe all variables make the Score_temp = Score, etc, etc. and then deactivate group "Temp". They "should" stay safe and unwiped while deactivated, then after reset activate "Temp" and set Score to Score_temp, etc, etc...

    Or like codah suggested.. make an object and set 3 instance variables in it then just set them to your globals before wipe and reset globals from the object after...