Inspiration
When I was told about the challenge, I was immediately seduced by the Spark AR technology and wanted to learn it. Initially I thought of doing a treasure hunt game where the treasure have fixed positions in real life and we find a treasure when we point the camera to the position of the object. but I realized that it was complicated and I was running out of time. So I was inspired by the blinkin game tutorial to make a game easier, a 3D improvement of the game.
What it does
This is a motorcycle game where the goal is to dodge stones or cars by tilting your head to the right or left.
How I built it
For the realization, I download free 3d objects. a road, a stone, a car, a motorcycle, and a sky. I then positioned the objects in the camera and animated them. the road has three lanes and obstacles appear randomly on these lanes. the score represents the number of obstacles avoided. when the player does not dodge an obstacle, the game stops and the user is returned to the home page.
Challenges I ran into
I encountered several challenges. First, I had to find a way to continuously increase the bike's x position when the user lean right and decrease it when the user lean left. I finally find a way to do it with a counter patch. the counter increments / decrements each time an animation ends. The action of leaning the head in one direction or another turn on a loop animation connected to the counter which counts the loop. Once this challenge was raised I also had to find a way to stop the counter when the bike reaches the end of the road. I managed to do this using a couple of variable toScript / FromScript. The major challenge was to learn the language by creating the game at the same time given the delay that was close, as I was informed very late.
Accomplishments that I'm proud of
I am proud to have found a way around the constraint that a patch sequence can not be connected to itself. Whenever I'm in a case where I have to control the output value of a sequence to modify an input of the same sequence, I use a couple of variable toScript / fromScript. In the script, I get the toScript signal in a variable and call the monitor () function on the varible, then the subscribe () function that allows me to execute code that will return another signal in the patch editor.
What I learned
I've learnd a lot. for starters, I discovered the Spark AR language, as well as augmented reality. This game is my first 3d realition. and I am delighted. I also discovered many 3d objects on sketchfab that gave me tons of ideas.
What's next for Bike Racing
I think improve the game, add new landscapes, the possibility of changed motorcycle, accelerate with the bike to go faster or more slowly. I also plan to add the possibility to the player to enter his name. Once I've learned enough about the Spark AR language, I'd like to come up with the idea of a more useful, revolutionary application.
Built With
- sparkar
Log in or sign up for Devpost to join the conversation.