Physic Objects + Drag&Drop control

This forum is currently in read-only mode.
0 favourites
From the Asset Store
Simple yet very life-like rag doll made with Physics!
  • Hi,

    Right now I am working on a simple game with physic objects. It's goal is to destroy a building with some kind of projectile (e.g. cannonball + catapult). Here is a first screenshot to visualize my ideas...

    http://www.oinobareion.at/files/game.jpg

    The building on the right side, as well as the cannonball on the left are made up of objects with physical behavior. So far so good. Now my problem: I want to integrate a Drag&Drop control for the catapult. The player should have the possibility to drag the left part of the catapult down and then let go in the right moment. The further he drags it down, the more impulse is given to the cannonball. Is this kind of control possible in Construct? And how?

  • http://dl.dropbox.com/u/2670855/catapult00.cap

    It's just 3-minutes-sketch

    1 action actually. And it's just one way to do it..

    Sorry for incompleteness.

    P.S. Also I didn't use TimeDelta, but it's very usefull to do it.

    P.P.S. The main task for you is to set up physics parameters of all objects.

  • Well, here's my quick example. I guess Russ was quicker

    http://www.box.net/shared/0aojoc43i3

    Edit:

    Uh... mine uses physics in the manner you described, though

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • deadeye

    oh man, you are a pro!

    You almost did all the job

    NICE.

  • wow! thank you very very much. it's so simple and already fun to play with

    the next thing i will try to implement is some kind of imaginary line that crosses the screen. only when all polygons of the castle lie below this line, the castle can be considered as "destroyed". any ideas how i can implement this?

    http://www.oinobareion.at/files/line.jpg

  • The line is simple : Just make it check "collision" with the castle and have a timer(timer start when no collision and goes for 1 sec or so).

    I am kinda new to construct so i am not really sure if this works...

  • + System: For each object purpleWall
    + purpleWall.Y is greater than line.Y
        -> Activate "you win" scenario
    [/code:3iv81owa]
  • thanks again, but I'm afraid there's still a problem: because a few wall elements are already below the line right from the very start, the "you win" scenario gets activated immediately. is there a simple way around this ?

  • yeah I did this once. Also you need to make sure the scene has "settled".

    What I did is check collision on a "forbidden area" sprite, and if nothing had touched it for a while, go ftw.

  • thanks again, but I'm afraid there's still a problem: because a few wall elements are already below the line right from the very start, the "you win" scenario gets activated immediately. is there a simple way around this ?

    Oh yeah, duh . Well, I'm stupid.

    Well, you could have a "Win" variable, and do something like this:

    + Always
        -> Set "Win" variable to 0
    
    + For each object purpleWall
    + purpleWall.Y < line.Y
        -> Add 1 to "Win" variable
    
    + "Win" variable = 0
       -> You win
    [/code:spndb38e]
    
    Or do it Madster's way.
  • BarneyGumble44,

    are you making crush-the-castle remake?

    http://www.kongregate.com/games/ArmorGames/crush-the-castle-players-pack

  • BarneyGumble44,

    are you making crush-the-castle remake?

    http://www.kongregate.com/games/ArmorGames/crush-the-castle-players-pack

    Damn you, there went my morning, lol. I just quit playing that after clicking your link! That's a fun game, never seen it before!

  • > BarneyGumble44,

    > are you making crush-the-castle remake?

    > http://www.kongregate.com/games/ArmorGames/crush-the-castle-players-pack

    >

    Damn you, there went my morning, lol. I just quit playing that after clicking your link! That's a fun game, never seen it before!

    soooorry

    You know Armor Games made some other physics-based games on Flash. I like them.

    (oh.. sorry again )

  • hello again,

    thx for the help...

    this is what we have so far http://www.oinobareion.at/files/undersiege.0.01.cap

    i tried to implement this "forbidden area" thing by Madster...

    [quote:2od4xfzw]yeah I did this once. Also you need to make sure the scene has "settled".

    What I did is check collision on a "forbidden area" sprite, and if nothing had touched it for a while, go ftw.

    I created a new sprite that defines the forbidden area and added an event like this:

    + NOT on collision between spr_ForbiddenArea and spr_castleelement01

    + do something like open a text message

    ... but it simply does nothing! how can I make this work? and how can I make sure the scene has "settled"?

  • You can't really invert a trigger like On Collision. Try inverting the Overlap condition instead, so it reads:

    + NOT forbiddenArea is overlapping castleParts

    -> Do something

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