Newb needs help.

This forum is currently in read-only mode.
0 favourites
From the Asset Store
Game with complete Source-Code (Construct 3 / .c3p) + HTML5 Exported.
  • Hello everyone. First I would like to say how awsome Construct is, and how thankful I am for all of you guys for creating it. Ok on to my question I'm makeing a simple game and I'm having a problem.

    I can't figure out how to make objects fall and stack up. Example: I click a block and drag it to the top of the screen, once I release it should fall down untill it hits another object. I tried to find an if statment in the events but I havent found one.

    Simple Idea in psudeocode (Sort of)

    Start

    IF "Block1" NOT collision = true

    Block1.z = -1

    ENDIF

    I don't know if that makes sense to you or not, but if you don't understand I'll try to explain more.

  • Use physics behavior.

  • lol, I knew someone would say that. I don't want to use the Physics behaivour because it interacts awkwerd with other objects, and I only want objects to fall down untill they hit another object and stack on it (Like Tetris). Sorry, Thanks for your reply though.

  • Use physics behavior.

    lol, I knew someone would say that. I don't want to use the Physics behaivour because it interacts awkwerd with other objects, and I only want objects to fall down untill they hit another object and stack on it (Like Tetris). Sorry, Thanks for your reply though.

    I was about to say the same thing as Lost my Keys. But now that I know what you need it for, it's obvious you can't use physics for that.

    There are Tetris examples somewhere and the forum btw. Maybe do a google search.

    Still I made this example

    http://dl.dropbox.com/u/2306601/cubebust1.cap

    to kind of resemble your pseudo-code. Maybe it'll be helpful to you. Cheers.

  • Thanks for the help, I couldn't open the cap file it gives me a out of memory error.

  • I bet you use still use version 0.99.62, which is the latest marked stable. But most people here on the forum use a more recent version, often the very last release. Look for it in Construct Discussion.

    The cap was saved in 0.99.7. But you can just grab 0.99.84 I guess.

  • made a little example

    while I was making the cap your thread got 5 answeres lol

    anyway you can find it usefull

    http://www.box.net/shared/lvc3cc76dz

    made with 0.99.62

  • Wow, thanks guys for the help.

    nowon, Thanks I'll have to look over that cap in the morning, from what I've seen it loos awsome.

    PixelRebirth, I don't know if I should use an unstable version if I'm not one of the engineers working on this project.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • PixelRebirth, I don't know if I should use an unstable version if I'm not one of the engineers working on this project.

    There's no need to be overly afraid of the term "unstable". In fact you'll get some sweet new features from more recent Construct versions. Which is why most users on the forum (who surely aren't engineers either) are working with those "evil" unstable builds.

  • Some unstable builds are actually more stable than the stable builds.

  • Hey nowon, can you tell me what this event is in your cap file?

    <img src="http://i925.photobucket.com/albums/ad99/Bustercube/whatsit.png">

    This is what my cap file events look like

    <img src="http://i925.photobucket.com/albums/ad99/Bustercube/whatigot.png">

    Thanks in advance.

  • Hey nowon, can you tell me what this event is in your cap file?

    It's called an inverted condition. So it will be true as long as Block does NOT overlap Terrain. You can rightclick a condition and choose "Invert condition" to invert/negate it.

    Also let me mention that the always condition in that first event is unnecessary . You can as well leave it out. The event will run every tick nonetheless.

    More importantly in Nowon's example and your cap you're just adding to the Y position without incorporating TimeDelta (it would have to be like set Y position to object.Y + 'Y Speed' * TimeDelta). Which would mean the blocks will fall at different speeds on different computers depending on the refresh rate.

    So this is really a thing you should keep an eye on. I recommend reading the following wiki article: TimeDelta Wiki

  • In your case the program will check if the brick ovrlaps terrain and make it fall down if there is no ground beneath.

    When you leave this condition not inverted the event will move your bricks only if they overlap some ground.

  • TimeDelta is really a thing you should keep an eye on

    yep my bad sorry

    Indeed TimeDelta is very important to add

  • Ok thank you both for the help, and I'll go look up Timedelta.

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