DragDrop Behavior and Spaceship shooting

  • Greeting Construct 2 users, I have two issues:

    Problem 1:

    I have included the DragDrop Behaviour to my spaceship sprite. I have placed codes in the Event Sheet that makes the spaceship shoot when the player drags the spaceship in the screen. But unfortunately, the code is not working (the spaceship is not shooting when I am dragging the spaceship). Can you tell me what's wrong with my code, by observing this picture?:

    Problem 2:

    When I preview my game and I drag my spaceship to the top of the screen, I can reach an area where there is no background and the background is white. Can you give me a suggestion to remove this flaw in my game?:

    This is the code that allows the background to scroll and repeat endlessly the image in the background:

  • 1 - the global var default value is 0.25, do you ever change it to be less than or equal to 0 as in the condition?

    2 - you could add a nice background? :) I guess a quick fix is not to have scrollto on the spaceship but instead have it on another object that cannot go beyond a certain x,y. This object would follow the spaceship but stop at co-ordinates that are the very edge of where the white space would appear.

  • To plinkie:

    A) You are saying that my background is not beautiful enough? Do you know where I can get a background with a better appearance? If yes tell me.

    B) Can you give me an example of a code that will allow me to prevent an object to access the white area at the top of the screen (an x,y coordinate)?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • A - woops sorry my comment can be read in different ways. What I meant was no background exists on the white space, you could add a background there suitable to your game to replace the white, that's all I meant as one kind of fix

    B - it would just be give an invisible object scroll to, every tick check if object Y is less than 20 for example then disable scroll to else enable scroll to. And then you do the same for Y greater than for the bottom of the screen. Also do x less than or greater than a value for left and right of the screen. So you are just disabling the scrolling of this object. As for the values to put in you can judge this by playing and then seeing when the white area would be shown by the scroll to of the invisible object, it's like stopping a camera from moving when hit certain boundary.

    If you cannot work it out after an attempt then let me know, maybe I can make a quick thing

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)