mystazsea's Forum Posts

  • UM ok....welll its hard to figure out ..but things I would change considering its a spaceship are.

    1- in the system every tick event --> there is no need to pin objects like the thrusters here because PIN already is an every tick function...

    you should make a new event before this everytick event

    System -> on start of layout ....then place all of your pin actions here not in the every tick event

    also make your PIN action( position only) rather than rope style..pretty sure that will help alot

    because rope style is for having something drag behind the object its pinned to..

    Position only style will allow rotation of the thruster relative to the Spaceship hull and allow directional vectoring

    2- it seems you are NOT really using the Physics motion for the thrusters..

    YOu may of wanted this as a feature its had to tell from here ..but normally if you press w to thrust forward..

    what you would do is rather than move the thusters 2 pixels instead use the physics behavior to "apply force at angle" while "w" is down. this will give you the thruster like movement that I think you are after..

    also....one other way would be to ..

    on "w" pressed...apply a uniform physics force to all engines...

    then when you hold "q" or "e" down ->apply an extra physics force to the correct and relative thruster.. eg: q for left or e for right thruster or reversed

    this way..you would still have forward motion but the additional physics force on either the left or right thruster would or should slightly turn the spaceship in the direction you want..

    but yeah first off i would fix the every tick functions and make them -> on start of layout..

    pin behaviour is already every tick...no point doubling up on commands for your processor if you dont need to...

    youll probably find it works alot better too if you pin (position only) rather than rope style

    somewhere on the tutorial page or in the example scenes in construct 2 is a test showing you how each PIN style works....im pretty sure its in the examples when you load a scene in construct 2

    hope that helps

  • You may want to look into Delta time in the manual it should give you the answers you need..

    https://www.scirra.com/tutorials/67/delta-time-and-framerate-independence

    hope that gets you started..

  • Pandemonium, are you using the Physics behavior for the thrusters? or some other behavior...you didnt state how the thrusters affect the motion other than by appearing to be dragged

    some more info would be good.

    some details like ..are the thrusters triggered by key presses or mouse or touch etc?

    i would say some of the problems would be related to how your force or impulse(if you are using Physics) is applied and at what angle the force or impulse is applied.

    To restrict the engagement of the thrusters, just make an event that goes something like

    condition--->key press or whatever-->

    actions----->Left thruster-> is active

    ----->left thruster ->apply force at angle

    ----->Right thruster-> Physics set disabled

    but yeah more info is required to

    give better help at this stage ..otherwise at best we are guessing..

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • hey pirx Its a good question,but before we can try to give you a good answer can you be more specific..

    Some extra details would be appreciated ..like...

    What do you want the draggable object to do when it reaches the border of the restricted area?

    Do you want it to drop?

    Or just stop moving?

    Or is the mouse cursor movement restricted to an area as well as the object is being dragged..

    if you can answer some of these questions you might already have the answer you need..

    Each game is different so it would help if we knew exactly what you wanted to do

    otherwise we can only guess to what specific events or actions you would need

    happy to help out if you can elaborate on the matter

  • The WebNODe Plugin would do this by making an app that you can then call

    Browser plugin behaviors from as well to "bring to front" or "focus"

    ...or you could use the windows 8 plugin..

    and use the "Timer" behavior

    of course the app that you create must be compiled and running in the background in order to pop up at the times you require

    should get you going

  • Nice Kyatric....i might look into that...not bad prize money...thanks for the heads up

  • mm i dont know but id try looking into the AJAX and websocket plugins

    https://www.scirra.com/manual/107/ajax

    https://www.scirra.com/manual/153/websocket

    and then make your own form completion Text input boxes...it should be possible with a bit of research..

  • mmmm Good question

    I dont know if there is an easier way

    but personally id use Two invisible helper sprites connected to the touch function

    On touch spawn invisible helper sprite 1 at Touch pos X,Y and record this pos data in a Temporary variable

    and then somehow detect touch 2 and spawn second sprite at second pos X,Y and record that data

    then make an event loop or normal event to check to see if both sprites are on screen if so...

    if so..

    then check for "distance" movement between the two., x, y pos data ..if the "distance" is increasing ..zoom layout out

    if its decreasing ..zoom layout in...

    if no touch on the screen destroy sprites and clear any XY data stored

    C2 does supports Multi touch which is what you want directly....you could read up it here..

    https://www.scirra.com/manual/119/touch

    Hope that gets you started somehow

  • Hmm this is a really good question....Thanks for asking it....let me have a little think...

    First things first..

    You need to factor in an Level CAP....

    What i mean is a hard limit on the number of levels the player is allowed to have..

    eg: 80 or 100 levels total

    If you try to calculate anything without factoring in a level cap it wont work properly at all

    This would also mean that you need a HARD limit on XP ...

    say 250,000 or something

    The reason for this.... is that without a hard limit any calculations you make will be compounding a problem..

    By limiting the XP to a Hard limit...you can calculate the players current XP as a percentage of the available XP in the game..

    which could also be a problem if you have unlimited enemies or xp gains..as this would throw out any calculations

    The width adjustment of your XPBAR would at best be a guess if you dont have a hard limit on your XP that the player can earn.

    So first i would make a choice as to having unlimited XP levels or hard capped xp levels..

    if you dont hard cap your xp then you may not be able to accurately determine the width of your XPBAR pixel adjustment per level increase..

    If you do a hard capped level you can easily calculate the pixel width adjustment of your XPBAR

    by expressing it as a percentage of the entire XP earned divided by the Ratio of MAXXP to XPBAR overall width.

    I know its very easier for you to just make a capx to show this...but understanding why is good too

    This way more people can see how its done...which is what these forums are about...everyone learns..

    I dont claim to know the only way to do this and yes..i could be way off and a much simpler method exists

    but your question is very specific...its not just a simple health bar ..what you asked for is a calibrated display using a fixed width Bar to represent multiple levels of variance in values that are mostly arbitrary...

    its possible...but your specific request is slightly more complex than you might think..

    lets get into it.

    In addition to knowing the HARD LIMIT values of your earnable XP

    I would use 2 variables to keep track of the XP earned in the game....

    "XP_Current"

    " XP_Total"

    In addition to your MAXXP variable

    You also need to know the absolute, precise and constant value of your XPBAR screen width

    what i mean here is the overall unchanging width of the border of the Bar even if its not visible ..

    you need a fixed width for this on screen..

    Only the XPBAR itself changes width but we need to know the overall dimensions it its FULL or Maxxed initial width.

    The MAXXP values would need to be fixed and set in relation the XP_TOTAL and the Total earnable XP

    next..

    The XP Bar would be connected to XP_Current and this is what you would use only to represent the change in the Ingame XP increase....when it reaches the MAX setting that you determine through the XP_TOTAL..

    Eg: 200 for level 1

    400 for level 2 etc

    or whatever you want each level to be..

    I would just make a comment in your Event sheet to keep in mind the differences in Level increase..

    So ....when your player gains XP you would add the XP earned to the "XP_Current" and the "XP_TOTAL" at the same time

    ..but seeing as only the Bar's size is determined by XP_Current...

    The next step is to check XP_Total..when XP_Total is at 200 or 400 or whatever you want to change a level

    then you would reset XP_Current and reset your bar ...

    or...

    .. if the XP bar width is always set to XP_Current it should auto update...

    You can then place any level up effects/events that you like as Actions

    XP_Total does not reset ..it just tallys and keeps track of how much the player has over all and never resets....

    This way you can still keep track of the total amount of XP earned and relate that to the Hard capped XP limit..

    and have events occur for that if you wish..

    In regard to increasing the amount of XP per level...

    You need to scale the bar with according to a ration of pixels to value...

    so what i mean is....

    If the bar is say 1000 pixels width over all and your MAX XP is 200 for level 1 the ratio of bar width adjustment is based on that ratio for each level

    (Keeping in mind a "Ratio" is a rounded down representation of integer value...Look up "Integer" in the manual if you need to know how to do that..)

    The following is an example but keep in mind your values will be different for your Game

    For level 1 ....

    1000(XP BAR WIDTH in pixels)

    to

    200(XP MAX VALUE lvl 1)

    is going to break down to 5:1 pixels per XP point

    So for every XP point gained your XP bar width would increase 5 pixels

    and level 2 1000(XP BAR WIDTH in pixels) to 400(XP MAX VALUE lvl2) is going to break down to 5:2 pixels per XP point

    in this case every XP point gained your XP bar width would increase 2.5 pixels not really possible so you would make the XP width change 1 pixel with every 2 points of XP...etc etc

    Does that make sense?

    If you keep your level increase "MAXXP" to percentages or decimal amounts in relation to the fixed over all width of your XP BAR and or the HARD capped XP limit .... it will be much easier calculating the width adjustment each level

    Ideally this would all be done with a single event to minimize processor use in game..

    but ill leave that up to you to figure out

    the key to it is RATIO's but it needs to be relative to your XP BAR overall width..

    hope that helps

    There may be other ways...but using ratios is really what i think it comes down to...a ratio is a simpler way to express two or more values and their relation to each other numerically..

    so a simpler way of saying all that above would be..

    level 1 XP gained =1 ---> XPBAR pixel width adjustment = 5 Ratio = 5:1

    level 2 XP gained = 1 ---> XPBAR pixel width adjustment = 2.5 Ratio = 5:2

    and so on according to your Level MAXXP value...

    The value of the XPBAR width remains a constant because its a fixed maximum width overall.

    Only the amount that The XPBAR width adjusts changes for each level

    of course it really does depend on how much your MAXXP value changes per level...

    if its a fixed increase or an arbitrary amount you need a different calculation..

    a sample calculation would be

    LEVEL MAXXP Value

    multiplied by the XP gained / XPBAR max width

    = XPBAR width adjustment per level

    and to code this as an event ...

    condition......On XP gained--->

    action..... set XPBAR.width to (XPBAR.width +MAXXP(perlevel)/XPBAR.Maxwidth))

    where XPBAR.width is the actual bar width and XPBAR.Maxwidth is the overall screen maximum width of the boundary of the XPBAR...

    this doesnt allow for XP gains that are over your Level max and doesnt really take into consideration the Total XP...

    it really needs to be done level by level...with a level cap...for example do you have a LEVEL CAP..like 80 levels or so...

    this would affect the over all calculation as well and should be factored in before you do any calculations

    saying all of that....

    ill try to get onto that capx for you and upload it so other people can use it as well......

    please be patient and try out a few experiments yourself...

    but im pretty sure that Hard capping the XP is the best way to start...

  • hey folks...Just thought id drop this here....just for inspiration...hope its gives some sparks to all the C2 geniuses out there in wonderland..

    happy coding everyone...

    http://code.tutsplus.com/articles/21-ridiculously-impressive-html5-canvas-experiments--net-14210

    My personal favorites, in no particular order, are...

    color cycling..http://www.effectgames.com/demos/canvascycle/

    Blobs http://hakim.se/experiments/html5/blob/03/

    water mechanics http://www.mrdoob.com/#/115/Water_HTML5

    Cloth simulation http://www.effectgames.com/demos/canvascycle/

    TRAILS http://hakim.se/experiments/html5/trail/03/

    AND MAGNETIC systems...http://hakim.se/experiments/html5/magnetic/02/

    some more insane freaky HTML 5 and web gl experiments here

    http://www.hongkiat.com/blog/15-html5-experiments/

    here http://www.kevs3d.co.uk/dev/index.html

    here http://www.thewildernessdowntown.com/

    and here

    http://beta.theexpressiveweb.com/

    Lighting demos http://www.kevs3d.co.uk/dev/canvask3d/ultralight.html

    SILK Drawing app http://weavesilk.com/

    Harmony sketching app http://www.mrdoob.com/projects/harmony/

    awesome digital book herehttp://www.soul-reaper.com/

    Plus a benchmarking tool for you to test your canvas spds http://www.kevs3d.co.uk/dev/canvasmark/

    hope you all Enjoy the genius at work here

  • Just wondering if genuine 8 bit color cycling is a possibility or even feasible as an addition to Construct 2...

    it is a feature of Html 5 ..and has been used in many retro games in the past..

    is it something that could be a possibility...seeing as how easy it is to make simple scenic or sprite FX..

    I know it could be done manually...but just wondering if its an easy addon for C2??

    Any words about it Ashley?

    maybe its been done already and I missed it..

    Just wondering if there is any interest in this...as a feature or whatnot

    Some really samples of HTML 5 palette cycling can be seen here....not bad FX considering its just simple palette cycling..

    http://www.effectgames.com/demos/canvascycle/

  • Presuming you mean like an overlay that is animated in real time...over the top of your basic gameplay...

    There is a example capx in construct 2 in your examples that illustrates an old TV Look...id start with that and add color transparencies and or alter the fx to get what look you need.

    There are all kinds of FX you can make..for example Heat Haze and fullscreen underwater FX ...

    just play around with semi transparent layers with WEB GL settings.

    hope that helps somehow

  • Yarfapet...That's a very solid demo...nice

  • Hi Rapid Motion

    The basic concepts are set out in the Tutorial section of this site.

    It will greatly help your process if you get familiar with the Manual and the tutorials...practice simple stuff until you get the idea

    Like any system that you design in games development,

    A weapon system could become quite complex if you take into consideration all of the factors you may desire to implement in your game...

    Weapon Design and selection would depend on your game style,

    but the basic premise is the same for most games

    First of all you would need to figure out what weapons you intend to have and create or gather all of the required visual elements to display on the screen or in the layout if necessary

    These could be anything from sprite objects with separate weapon animation frames or separate weapon animation of each weapon loaded into the WEAPON object to simple TEXT driven data fields or particles only that display onscreen when required..its totally up to your style of game design.

    There are so many ways to go about it ..You could use a series of sprites with separate images that you either spawn at location of PLAYER and destroy as required on Keypress events or by using a mouse wheel or any other input you can imagine..the basic premise is the same for all input devices

    Once you have the visual elements in place

    Including all of the Bullet elements or FX that you wish to see..

    Then you could begin to code the Events for the Weapon select..

    If you dont have weapons to select from yet..making a weapons selector is kindof pointless as you might want to expand it later and have to redesign your whole system from scratch

    IMHO its always, ALWAYS better to work it all out on paper before you write any CODE or script Events

    This way for each project you can see exactly what you are going to do before you actually go about creating the Assets or lines of code for a system..

    (& Keep a reference of what your weapon names will be in the EVENT SHEETS)

    The basic idea is to Create a Global TEXT Variable called "Weapon_Selected" or simliar

    and set the initial value to "None"

    This helps you keep track of data and make help you quickly determine which weapon is visible at any particular time...

    once again it depends on your game design...you may not need this..

    For keyboard weapon select using the 1-0 keys(thats 10 weapons!!!)

    Create a new event in your event sheet ..

    Condition

    On Keyboard keypress = 1

    Action

    -> system

    -> set GLOBAL VARIABLE "WEAPON_SELECT" to ( your weapon name eg pistol!!)

    -> SET WEAPON.ANIMATION-(WEAPON PISTOL)

    or whatever system you decided to go with ..The ACTION for it would go here

    Second Condition

    On Keyboard keypress = 2

    Action

    -> system

    -> set GLOBAL VARIABLE "WEAPON_SELECT" to ( your second weapon name eg Spudgun!!)

    etc etc

    until you have all of your weapons correctly laid out

    then after all of those declarative Events

    a new Event that Reads

    for mouse wheel driven selection you would create a Global NUMBER variable that adjusts its value in relation to mouse scrolling which then links to a table of events

    for example

    ON MOUSE WHEEL UP...-> SYSTEM ADD TO GLOBAL VARIABLE "WEAPON_SELECT" 1

    ON MOUSE WHEEL DOWN...-> SYSTEM SUBTRACT FROM GLOBAL VARIABLE "WEAPON_SELECT" 1

    THEN A TABLE OF EVENTS LIKE SO

    WEAPON_SELECT = 1

    -> SET WEAPON ANIMATION TO "PISTOL"

    WEAPON_SELECT = 2

    -> SET WEAPON ANIMATION TO "SPUDGUN"

    ETC ETC

    There are many ways to do it..but its really up to you which system works best...for your game..

    There is a basic Tutorial on this

    of course each weapon would most likely need its own unique bullet sprites and sound fx and variables to appear different..

    ie..incendiary bullets would look and do more damage than normal bullets and a flame thrower needs an entirely different approach to design..etc

    Try this Simple Tutorial for more info

    https://www.scirra.com/.../how-do-you-change-weapons-a-lesson-for- beginners

    But yes if you are just starting out ..I really cant emphasise enough that you need to be familiar with the manual and the basic TUTORIALS before attempting anything else...otherwise it may be a little confusing..