User Tag List

Page 1 of 2 1 2 LastLast
Results 1 to 10 of 16

Thread: Help With Basic Game

  1. #1
    No Products Registered

    Join Date
    Feb 2013
    Posts
    66
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Help With Basic Game

    Hello,

    I am working on a basic tank game. This is my very first game without a tutorial. I got the tank to move with the left and right arrow keys, and the turret to move with the up and down arrow keys. But I can not get the bullets to shoot out the end of the turret. No matter which direction the turret is facing the bullet always shots to the right. Could someone take a look at it please? Thanks a lot.

    tanks5.mfa <-- Click to open/download file

    Their are under 20 events so far.

  2. #2
    Clickteam Clickteam
    Jeff's Avatar
    Join Date
    Jun 2006
    Location
    Battle Ground Washington
    Posts
    11,825
    Mentioned
    8 Post(s)
    Tagged
    2 Thread(s)
    You are changing the angle of the turret but when you use the built in "launch an object" thats going to take the direction of an object.

    What you want to do here is completely possible ... I just would have to think a bit on how I would do this sort of thing and I am busy tonight.
    Someone else might have a solution readily at hand. Some of the 360 degree shooting examples would be what I would use as research material.

  3. #3
    Clicker Fusion 2.5 Developer

    Join Date
    Jul 2008
    Location
    UK
    Posts
    1,393
    Mentioned
    16 Post(s)
    Tagged
    0 Thread(s)
    A simple 360 movement is what you want here (the built-in movements tend to be too buggy for most things).

    http://sdrv.ms/YdIJBW
    You'll see a few variables like "XPosition", "XVelocity", etc - those are just normal alterable values that I've renamed.
    Also, you'll notice that the Y-related values are often negated (eg. 0-Sin..., -1*YVelocity..., etc) - that's because the Y axis in MMF2 (and computers in general) is inverted, so that 0,0 is in the top left corner.

    A couple of other things:

    * Angles and directions both start with 0 pointing to the right. For that reason, it generally makes it easier if you draw things like gun barrels so that they are pointing to the right (you'll see I had to add "+90" in a few places to make the maths work - it would have been easier just to rotate the sprite image 90 degrees in the animation editor).

    * Under the bullet object's properties, there's an option called "create at start". It's good to untick that for things like bullets, because you don't want them to be created until the player shoots.

  4. #4
    No Products Registered

    Join Date
    Feb 2013
    Posts
    66
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by MuddyMole View Post
    A simple 360 movement is what you want here (the built-in movements tend to be too buggy for most things).

    http://sdrv.ms/YdIJBW
    You'll see a few variables like "XPosition", "XVelocity", etc - those are just normal alterable values that I've renamed.
    Also, you'll notice that the Y-related values are often negated (eg. 0-Sin..., -1*YVelocity..., etc) - that's because the Y axis in MMF2 (and computers in general) is inverted, so that 0,0 is in the top left corner.

    A couple of other things:

    * Angles and directions both start with 0 pointing to the right. For that reason, it generally makes it easier if you draw things like gun barrels so that they are pointing to the right (you'll see I had to add "+90" in a few places to make the maths work - it would have been easier just to rotate the sprite image 90 degrees in the animation editor).

    * Under the bullet object's properties, there's an option called "create at start". It's good to untick that for things like bullets, because you don't want them to be created until the player shoots.

    Thanks a lot. The math is really confusing to me. But at least it works now. I don't see a "create at start" option for the bullet. I just see "visible at start". Which un-ticking makes the bullet invisible, and that would require another action to make it visible when it is shoot. Can't I just leave it outside of the play area?

    Thanks again

  5. #5
    Clickteam Clickteam
    Danny's Avatar
    Join Date
    Aug 2007
    Location
    United Kingdom
    Posts
    3,016
    Mentioned
    21 Post(s)
    Tagged
    2 Thread(s)
    Quote Originally Posted by flyoffacliff View Post
    I don't see a "create at start" option for the bullet. I just see "visible at start".
    The 'Create At Start' option should be under the active's Runtime Option, click on the Whitebox with the red arrow inside in the object's properties. If you don't have this tab then the object is a backdrop and not an active...?!
    Want to learn Clickteam Fusion 2.5?




  6. #6
    No Products Registered

    Join Date
    Feb 2013
    Posts
    66
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Danny View Post
    The 'Create At Start' option should be under the active's Runtime Option, click on the Whitebox with the red arrow inside in the object's properties. If you don't have this tab then the object is a backdrop and not an active...?!

    I have the tab, but that is not an option under it. This screenshot shows all available options under that tab:


    runtime options.png


    Maybe it is because I am using an older version of MMF2 (r253 I think). The demo has not been updated to r256.

  7. #7
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleSWF Export Module
    happygreenfrog's Avatar
    Join Date
    May 2011
    Location
    I.L.T.D.O.I.R (I.L.T.D.O.I.R's Location: The Dimension Of Infinite Recursion)
    Posts
    4,307
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    As a work-around, you could make it so that, at the start of the frame, you destroy the bullet object.

  8. #8
    No Products Registered

    Join Date
    Feb 2013
    Posts
    66
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by happygreenfrog View Post
    As a work-around, you could make it so that, at the start of the frame, you destroy the bullet object.

    Okay. Thanks. But is it even necessary to do that?

  9. #9
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleSWF Export Module
    happygreenfrog's Avatar
    Join Date
    May 2011
    Location
    I.L.T.D.O.I.R (I.L.T.D.O.I.R's Location: The Dimension Of Infinite Recursion)
    Posts
    4,307
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    It's an issue with the demo right now. The option should be in the demo, but, for some reason, it isn't. So, for now, you will have to use the work-around.

  10. #10
    No Products Registered

    Join Date
    Feb 2013
    Posts
    66
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by happygreenfrog View Post
    It's an issue with the demo right now. The option should be in the demo, but, for some reason, it isn't. So, for now, you will have to use the work-around.

    I mean why is it necessary to destroy them. They are not affecting anything just sitting there outside of the play area.

Page 1 of 2 1 2 LastLast

Similar Threads

  1. Making a basic maze game - tilesets?
    By TheSynapse in forum Multimedia Fusion 2 - Technical Support
    Replies: 18
    Last Post: 6th May 2014, 02:39 AM
  2. More Help With Basic Game
    By flyoffacliff in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 3rd March 2013, 06:21 PM
  3. Some basic questions
    By SlapFace in forum Multimedia Fusion 2 - Technical Support
    Replies: 10
    Last Post: 19th May 2009, 04:17 PM
  4. Very Basic i know.
    By kayli051203 in forum The Games Factory 2 - Technical Support
    Replies: 4
    Last Post: 18th January 2007, 10:23 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •