User Tag List

Results 1 to 9 of 9

Thread: I need help with Space Invaders

  1. #1
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export ModuleMac Export ModuleSWF Export Module
    Game_Master's Avatar
    Join Date
    Jul 2007
    Location
    England
    Posts
    1,705
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    I need help with Space Invaders

    When the user presses the enter button, the space ship shoots a bullet. I have made it so that it restricts the actions for 00.10 seconds. It takes much longer than 00.10 seconds to shoot. Why is this? How can I fix it?

  2. #2
    Forum Moderator Fusion 2.5 DeveloperHTML5 Export ModuleiOS Export ModuleSWF Export ModuleInstall Creator Pro
    Paul_Boland's Avatar
    Join Date
    Jun 2006
    Location
    Waterford, Ireland.
    Posts
    2,739
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: I need help with Space Invaders

    Hard to say without seeing the coding. How much longer does it take?

    Ah, are you using the mouse with Fire being the mouse button? If so, I've noticed that when the mouse is not moved and you rapidly click the mouse button, MMF is a bit slower to register the clicks compared to when the mouse is moving. That might be the issue but if it is, I don't know how to get around it.
    KnightTrek Productions
    http://www.knighttrek.com

  3. #3
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export ModuleMac Export ModuleSWF Export Module
    Game_Master's Avatar
    Join Date
    Jul 2007
    Location
    England
    Posts
    1,705
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: I need help with Space Invaders

    http://mmfgamer5.googlepages.com/SpaceInvaders.mfa
    The file is above

  4. #4
    No Products Registered

    Join Date
    Nov 2007
    Location
    Wales
    Posts
    69
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: I need help with Space Invaders

    Just tested your code and I would imagine that it's the restrict command that's doing it.

    Why are you restricting the fire command?
    If you only want the player to be able to fire one bullet at a time, then try checking for zero bullets as the second condition instead of the restrict command, so that it will only fire when there are no other bullets active.

    Or if you do wan't multiple bullets with a 0.10 delay between them, then use "every 0.10" followed by the "upon pressing Enter" command.
    This gives you a nice stream of bullets, but makes it a bit too easy.

    I've just tried both methods with your code, and they work fine.

    Krush.

  5. #5
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export ModuleMac Export ModuleSWF Export Module
    Game_Master's Avatar
    Join Date
    Jul 2007
    Location
    England
    Posts
    1,705
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: I need help with Space Invaders

    i want it to fire like it would in the real games. so a short delay inbetween each one.

  6. #6
    Clicker Multimedia Fusion 2 DeveloperiOS Export ModuleSWF Export Module

    Join Date
    Feb 2007
    Location
    Queensland, Australia
    Posts
    317
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: I need help with Space Invaders

    When you fire have this:

    On fire & alterable value a = 0 ->
    Set alterable value a to 1

    alterable value a is >= 1
    Add to alterable value a 1

    alterable value a is >= 200
    Set alterable value a to 0

    That will delay the shot, change 200 to whatever feels right for the game.

  7. #7
    Clicker Fusion 2.5 DeveloperSWF Export Module

    Join Date
    Jun 2006
    Location
    Turku, Finland
    Posts
    1,023
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: I need help with Space Invaders

    That's a good example, but it would delay the shot after the button is pressed. I'd rather change it to

    Alterable Value A = Greater than 200 + upon pressing "shoot" -> shoot and set Alterable Value A to 0.

    Edit: Oh, and of course:
    Every 00.01 -> Add 1 to Alterable Value A.

  8. #8
    No Products Registered

    Join Date
    Nov 2007
    Location
    Wales
    Posts
    69
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: I need help with Space Invaders

    The original Space Invaders only allowed one shot, and wouldn't allow another until that bullet was destroyed.
    To be exact, it wouldn't allow another shot until the animation of the bullet exploding had finished.
    At least on the default dip switch settings anyway.

    So, to get the same gameplay as the original Invaders,add an explosion animation to your bullet active object, and use the method I described a few posts ago to check for the number of bullets alive, like so:

    Upon Pressing "Enter"
    + Number of (bullets)=0


    and seeing as the bullet won't actually be destroyed until the "destroy" animation has finished, you'll have bullets that will act just as the original did.

    For your specific example, you should add code to destroy the missile if it leaves the edge of the screen, for the times when you miss the invaders completely, so that you can fire again when the bullet leaves the screen at the top.

    Krush.

  9. #9
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export ModuleMac Export ModuleSWF Export Module
    Game_Master's Avatar
    Join Date
    Jul 2007
    Location
    England
    Posts
    1,705
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: I need help with Space Invaders

    Thanks Krush_Brother! Now it works! The game should be out soon

Similar Threads

  1. Example for Space Invaders
    By KLiK-iT in forum Multimedia Fusion 2 - Technical Support
    Replies: 6
    Last Post: 12th October 2011, 08:02 AM
  2. Space invaders example
    By Robin_Manager in forum File Archive
    Replies: 4
    Last Post: 14th September 2008, 05:00 PM

Posting Permissions

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