User Tag List

Results 1 to 5 of 5

Thread: How to make an item generator as Mario Kart?

  1. #1
    No Products Registered

    Join Date
    Jul 2010
    Posts
    24
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How to make an item generator as Mario Kart?

    Hi everyone!
    I'm actually making a Mario game online with a friend, which contains items like in Mario Kart. But we have a little problem with those : It's to generate them according the player's position ?
    I explain myself :
    When you take an object, the item you will have depend on your position (like in mario kart), for exemple, if you are the last, you have a lot of chance to have a blue shell instead of a banana. And if you are first, then you have a lot of chance to have a banana and never a blue shell.
    Do you follow me? But we don't know how to program this with an algorithm, we don't want to do this with 36.000 conditions.

    That's it! I hope you will help me! Thanks!

  2. #2
    No Products Registered

    Join Date
    Aug 2010
    Posts
    343
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How to make an item generator as Mario Kart?

    It is not always useful to make so many references to a specific game. I have not played it. Use terms that define your situation.

    Creating items is pretty simple.
    Set up your condition - on collision or whatever - then create object relative to, say the kart.

    Qualifiers like blue instead of banana you have to code in - random or according to your requirements.

  3. #3
    Forum Moderator Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleSWF Export ModuleXNA Export Module
    ProdigyX's Avatar
    Join Date
    Jan 2011
    Posts
    1,197
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    Re: How to make an item generator as Mario Kart?

    IF you were to do it like mario kart Romain, you could have an event where upon hitting the cube (which is there for the player to get) its turns a players flag on. Upon turning this flag on MMF2 looks to see which position the player in (1st,2nd, 3rd, etc) After seeing which position you can have the character generate a random number (lets say 1-20) Then set it so that if the player is in 1st and he gets a 1, he gets a banana, if he is 5th and he gets a one, he gets a red shell, if he is 8th and he gets a 1, he gets a star, etc

  4. #4
    Clicker

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleXNA Export ModuleUnicode Add-on
    mobichan's Avatar
    Join Date
    Oct 2007
    Location
    Buffalo, NY
    Posts
    3,310
    Mentioned
    28 Post(s)
    Tagged
    0 Thread(s)

    Re: How to make an item generator as Mario Kart?

    First, you need to store a var called PlayerPosition (or whatever you want to call it). This should assign a number to the players based on their position in the race (0 = first place, 1= second place, etc). Then you write your code like this:

    +Player touches item generator
    +Counter = -1
    -Set Counter to Random(PlayerPosition) <--[meaning position in the race]

    +Counter = (some number)
    +Counter <> -1
    - Create (corresponding item) at 0,0(item generator)
    - Set Counter to -1

    You would need to set up a single create event for each item type. I set the counter to -1 so the even only happens once. Just make sure to set the counter back to -1 after you spawn an item so another item can be spawned.

    Then you need to order your items in a specific sequence. Make sure the most powerful item is last, the next best item is second last, etc. This means that the random number you generate will be limited by the player's position. So the better you are doing, the less variety of items you can get.

    Hope this helps,

    Mobichan

  5. #5
    Clicker Fusion 2.5 DeveloperFusion 2.5 DeveloperiOS Export ModuleMac Export ModuleSWF Export ModuleUnicode Add-on
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    JasonDarby's Avatar
    Join Date
    Jun 2006
    Location
    UK
    Posts
    4,938
    Mentioned
    0 Post(s)
    Tagged
    1 Thread(s)

    Re: How to make an item generator as Mario Kart?

    how about you create a counter that contains the number of items that you have...

    1. Speed
    2. shoot
    3. ...etc

    So what you are going to do is do a random chance of getting any of those say 6 items. You know that the higher the number will be the more powerful items, while the lower number will be the least powerful items.

    If you are first you will minus 3 say from the random value, thus you will only get one of the lower random items, while if you are last you +3, so you will only get a random chance of getting an item.

    Not sure if that makes sense, but that is prety easy to do and will only require a few lines.

    Jason

Similar Threads

  1. Mario Kart exemple
    By Cyberclic in forum File Archive
    Replies: 7
    Last Post: 8th April 2013, 06:21 PM
  2. "Mario Kart" style perspective rendering help
    By mobichan in forum Multimedia Fusion 2 - Technical Support
    Replies: 9
    Last Post: 19th December 2011, 09:07 PM
  3. Mario Kart race car AI (cpu)
    By Leander in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 24th July 2008, 11:01 AM
  4. How i make a mario game?
    By Sebba in forum The Games Factory 2 - Technical Support
    Replies: 11
    Last Post: 27th January 2008, 10:50 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
  •