dop2000's Forum Posts

  • [quote:7xbijjzs] Pin this to the base sprite's position only so it will move on the "horizontal" plane with the base sprite, and set up its own random vertical bullet behavior for the "height".

    oosyrag, Do you need Pin+ behavior for this?

    It's a nice solution, I tried to make something similar, only without the invisible base sprite.

    That base sprite speed needs to be different depending on its angle of motion. The closer angle is to vertical, the slower it should move.

  • In theory, the "On error" event should be triggered.

  • Thanks oosyrag !

    I wonder if it's possible to somehow corrupt the local storage to see what kind of error message I'll get in C2.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • And I'll ask you again - have you tried contacting that guy from Twitter?

    Because I only have a general idea how to do it and I'm not good with math.

    I tried and it doesn't look very good and my particles are only flying to the left:

    (link removed)

  • No, you can't do it, because objects in Construct 2 are 2-dimensional..

  • , If you are planning to have hundreds of weapons you should definitely re-think your approach..

    I would make a "database" of all available weapons:

    You can create this table in Excel, save as text file (.CSV) and import to Construct 2.

    Use CSV plugin to read data from this file, it's pretty simple.

    Another option - XML. But personally I prefer CSV.

    When you have your weapons database, you can select several weapons from it (by current level, shop type) and put them into the shop. Create sprites, set animation, arrange them on the shelves, etc. Set instance variable on each sprite to weapon code.

    So for example you'll have instances with codes "ShortSword_2", "LongSword_2", "LongBow_2".

    When player clicks the long sword sprite, you can retrieve all other information from the CSV by code "LongSword_2". Deduct its price from player's money, update weapon in player's hand, update damage values etc.

    Edit: I just noticed that you are planning to sell armor and other items. You can make similar databases for them.

    Or maybe combine everything in one, but it may become too complex.

    Also, I suggest you learn how to use loops and functions, it will make your life much easier.

  • Hi DiabloOvermind,

    No, you can't do this with Particle behavior, so definitely not particles.

    I'm guessing these are sprites, probably Bullet behavior with gravity, plus some programming to make them "bounce" at different angles..

    sebrosen have you tried asking that guy on twitter?

  • I'm guessing you have "Set angle=Yes" in Bullet behavior?

    Make sure the image of the ship (when you double-click your sprite) is correctly positioned. It should be horizontal and facing right.

  • Ok, I should warn that I have zero experience with regex and this is my first ever regex pattern.

    I was stunned when I got it right from the first attempt!

    RegexMatchAt(text, "[.|!|?]\s+(\w+[.|!|?])", "i", 1)[/code:3imwggfy]
    
    There is at least one problem with it - if the one-word sentence is in the beginning of the text, it won't be caught.
    Also, it only searches for well-formatted sentences ending either with full stop, exclamation mark or question mark. 
    There may be other issues. But hey, I'm still proud!
  • Add "Trigger once" condition to your event:

    Biox -> Box=1

    System->Trigger once

  • Please share your project (CAPX file).

  • Glad to help!

    (loopindex=0 ? "A" : "Z") means if loopindex=0 then "A", otherwise "Z".

    It's called ternary operator, I think it exists in many languages.

    You can nest them one inside another, and yes "Y" at the end basically means "anything else". You can change it to this:

    Set Keyname to loopindex=0 ? "A" : loopindex=1 ? "B" : loopindex=2 ? "X" : loopindex=3 ? "Y" : "other"

    Of course if you have 20 buttons, this expression will become quite long and messy.

    You may use a different method, for example pick name from a string like this "A,B,X,Y,,,DpadUp,DpadDn,....." using TokenAt(KeyNames, loopindex, ",").

  • I'm developing a game for mobile (hopefully both Android and iOS) with 200+ levels and I'm planning to store the progress in Local Storage. Total size of data should not exceed a few Kbytes.

    What is the likelihood that there will be some kind of problem with Local Storage and what should I do in this situation?

    Say, if "On item Get" is not triggered soon, how long should I wait? Should I execute "Get Item" action again?

    What if I never get the item even after several attempts? Should I just reset level progress?

    I imagine players who have completed many levels will be really disappointed..

    Or is this situation so rare that I shouldn't bother about it at all?

    What do you do in your games?

  • Your best option would probably be Platform (without Physics). However, Platform can't bounce off solids, so you'll need to simulate realistic bouncing yourself. Say by calling "Simulate Platform jump" on collision with the floor and decreasing jump strength with every bounce.

    You can try using Physics. The problem is, as far as I know, it doesn't work together with Platform. So to control the ball you will need to change some physics properties - force, impulse, velocity etc.

    And finally, you might be able to do this with Bullet behavior only. (Depending on how much control of the ball you need)

    Say, if the player pressed UP key, change bullet angle to 270 (upward direction) and increase bullet speed.

  • It would be much easier to understand your problem if you share your CAPX.