GB Studio Bicycle System
This template and tutorial allows you to build your own Bicycle System in GB Studio to use in game just like in Pokemon. It will allow you to pick up your bicycle, ride it and leave it anywhere you want. Once you come back for it, it will be there.
A tutorial by Robert Doman on youtube is available if you want to make your own from scratch. But I had to tweak a few things because I couldn't make his work 100%. I hope mine works well for you because it took me a long time to make this one work. Let me know if there are any problems with the system.
Moving on, the main feature of this template is the capacity of multiple scenes to allow you to leave your bicycle anywhere after riding it. In this template I placed 2 scenes to show as an example. The House Scene and Bicycle Parking Lot are just extras for you to get the entire feel of this system. Tinker around with the DEMO provided for you to see how it works.
Below are downloadable files that contain the Clock Counter template.
(Made in GB Studio 3.1)
Before you begin using this template I would like to give you a few reminders.
If you're just getting a hang of GB Studio like me, and are too lazy to understand what is going on in this system. Feel free to copy everything to the dot. I suggest for you to understand it though so you can apply it to any "item" that you would like to pick up and leave anywhere in your game.
Prepare your GB Studio Project.
- Make sure your player sprite has a complete set of Idle, Walking + Riding Bicycle Animations.
- Make sure your Bicycle Sprite is also available (just basic left and right would do)
- Create a "Riding Bicycle" Animation state for your Player (I already did all this for you on this template, this is just for those who will create a new project)
- Create a "Hidden" Animation state for your Bicycle for when you interact with it and ride it you can switch it to disappear because your Player will be switching to a Riding Bicycle Animation state.
- Make sure your Bicycle is positioned in the middle of the canvas size and have it's collision box above so when you get down of your bicycle you wont get stuck (see image below for reference)
- Prepare your Variables ($Bicycle, $PLY, PLX, $RidingBicycle etc.)
I already did all this as well and placed them between Variables 100 - 110 so it is far from all your variables in the project you are making
It's fairly simple. All you need to understand are principles:
- Once you enter the first scene. The initial Actor Sprite of the Bicycle should be positioned where you want it to be like next to your house, by the garden or in the garage. This initial set up would have your $Bicycle Value at 0 and have it do nothing. (You may copy the On Init of the Bicycle Actor provided)
- Once you interact with it. The On Interact section should make your Bicycle go to the position 0, 0 and hide (Animation State: Hidden)
- The Bicycle needs to hide because your Player will switch from default idle to riding bicycle animation state (you can't have the bike laying around there while your player is also riding on a bike)
- Your Player is now riding the bicycle therefore you will need the On Init of your player to be able to leave the bicycle (Hence the Attach B Script Button)
- Now here's the tricky part. If you leave the Bicycle on the first scene, the value of the bicycle should correspond to the scene so you won't get confused. In this template the "House" scene is marked (1) so that means the Value of the Bicycle once left in that scene will turn into (1). Once you enter scene (2) which is the Bicycle Parking Lot in this template. The On Init of scene (2) should make the Bicycle Value turn to (2) as well once you leave it there.
- I added a special "Actor move to relative position to x 0 , y -1" whenever you leave it anywhere just to give the bicycle a push to stay a bit away from the player so you won't get stuck. Just a disclaimer though, this doesn't work in super tight spaces.
Remember, all the scenes you want your bicycle system to work in have to have the exact same things:
- Bicycle Actor
- Bicycle Actor's On Init
- Bicycle Actor's On Interact
- On Init of Scene/Player (to be able to identify if Player is riding bicycle or not and be able to leave the bicycle)
Do as you wish with how this system works, you may tweak it, apply it to different items and change the sprite of your Player into anything like carrying something or pulling stuff. Sky is the limit for this one. I hope it works for you. Just let me know if there are any concerns on the comment section down below.
If you're having a hard time to make it work. Just copy everything to the dot then work from there :)
--------------------------------------------------------------------------------------------------
*Purchasing this will help me build my very first RPG game called Avior's Adventures. It's about my son's journey into becoming a local hero within the community of The Nest City by completing quests. You can bike around, fight mosquitoes in a turn based battle system, and level up. It's based on real life people and places here in (El Nido, Palawan). Quests are true to life and overall just making it for fun.
Thanks for dropping by!
Special Thanks to: Material Future, Pixel Pete of Gurb's Adventure and Reakain (Assets used for the Outdoor Scenes)
Purchase
In order to download this asset pack you must purchase it at or above the minimum price of $3.99 USD. You will get access to the following files:
Leave a comment
Log in with itch.io to leave a comment.