Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Unity 2022.2 is now available as the latest Tech release.
    Dismiss Notice
  3. We are making some changes to the DOTS forums.
    Dismiss Notice
  4. Have a look at our Games Focus blog post series which will show what Unity is doing for all game developers – now, next year, and in the future.
    Dismiss Notice

Road Crossing Game Template

Discussion in 'Assets and Asset Store' started by puppeteer, Sep 9, 2015.

  1. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    (About time I made a thread about this package. Well, here we go!)

    Road Crossing Game Template
    Asset Store Link





    Road Crossing Game is a full Unity template ready for release. It is compatible with mobile as well as standalone and webplayer. It is similar in genre to classic arcade games, as well as modern infinite runners.


    How to Play?
    Use the keyboard arrows or the mouse to move around, collect coins and avoid being killed by the many deadly obstacles. The game controls also fit mobile and console without need for further coding.

    Features:
    - Game ready for release straight out of the box, just build and play!
    - Available in both C# an JS, all in the same package.
    - Works on all platforms, PC, Mac, iOS, Android, etc
    - Supports multiple resolutions and aspect ratios, automatically.
    - Supports Mouse, Keyboard, Gamepad, and Touch controls.
    - Easily customizable with lots of options to control game difficulty.
    - If you need help with anything, contact me, I'll do my best :)

    Update history

    1.55 (12.11.2021)
    - Fixed movement when hitting a wall
    - Updated to latest versions
    - Minor fixes

    1.49 (10.12.2017)
    - Removed all JavaScript assets to prevent future compatibility issues.

    1.48 (26.10.2017)
    - Support for versions of Unity 5.5, Unity 5.6, and Unity 2017

    1.47 (14.05.2016)
    - Added moving platforms you can walk on ( logs floating in the river ).
    - Support for versions higher than Unity 5.3.
    - Better support for UnityAds 5.2 and above.

    1.45 (24.12.2015)
    - Added support for the Animator component, along with an example player.
    - You now have an option in the game controller to stop powerups on death.
    - Added support for Unity 5.3 SceneManger.
    - Uploaded versions for Unity 5.1, 5.2, and 5.3.
    - Bug fixes (static speed multiplier, thicker move limits, victory screen ).

    1.41 (30.11.2015)
    - You can now have a victory condition in randomly generated levels too.
    - New lane sets including 3x lilypads, 5x lilypads, and the super buzzsaw!
    - Continuous tap/mouse control allows the player to be more responsive.
    - Added MainMenu/Restart/Resume buttons to pause screen.
    - Reorganized JS/C# folders to make sure there are no clashes.

    1.36 (24.10.2015)
    - Added an option to create custom levels (non-random), with a victory screen and animation. Example scene with custom level also included.

    1.34 (12.09.2015)
    - Added support for UnityAds along with a quick integration guide.
    - Improved controls responsiveness by caching the next move the player chooses (Similar to how in PacMan you can give the next turn command before you finish your current move)


    1.3 (27.07.2015)
    - Added river lanes with lilypads you can jump on.
    - Added 2 new characters: A sheep and a duck!

    1.27 (10.06.2015)
    - Added 3 new characters: A goat, a turtle, and a koala.
    - Video tutorial showing the process of creating a new character covering everything from modeling in 3DS Max, UVW editing, texturing, and then exporting and implementing the new player into Unity, and adding it to the shop too.
    - When the player dies a ghost spawns which can be moved to a safe area before respawning the player.

    1.23 (21.05.2015)
    - Added lives to the player. When the player dies he loses a life and. Also added an Extra Life item you can pick up. Dying in the fog pushes the fog a little back.
    - Video tutorial shows how to add new enemies to the game, put them in a lane, and make the lane appear in the game.
    - Added script to remove some of the objects after a certain distance. This helps improve performance.

    1.2 (03.04.2015)
    - Added a powerup system. You can collect items throughout the game which give you double coins, slowmotion, etc. You can also add your own powerups to the list.
    - Improved drawcalls by setting the receive/cast shadows state on renderers to one or the other, rather than both.
    - Improved object drops on lanes, allowing for a list of objects that can also drop in a sequence, for better gameplay consistency (random drops are also an option).
    - Set next lane position to be public. You can now see a red line which represents the placement of the next lane in the game.
    - Sounds now play regardless of whether there is an animation or not.
    - Fixed the minimum gap between two objects in C#.
    - Fixed TextByPlatform in C#.

    1.18 (05.03.2015)
    - Added a shop where you can buy and unlock new characters to play as. The coins you collect during gameplay are stored and can be used to buy new cute animals.
    - You can toggle swipe controls for mobile devices. Swipe in a direction to move the player.
    - You can toggle the random move direction for the objects on a lane.
    - You can also set the width of each lane, so you can now have lanes of various widths.
    - Locked movement of player to the grid.

    1.1 (12.02.2015)
    - Entire project ported to C# thanks to Jordan Swapp. You now get the project in both JS and C#.
    - Improved performance and reduced drawcalls.

    1.03 (09.02.2015)
    - You can limit the speed of the Death Line.
    - You can set the minimum gap between moving objects.
    - MAX models are now included in the package
    - Updated tutorial to cover reskinning 3D models, creating new models, and creating new tiles.

    Any feedback welcome!
     
    Last edited: Jan 22, 2022
  2. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    Video tutorial: Adding new enemies

    This 6 minute video shows the process of adding new enemies to the game, putting them in a lane, and then adding the lane to the lane list. For the purpose of the tutorial we used car models from the package Zigzag Infinite Runner but you can use any FBX/OBJ car model you like.




    What we did:

    1. Drag the car models and animation into our project.

    2. Extract the cars we want to use, and assign the correct textures/materials to them.

    3. Duplicate one of enemies and use it as the basis for our car enemy.

    4. Refit the animation of the enemy using the car animation we imported.

    5. Duplicate one of the lanes and use it as the car lane, adding all car variations we made to it. Set speed and number of cars in the lane.

    6. Add the new lane we made to the list of lanes created in the game.
     
  3. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    A new update has just been submitted to the store. It should be accepted within a few days.

    1.34 (12.09.2015)
    - Added support for UnityAds along with a quick integration guide.
    - Improved controls responsiveness by caching the next move the player chooses (Similar to how in PacMan you can give the next turn command before you finish your current move)

    You can read about the UnityAds implementation in the docs here:
    http://puppeteerinteractive.com/Documentation/RCG/documentation.pdf
     
  4. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    Video tutorial: Creating and adding a new player

    This 1 hour video shows the process of creating and adding a new player to Road Crossing Game, starting with 3DS Max where we duplicate the doggy model and modify it into a new Goat model, while also editing the texture in Flash CS3 to fit the new character we created. Finally we import it into Unity, add it to the list of players and to the list of characters in the shop, and also create several death effects for it.

    Watch the video on youtube:



    What we did:

    1. Duplicate doggy model and move it over, then apply a UVW Unwrap modifier to it, and move its UVW to an empty space on the spritesheet. Save the UVW info to a PNG so we can edit it in Flash.
    2. Open the spritesheet in Flash, and drag the UVW PNG to it. Align the new UVW element into the rest of the UVW.
    3. Create a new layer for the goat texture and draw it based on the UVW info we have. Then export the spritesheet to its original location in the project.
    4. When we open 3DS Max again we can see the new texture applied to the duplicated model.
    5. Now we can start to reshape it into a goat. Remove the ears and extrude horns from them, and also reshape head.
    6. Since we created new polygons for the horns we need to edit the UVW again to unwrap and put the horn UVW in an empty space in the spritesheet so we can draw over it.
    7. Same process is repeated for the legs as we want to give them more texture detail than the legs of the dog we duplicated from.
    8. Keep alternating between shaping the model, editing the UVW info, and drawing the texture in Flash until we get the result we want.
    9. Once we have the model ready we can export it as FBX to Unity.
    10. In Unity we duplicate one of the player prefabs and replace the Mesh of the object Part1 into our new model.
    11. Add the new player to the list of players in the game controller.
    12. In the Shop we duplicate one of the buttons and give it a new name. Then we add it to the RCGShop script. You can set the price of the character unlock here.
    Important: Make sure you assign the correct index number in the OnClick() function of the button we created. Index 0 means the 1st character is unlocked, index 1 refers to character 2, etc



    1. We also take a screenshot of the new character and add it to the icons in Flash. Then we assign this new icon to the new button we created.
    2. Finally we duplicate some of the existing death effects for other characters and fit them to our character. Then we assign the new prefabs to the new character.
    That's it!
     
  5. pushingpandas

    pushingpandas

    Joined:
    Jan 12, 2013
    Posts:
    1,417
    Flash, 3dmax .. isnt there an easier way? Iam on mac, dont have 3dmax and flash is retro.
     
  6. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    You can use any 3D modeling software to create your 3D models, and for textures you can use any graphics program that can edit a PNG. Flash CS3 and 3D Max are just the process I feel comfortable using. What's nice about Flash is that it's very intuitive ( just basically lines and fills ), and it's in vectors so you can export it to textures of any size.

    If you're on Mac and looking for free tools to create 3D and 2D graphics I recommend looking at Blender:
    https://www.blender.org/download/

    And Gimp:
    http://www.gimp.org/downloads/

    Aside from doing the graphics, the rest of the tutorial process should be similar on all platforms.
     
  7. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    Update 1.35 (24.10.2015)
    - Added an option to create custom levels (non-random), with a victory screen and animation. Example scene with custom level also included.



    In the video above you can see the difference between the randomized and precreated levels:

    - At first you see how the random lanes are created.
    - Then I empty the list of lanes, and play the game with an empty level
    - Then I place some lanes in the level and play that
     
  8. Felixcat07

    Felixcat07

    Joined:
    Jun 19, 2015
    Posts:
    19
    Hi! First let me tell you I love the template. Second, the gameplay and the graphics are exccellents.
    Can I ask you if you think its possible to add:
    1.-A reward unity botton
    2.-Shop with real $ to buy coins
    Thnx!
    Alex
     
  9. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    Thanks, glad you like it!

    1. Do you mean a points reward when watching a UnityAd to the end?
    2. There are many ready systems on the store that already give real cash purchases. Would you like an integration example of one specific system?
     
  10. Felixcat07

    Felixcat07

    Joined:
    Jun 19, 2015
    Posts:
    19
    Hi! thx for the fast response!
    1. Yes, the reward system. That can be getting a life and continue playing the game, or 10 coins in reward every time you choose playing and add. Thats a very cool system couse you let the user choose and is not a pop up that boders.
    2. Yes, I mean using soomla to buy coins with real $.
    All your games need that, I ll buy them all if you add those!!!!!
    Couse those are the way we can get some $$.
    The best!!!
     
  11. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    OK,
    My current update ( will be in the store within a few days ) has some little additions based on user feedback from the madness sale. After that I will focus on making a new update, maybe with some of your feedback. The Lives/Coins reward is simple enough I think, but the SOOMLA I will take a look at it and see how it can be done.

    If I succeed with SOOMLA integration I will of course add it to many of my other games, just like I did with UnityAds.

    Thanks again for the feedback, this will only make the package better!
     
  12. Felixcat07

    Felixcat07

    Joined:
    Jun 19, 2015
    Posts:
    19
    Thnx a lot!!! Those are really excellent news!
     
  13. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    Update 1.41 (30.11.2015)
    - You can now have a victory condition in randomly generated levels too.
    - New lane sets including 3x lilypads, 5x lilypads, and the super buzzsaw!
    - Continuous tap/mouse control allows the player to be more responsive.
    - Added MainMenu/Restart/Resume buttons to pause screen.
    - Reorganized JS/C# folders to make sure there are no clashes.
     
  14. josker

    josker

    Joined:
    May 10, 2014
    Posts:
    45
    Great template, any chance of being able to add characters using the Animator?
    I can add new models but stuck with animation.
    Thanks.
     
  15. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    Yes, the next update has an option to use either Animation or Animator on the model. If you assign an Animator component you'll have an "Idle" and "Move" animation defined for the character.

    Here's a video of how it would look:
     
    josker likes this.
  16. josker

    josker

    Joined:
    May 10, 2014
    Posts:
    45
    Thats great, thanks.
     
  17. Felixcat07

    Felixcat07

    Joined:
    Jun 19, 2015
    Posts:
    19
    Awesome! Thats look very cool!
    I have to ask you if you can set to STOP the slow motion timer (power up) when you died.
    The best,
    Alex
     
  18. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    When you die, all the powerups should stop and the game should return to normal. Does it not work like this in your game? Which version do you have?
     
    Last edited: Dec 20, 2015
  19. Felixcat07

    Felixcat07

    Joined:
    Jun 19, 2015
    Posts:
    19
    Checking.. I just erased the last one, downloaded again, looks like its the 1.41.. tested and but power ups didnt stop when I died. Could it be the Unity version im using? (5.0.2f1)
     
  20. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    @Felix:
    I'm taking a look at it, from a few tries I see the powerups disappear after gameover, but I might be missing some of the code cases in other parts of the game.

    I might push out a quick fix when I find what's missing.
     
  21. Felixcat07

    Felixcat07

    Joined:
    Jun 19, 2015
    Posts:
    19
    Wait!! Im talking about the moment of loosing 1 life, when the char change to the angels wings, at that moment the slow motion still running.
     
  22. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    OH! That's the way it's supposed to be. I didn't want the player to lose that slowmo/doublecoins during the game just because he lost a life, so I kept it and removed it only on gameover.

    If you don't mind getting your hands dirty with a bit of coding you can make the player lose all powerups when losing a life. Open CSGameController.cs and look for the ChangeLives function. Then add this code at the part where we check if we lost a life:

    Code (CSharp):
    1.                
    2. //Go through all the powerups and nullify their timers, making them end
    3. for ( index = 0 ; index < powerups.Length ; index++ )
    4. {
    5.     //Set the duration of the powerup to 0
    6.     powerups[index].duration = 0;
    7. }
    8.  
    Here's how it looks like on my side:
    upload_2015-12-21_8-59-2.png

    Of course I will add this option in the component with an update, so that you can choose if you want to lose all powerups on death, or just on gameover.
     
    theANMATOR2b likes this.
  23. Felixcat07

    Felixcat07

    Joined:
    Jun 19, 2015
    Posts:
    19
    Awesome! Thnx for your fast and great support!!!
     
  24. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    Forgot to post the update info for 1.45, so here it is:

    1.45 (24.12.2015)
    - Added support for the Animator component, along with an example player.
    - You now have an option in the game controller to stop powerups on death.
    - Added support for Unity 5.3 SceneManger.
    - Uploaded versions for Unity 5.1, 5.2, and 5.3.
    - Bug fixes (static speed multiplier, thicker move limits, victory screen ).
     
  25. DeanMarquette

    DeanMarquette

    Joined:
    Feb 10, 2015
    Posts:
    165
  26. DeanMarquette

    DeanMarquette

    Joined:
    Feb 10, 2015
    Posts:
    165
  27. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    I'll take a look at it, there has to be something that can make it generically workable. Maybe it's more like a pointer thing.
     
  28. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
  29. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    Getting the next update ready, not much added other than the floating logs which let you walk on them freely ( different than the lilypads ), and better controls for Apple TV touch pad:

     
    Felixcat07 likes this.
  30. Felixcat07

    Felixcat07

    Joined:
    Jun 19, 2015
    Posts:
    19
    Amazing! I was going to start making some extra! You made my day ! Now Im going to buy some other teplate from you!
    Cheers!
     
    puppeteer likes this.
  31. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    I had a productive back and forth with a customer who asked me about making a "world map" for the game. The result is ind of a level selector that unlocks the next level when you finish the current one. So far it looks like this:

    RCGLevelSelector1.png
    You'll be able to set add any number of level buttons and put them in a sequential list, then set which one of the levels is unlocked. Any level after that one will be locked, and when you play and win ( victory ) a level, the one next to it will be unlocked. I'm still not sure about the graphics and the way it's built, but I'll try to make it as simple to change as possible.

    Work in progress of course.
     
  32. theANMATOR2b

    theANMATOR2b

    Joined:
    Jul 12, 2014
    Posts:
    7,790
    Angry Birds is probably the best example I know of for this type of level unlock progression. They do it slightly different in every game, all polished to near perfection. It might be worth downloading them all and checking out just for reference.
     
    puppeteer and Wadjey like this.
  33. pncwsn

    pncwsn

    Joined:
    Oct 30, 2017
    Posts:
    2
    Can you help me how to implement admob banner on this project? please!
     
    puppeteer likes this.
  34. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    Hi, I think I replied to you on the fb page regardnig unityads, right?
     
  35. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    Had a request from a customer with this package, so here's a short vid showing how I can replace a mesh on a project-wide basis ( all of the meshes in the project will be changed ):

     
  36. pncwsn

    pncwsn

    Joined:
    Oct 30, 2017
    Posts:
    2
    Yea.!
    You have models FBX format?
     
  37. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    Yes, the project contains an FBX file with all the models of the game, and you can import them into your graphics program and edit it.