Digitalsa's Recent Forum Activity

  • This seems like it should be such a simple problem to resolve, but I can't get my elements to sit X amount of pixels from the left of the window and X amount from the top of the window in my project, don't get me started on perfectly centring something.

    I did find a line of code somewhere for centring something horizontally and vertically, but it doesn't seem to work. ViewportLeft("Layer") + ViewportRight("Layer") / 2 is meant to centre a sprite or object horizontally centre, but I find my element is either too far to the left or too far to the right. I am using scale mode, "Scale Outer" my project window size is 640 x 960 and the subsequent layouts are also the same size, each layout has unbounded scrolling set to yes.

    I want to perfectly position an element centre, I want to position another element at the bottom of the screen which from my understanding should work using ViewportTop("Layer") + ViewportBottom("Layer") - offsetvalue, however I find my element is being positioned from the top down, not at the bottom of the screen. Am I doing something wrong here? Perhaps the scaling mode is breaking things.

  • Two words my friend: global variables.

    Global variables are persistent over different layouts, so you can store a global variable of score when you die and then fetch it on the game over screen or score screen. The latest version of Construct 2 comes with a Flappy bird template you should look into.

  • Oops sorry, I still have link restrictions on the forums and pasted the correct one initially only to have it removed and then I accidentally pasted the private URL. Here's the public link: copy.com/SD2LKtm2qbO2

    I'll have a look at your example Guizmus, 4k sounds reasonable for buggy behavior. I am only keeping the ball at 850px/s, so with your example it should theoretically be fine! Your example works well until as you say, it gets so fast it just disappears from the screen. I don't think I'll ever run into that problem on this project, thank you for all of your help everyone.

  • copy.com/browse/copy/Test%20Bounce.capx

    Thanks for the help everyone. I've posted up a CAPX online here:

    It won't happen every single time, just sometimes, but enough for it to be considered a final release stopping bug. The thoughts around pixel speed and framerate are interesting. It doesn't seem to happen on desktop as much as it does when I test on my Samsung Galaxy S4 and it's a little more prevalent when viewing on an iPhone 5 as well. The framerate being at fault here would make some logical sense.

    View the above CAPX on your mobile phone and you'll see the issue I am talking about. This is going to be a mobile game, and so, this can't happen.

    In regards to preventing the ball overshooting and or getting stuck on a wall, is there some pre-existing code elsewhere (perhaps another project) that I can implement and test with? I am getting better at Construct 2, but by no means a ninja when it comes to resolving issues using events and messing with positioning coordinates.

  • Yes. It is bouncing behaviour related thread no #89218301 on the forums.

    I've been cruising along with C2 and I've learned a lot of things, I feel as though I have a firm grasp of things but there is just one little bug I can't shake and it appears to be a bug with the bullet behaviour.

    I have done extensive trial and error with the bullet behaviour, I've also extensively searched the forums, looked through example CAPX files and still have yet to solve this issue.

    The problem:

    I have a simple ball sprite with bullet behaviour. The speed is set to 850 and I have 4 walls surrounding my canvas (all belonging to the same family). The walls are set to solid and the sprite ball is set to bounce off solids. The speed remains consistent and never changes. Acceleration is set to 0, as is gravity.

    Now it doesn't happen right away, but when the ball sometimes hits a side wall usually on the X axis (left and right walls), the ball will get stuck and end up sticking to the wall and sliding around the canvas. Eventually it unsticks itself, but this isn't the kind of behaviour I want in my game.

    I've tried toying with the gravity value and every other parameter to no avail. Is there a definitive fix for this problem?

    I've read of others with the same problem and solutions range from custom movement to using physics. For performance reasons, I want to keep using bullet behaviour and I couldn't find any solution for bullet behaviour.

  • How are you doing those touch hotspots? This looks awesome. Would love to see a CAPX to see how you handled the finger drag lag and whatnot. Nice work man.

  • I am a web developer for my day job and I'd tackle this in HTML through the use of nested elements around particular words in a sentence. Maybe the same approach can be applied to the creation of a plugin for Construct 2? I'm quite new to this program myself, but I'll gladly take a look when I get the time and see if I can make something.

  • I tinkered with an attempt ...

    capx

    Wow, that works really well. Thank you very much.

    It seems as though fading colour values on a single layer isn't achievable, using your approach I am doing this and it works the way I wanted it to.

    Have two layers with randomly generated colours

    Every ten seconds hide the current layout and show the next randomly generated colour layout by fading the previous one out and fading the next one in at the same time

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • An anti cheating measure I've been thinking of taking is actually storing numeric values as text. So if you have a score that's 120, you could store it like this: onehundredtwenty — not sure how feasible and easy that would be, but I think it would be a nice multiplayer protective measure.

  • It's me again. This will hopefully be my final question, but I am just wondering how I would go about fading between layer colours?

    At the moment I am setting a layer background colour to a random, R,G and B value and every 10 seconds the colour will change to another random colour, but I want this to be a soft fade effect not a hard and sudden colour change. How would I go about fading between layer colour changes without there being a glimpse of any transparency or background colour showing?

    I thought of a two events at once with delay approach, but it seems hacky in that if any of the events go out of time, then the other event won't be perfectly in time.

    Help is gratefully appreciated.

  • The easiest way I've found you can achieve this is the following:

    * Create a global variable and call it something like: "ActionHappened" and set it's default value to 0.

    * Create a timer that runs every x seconds if the variable ActionHappened = 0

    * Elsewhere you would have your action set the value of ActionHappened to 1 whenever the action you are waiting on has been triggered

    * Then on your earlier timer function I would put an else and then perform whatever code actions you want to perform

    If you need further explanation, just ask.

  • I definitely vote the escape key for pausing. Instinctively it's the key everyone presses first when they want to pause a game. You could even go as far as making the "Pause/Break" key on the keyboard the pause key if you really wanted too and as suggested, you can have multiple ways of pausing the game, not just the one. Just don't have too many pause options or it could get annoying for the end user if they keep accidentally pausing.

Digitalsa's avatar

Digitalsa

Member since 7 Feb, 2014

None one is following Digitalsa yet!

Trophy Case

  • 10-Year Club
  • Regular Visitor Visited Construct.net 7 days in a row
  • RTFM Read the fabulous manual
  • Email Verified

Progress

13/44
How to earn trophies