Nicole Kennedy Design

Ideation, Creation & Everything In Between

Truck Scene – Tomato Game Logic

In the truck scene a group of tomatoes will be in the back of a truck in transit. An animation will then bump the truck and the tomatoes will be animated to fly into the air and freeze prompting the gameplay to begin.

The truck scene requires a very particular logic that allows the following things to happen:

  • The tomatoes should be able to be interacted with and can be clicked on to save them from falling out of the truck this will make them return to their original place in the back of the truck.
  • If the tomatoes are not clicked in time they will fall from the truck and we be lost.
  • Timer capability should be set to five seconds. This can be reduced to make the difficulty of the game increased or vice versa.
  • If some of the tomatoes are saved but the others are not I want the ones that have been saved to return to the truck and the ones that not have been clicked on to fall out of the truck and be wasted.

Originally to set up the logic for this scene I had tried to make use of ArrowPrompts and had used a custom script so that I could position these arrows anywhere in the scene however after vigorous experimentation it was discovered that ArrowPrompts work sequentially so it would not be possible to have them working simultaneously.

ArrowPrompts work in the way that one is active and clickable then the next and the next etc however this would have made the game too directed and not made the player in control and have less freedom of interaction they would have to click on arrow after the other.

The reason that made me want to try ArrowPrompts was because I am able to set a custom icon in place of the arrows and I could have had a hand icon etc appear to direct the player to grab the tomatoes perhaps but unfortunately it was not possible.

Screen Shot 2015-12-02 at 11.27.55

I had the majority of the Actionlists set up for the game logic if they were using ArrowPrompts but as I was not able to have them all active and playable at the same time I used these Actionlists as examples to help me build the logic for the Hotspots.

A hotspot can be activated or deactivated at anytime within gameplay using the hotspot enable/disable action and they also have the capability to make a piece of geometry glow provided they have the highlight script attached. The cursor changes when hovering over the hotspot but the only issue with this is it the same icon for all hotspots within the game and I wanted a different one for these particular set of hotspots.

The game logic involved a lot of time and effort to crack as well as a lot of different Actionlists to begin with as I am working with Previs to do this logic for the meantimes I need animations in order to (debug) test the gameplay. I created animation clips for –

  • Tomatoes in idle
  • Tomatoes raising from the truck to the air
  • Tomatoes returning to the truck
  • Tomatoes falling out of the truck

Using a master actionlist for this scene I called the animation for the tomatoes to be thrown up into the air and this is when I created the hotspots and placed them on the end location of the tomatoes raised and activating the hotspots and beginning the engine wait action and setting it to five seconds to control that the player was being timed within their gameplay at this point. I attached the highlight script to each tomato geometry placeholder as a guide for the player to know that the tomatoes were clickable.

Screen Shot 2015-12-02 at 10.24.57

Variables were used quite often within this scene. I required a boolean variable for each of the five tomatoes by default these variables were set to false.

Upon clicking on a tomato the variable would be set to true and the animation would be called to return the tomatoes to the truck using the object : animate option and also turning off the hotspot after this had been done using object : send message action.

In the master Actionlist were all the animations were called to make the tomatoes fly in the air and the 5 second timer was included engine : wait action I added an Actionlist : run in parallel action that would run 5 other actionlists in the back ground.

I created these five actionlists which checked the variable (variable : check action) and if it was true play the animation of the tomatoes in idle (object : animate) in the saved/returned position else trigger the animation of the tomatoes falling out of the truck.

This is were I had major problems of when I clicked on some of the tomatoes and saved them and left others in the raised position they all animated out of the truck after five seconds this was due to the actionlists not having an idle state to call at this point and the animations of the tomatoes falling being called by default as variables were not in use properly.

Originally I had one variable for all of the tomatoes but now I see that is why all of them had the same behaviour as the tomatoes were all playing the actionlist being prompted by the state of the same variable.

A lot of my brainstorms for how to figure this out are in my sketchbook or required Mary and Fiona to listen to me say what I wanted and how I was going to go about it until it clicked how I was actually going to go about that.

If nothing was done within 5 seconds the object : animate action would be called to play the animation of all the tomatoes falling out of the truck.

The videos below show the examples of the behaviour I have finally been able to create –

Reflection – 

The tomato game logic was so difficult to do and most definitely set up a programming challenge for me personally. I felt a sense of achievement in getting it to function with the different variations of events based on the players behaviour. I think it was good for me to get some difficult logic into the game and also to make use of variables. When I was on placement I remember spending a painstaking day learning variables and I’m so glad that I did not because it came into good use.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


This entry was posted on December 2, 2015 by in Final Year - Creative Futures and tagged .
%d bloggers like this: