dop2000's Recent Forum Activity

  • 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.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • It would be much easier to understand your problem if you share your CAPX.

  • Check this out:

    https://www.dropbox.com/s/6oxbj3g5hndke ... .capx?dl=0

    I think I managed to make a nice system that tracks the state of all buttons (Pressed->Hold->Released->Nothing) and doesn't use the "On button pressed/released" events.

  • totoe

    (loopindex=8 ? 1 : loopindex+1) means "if loopindex=8 then 1, otherwise loopindex+1".

    It's a shorter version of "If then else" event.

    I'll explain again how I did this.

    You need to define an image points for every node (red dot) of your sprite's collision polygon.

    Image points should be located as close as possible to red dots, but a little bit outside of the collision polygon, just a couple of pixels.

    See this picture, green dots are my image points:

    Once a collision with the asteroid is detected, I take a small 4x4 pixels sprite called Detector©® and place it at image point 1.

    Then I move it from image point 1 to 2, then from 2 to 3, and so on, and finally from 8 to 1.

    While it's traveling, I constantly test if Detector it's overlapping the asteroid. If overlapping, I spawn particles at Detector location.

    I should add that my example is not optimized. Detector sprite travels long distances 1 pixel at a time, performing overlapping check every step. And at every pixel where it overlaps with the asteroid, it spawns particles. As a result, there could be 100-200 particle objects spawned! All this may cause huge lags on a slow computer or mobile.

    I don't think in a real game you need such precision, so you can move the Detector sprite 2, 4 or maybe even 10 pixels at once. This will significantly reduce the CPU load.

  • Use particles, here is an example. I highlighted the important bits:

  • "On button pressed" is a triggered event. It's triggered only once for every button pressed.

    I think what happens is when you press 2 buttons quickly enough, this event is triggered once for both buttons.

    The problem is, Gamepad.LastButton(0) only stores one of the buttons codes, not both.

    The best you can do is this:

    Here is the output if I press two buttons quickly:

    Pressed

    Button: 4

    Button: 5

    --

    Unfortunately, the same happens if I am holding button 4 and then press button 5.

    So this solution is not very reliable.

    I would recommend not to use "On button pressed" event at all.

    Detect buttons pressed using testing events "Is button down" or "Is button index down". You can add "System->Trigger once" condition if necessary.

dop2000's avatar

dop2000

Member since 26 May, 2016

Twitter
dop2000 has 279 followers

Connect with dop2000

Trophy Case

  • 10-Year Club
  • Entrepreneur Sold something in the asset store
  • Jupiter Mission Supports Gordon's mission to Jupiter
  • Forum Contributor Made 100 posts in the forums
  • Forum Patron Made 500 posts in the forums
  • Forum Hero Made 1,000 posts in the forums
  • Forum Wizard Made 5,000 posts in the forums
  • Forum Unicorn Made 10,000 posts in the forums
  • x5
    Popular Game One of your games has over 1,000 players
  • x2
    Coach One of your tutorials has over 1,000 readers
  • Educator One of your tutorials has over 10,000 readers
  • Regular Visitor Visited Construct.net 7 days in a row
  • Steady Visitor Visited Construct.net 30 days in a row
  • Enduring Visitor Visited Construct.net 90 days in a row
  • Unrelenting Visitor Visited Construct.net 180 days in a row
  • Continuous Visitor Visited Construct.net 365 days in a row
  • RTFM Read the fabulous manual
  • x3
    Quick Draw First 5 people to up-vote a new Construct 3 release
  • x14
    Great Comment One of your comments gets 3 upvotes
  • Delicious Comment One of your comments gets 10 upvotes
  • Email Verified

Progress

30/44
How to earn trophies