My full project .cap, with notes and comments

This forum is currently in read-only mode.
0 favourites
From the Asset Store
With this template you can create your own archer game and customize it however you want.
  • DISCLAIMER:

    This project is in no way an official Scirra tutorial. It is my own creation. I am merely providing it to whoever wants to look through it for educational purposes.

    So here it is. The full .cap, the demo build, the sounds, and the music for Little Hitler in Toyland.

    http://www.mediafire.com/?xdytqn2fyjr

    What's covered:

    • Menu Screen
    • Controls
    • Animations
    • Audio
    • Enemy AI
    • Collision routines
    • Level changing sequences
    • How to make jump-through platforms
    • And, uh... Everything else. It's all there.

    It's all rather heavily commented. I explain what variables are doing and why certain events are being used, how to achieve certain effects, etc.

    In the places where I knew I could have or should have done something different, I made a note about it. Likewise I commented where there is obsolete code that was fixed by the new platform movement in .93. If you have any questions, or any critiques on how something could have been done differently, feel free to post them.

    Hope this helps some people out.

    Oh and I don't think I have to mention this, but it's just for educational purposes. So don't go using the art in your own project or releasing your own build with new levels or whatever. Not that I think you would, I'm just saying. If you're really itching to help me with a final release or whatever then PM me. All other questions about it belong here in the thread.

  • Yay, awesome!

  • Just one thing i thought of. You have probably thought of this yourself too, but if there are anyone who hasn't i will post this anyway.

    We should try to avoid "little hittler" being one of the main tutorials for construct. You know.. peopole are paranoid for nazis, and just the name might give people thie wrong thoughts about the program. Since there isn't very much tutorial stuff on construct yet this will be a good resource, but still we shouldn't go around in every forum we can find shouting: "Try this program construct! Her's a tutorial of how you make a hitler game"... Well... you probably get the point.

  • Yeah, I realize that. Like I said in my TIGS thread, I feel kinda bad that the largest project made with Construct to date is about Hitler on a temper tantrum.

    Sorry, Ashley. It was the Random Game Name Generator what did it So far though nobody has scolded me for making it.

    But yeah, nobody go promoting this elsewhere as a turorial. It's in no way official, and has no affiliation with Scirra. As a mere Construct user, I take full responsibility for it as my own creation.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Yeah, I'm gonna take a look at this, see what I can learn

    EDIT: Whenever I try to scroll down, I get three dialog boxes saying "An invalid argument has been encountered". In your project. Never happened to me :O

  • Yeah, I realize that. Like I said in my TIGS thread, I feel kinda bad that the largest project made with Construct to date is about Hitler on a temper tantrum.

    Sorry, Ashley. It was the Random Game Name Generator what did it So far though nobody has scolded me for making it.

    But yeah, nobody go promoting this elsewhere as a turorial. It's in no way official, and has no affiliation with Scirra. As a mere Construct user, I take full responsibility for it as my own creation.

    Hitler games are epic. I'll make a game where you control Hitler's ragdoll arm with the mouse, and you have to do most SIEG HEILs possible in a minute.

  • Yeah, I'm gonna take a look at this, see what I can learn

    EDIT: Whenever I try to scroll down, I get three dialog boxes saying "An invalid argument has been encountered". In your project. Never happened to me :O

    That's just one bug in a list of them that I have yet to report. It happens if you click the scrollbar in Construct before clicking in the window itself.

    Try it with your own .cap, I don't think it has anything to do with mine specifically.

  • Okay, I've finally gotten around to reporting the bugs I encountered while making this. So far:

    • Crash when adding sprites
    • Error when clicking the scrollbar of an Event Sheet
    • Newly created Event Sheets do not appear in Project list
    • "Close Project" crashes if more than one window is open
    • Play Sound event repeats if window is moved
    • Right-clicking the window bar title causes objects to glitch

    Whew! All submitted to the bug-tracker.

    There's still one more I'm trying to recreate that has to do with crashing when minimizing project windows.

  • I've been looking around at this now, and while it is useful, I think you should use this and write several small tutorials. There's a lot I don't understand in here

  • Okay, I've finally gotten around to reporting the bugs I encountered while making this. So far:

    - Crash when adding sprites

    - Error when clicking the scrollbar of an Event Sheet

    - Newly created Event Sheets do not appear in Project list

    - "Close Project" crashes if more than one window is open

    - Play Sound event repeats if window is moved

    - Right-clicking the window bar title causes objects to glitch

    Great work!

  • I've been looking around at this now, and while it is useful, I think you should use this and write several small tutorials. There's a lot I don't understand in here

    That what the thread is for. Questions!

    Plus, I'm lazy. I'm surprised I actually finished commenting it.

  • Yeah alright. So being new to this whole construct deal, I'm wondering how you made the separate square mask thing for the top and stuff. It looks useful

  • Okay then From the top (no pun intended):

    First, create your sprite:

    <img src="http://i30.tinypic.com/21lmq7d.jpg">

    Easy enough. But it's likely your sprite is animated. If you use per-pixel collisions for detecting the background, it will cause problems because one frame might be clear of the background, but the next frame could intersect. Here's all the top frames visible at once:

    <img src="http://i29.tinypic.com/2rxtd0n.jpg">

    The tilted frames only deviate by a couple of pixels, but that's enough to make collision problems occur. Using Bounding Box collisions on the sprite would make the collision area too large, and would cause problems with player collision or look funny when it's being smashed. So we need to make a separate collision sprite as a surrogate:

    <img src="http://i27.tinypic.com/2nsqljo.jpg">

    I've sized it at a nice, "average" size for the top so collisions will appear more consistent. I've also added a registration point to the tops and the mask so that it'll be easy to line up the hotspots when I put them in Construct.

    From there it's just a matter of importing your top frames into one sprite, and your collision mask into another sprite.

    We want to do all the movement actions on the collision sprite itself (the topBody object in the game) and tell Construct to align the animated sprite on top every cycle. If you have only one instance of each, that's no problem, just put in the events and go. But if you want more than one at a time, you need a way to distinguish between sets of "sprite" and "body." Otherwise, when you do this:

    + body is overlapping weapon
    [ul]
    	[li]sprite: Destroy[/li]
    	[li]body: Destroy[/li]
    [/ul][/code:3rpst3l9]
    
    then that one body will destroy, but so will [i]all[/i] the sprites.
    
    To fix this, you can pair up the sprites with the bodies by using Containers.  According to Ashley:
    
    [quote:3rpst3l9]
    If any object is picked by an event, the rest of the objects in its container are also picked.
    
    So that means if I want to pick a specific body, and "sprite" is in the same container as "body," Construct automatically knows which sprite to pick.
    
    To put something in a container, click on the object and open the Containers section in the properties.  Click "Add object," and select the object you want to pair up:
    
    <img src="http://i32.tinypic.com/bjg5rk.jpg">
    
    Notice that the topSprite is highlighted yellow when the topBody is selected.  This is to indicate which pair it belongs to:
    
    <img src="http://i25.tinypic.com/104m446.jpg">
    
    When you're using containers, you have to make sure you have an equal number of contained elements.  If I have five topBodies, I need five topSprites to match.
    
    Anyway, now we can go back to making events.  If we want to align a sprite with it's specific body, just do this:
    
    [code:3rpst3l9]
    + objectBody condition
    [ul]
    	[li]objectSprite: Set position to objectBody[/li]
    [/ul][/code:3rpst3l9]
    
    Construct places the correct sprite on top of the body that it's paired with.  And if we want to destroy it:
    
    [code:3rpst3l9]
    + objectBody overlaps something dangerous
    [ul]
    	[li]objectSprite: Destroy[/li]
    	[li]objectBody: Destroy[/li]
    [/ul][/code:3rpst3l9]
    
    Construct only destroys the sprite that's paired with the body that is picked by the condition.
    
    I hope that made some kind of sense.
  • YES

    Thank you, that was a really well written tutorial

    You should add it to the wiki, methinks

  • You're welcome, glad I could help

    You should add it to the wiki, methinks

    Maybe a more generic version of it, I don't want to clutter the wiki up with references to my game.

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