User Tag List

Results 1 to 3 of 3

Thread: Meteor Game

  1. #1
    No Products Registered

    Join Date
    May 2008
    Location
    U.S.A.
    Posts
    138
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Meteor Game

    I am trying to make a game in which you have to defend the city against a bombardment of meteors, pretty simple, however, if a meteor hits the city then i want the screen to shake, how would i do something like this? Also, I am using the mouse to destroy the meteors, so what would i do to leave a simple trail following the mouse for like 100 pixels (or somehting like that), but not stay there forever?

  2. #2
    Forum Moderator Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleMac Export ModuleSWF Export Module
    AndyH's Avatar
    Join Date
    Jun 2006
    Location
    UK
    Posts
    1,445
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Re: Meteor Game

    This is probably more of a general MMF question, rather than one for HWA - but the same solution applies to both MMF2 regular and the HWA beta.

    For screen shake you need to do one simple thing (with a number of steps and clicks).

    1) If your game window is 640x480, set your frame size to 650x490 for example. This leaves a 5 pixel border around all four edges that can be 'off-screen'

    2) Make sure you place all your objects starting 5 pixels from the left and top - ie: take into account that 5 pixel border.

    3) This can be done a little more elegantly but for simplicity the duplication of actions will not hurt...Add an ALWAYS event and set the X scroll position and Y scroll position to 5 and 5 respectively via a two actions. This will make sure that the portion of the frame you want to be visible is on screen and that you have a 5 pixel border as defined above while the game plays.

    4) Finally, when you want the screen to shake, add two more actions to set the X scroll position and Y scroll position to RND(10) and RND(10) respectively. This will pick a random number for each between 0 and 9 and set the X and Y scroll position of the screen in different places. repeat this every frame for some time and the screen will shake.

    That's the principle, to make it better, you could limit the shake to only the X axis, you could use a global or alterable value to specify the amount of shake and reduce this to 'fade' out the shake, eg: set X scroll pos to 5+(rnd( MyValue ) -10) --- where you change MyValue to be the value passed from an alterable value.


    For trails, one easy solution I regularly use is to create an active object with only the Appearing animation category populated (make sure Stopped or any other animation category is NOT populated). Set the animation frames to make the trail effect of a single 'particle' (this may be a lump or a large object - not talking literally a spec of dust ) and set the animation playback speed as required.

    Then add an ALWAYS event (or a timed event for less frequent) and then a CREATE object action to create your trail active object at the position of your meteor. The trick MMF2 will do is it will

    1) Create a trail object at the position of EVERY meteor in play, not just one. This is because you have not referenced any single instance and MMF2 will therefore run the CREATE action for every Meteor.

    2) Because the trail active object only has the appearing animation, this will play as the object is created and when done it will automatically destroy itself as there are no animation categories to go to when it has finished playing. You therefore do not have to delete the object yourself.

    3) As long as your meteors are moving, every frame they will create a trail object at each position they move to, leaving a long trail behind them that will disappear as the appearing animations come to an end.

    Hope that gives you a head start to do what you need.
    Andy H @ ovine.net
    Awful Jokes - a new cartoon every day: http://awful.ovine.net/
    Ovine's games: http://www.ovine.net

  3. #3
    Forum Moderator Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleMac Export ModuleSWF Export Module
    AndyH's Avatar
    Join Date
    Jun 2006
    Location
    UK
    Posts
    1,445
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Re: Meteor Game

    Ooops, I misread the trails part - for the mouse you can do the same, just set the trail active object to the X pos and the Y pos of the mouse. But maybe the meteor trails will give you some ideas too

    Oh, I don't know how familiar you are with MMF yet, but you'll need to use Expressions (not complicated) as well as Actions and Conditions to build your events. It's not hard to do but the help will show you how to construct an event using these three elements if you get stuck.
    Andy H @ ovine.net
    Awful Jokes - a new cartoon every day: http://awful.ovine.net/
    Ovine's games: http://www.ovine.net

Similar Threads

  1. Donkey Kong JR Game & Watch cloned into arcade game some MMF2 technical problems.
    By daryuss in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 9th June 2013, 09:17 PM
  2. Open exported html doc, game doesnt load. When opening raw SWF, game fits screen!
    By Oreo in forum SWF/Flash Export Module Version 2.0
    Replies: 5
    Last Post: 19th November 2012, 03:16 PM
  3. Meteor Trail Sprite
    By LazyCoder in forum File Archive
    Replies: 7
    Last Post: 2nd January 2008, 11:20 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
  •