smileyface12349 / warwick-game-jam-2023

The Great Warwick Game Jam is a 2-week long game jam ran by the Department of Computer Science at the University of Warwick.
GNU General Public License v3.0
4 stars 0 forks source link

Collectibles & Walls #13

Closed smileyface12349 closed 1 year ago

smileyface12349 commented 1 year ago

Need to determine if graph goes through it. Could try to get intersection with a circle?

Obviously collectibles are good and walls are bad. Collectibles will probably be frogs that can jump into the train. These should add to your score. Walls will make the train crash.

smileyface12349 commented 1 year ago

Check if the train's position moves within a circle around the collectible. If so, trigger something.

If it's a collectible, just call some function and score will be added etc. If it's a wall, need to tell some function to return null to let it derail (I can do this if you want)

smileyface12349 commented 1 year ago

When picking up a frog, call AddPoints(1000) on the ExecuteLevel script attached to the LevelController

smileyface12349 commented 1 year ago

(Also please make prefabs for frogs and walls)

smileyface12349 commented 1 year ago

Change of plan: Please call CollectFrog() on the ExecuteLevel script, and do not call AddPoints() at all.

smileyface12349 commented 1 year ago

Forgot to say, you'll probably want to check out triggers for this. A trigger is like a collision, but it just fires an event and doesn't actually collide.

I'd have a script on each collectible/wall which then detects if something enters its trigger radius. It should then check that this object is in fact the train (a name check would suffice), and then act accordingly. For a collectible, after calling the relevant method it should destroy itself. For a wall, it should pass some signal to tell the train to derail itself.

beanrob commented 1 year ago

Does a method to end the level exist yet?

smileyface12349 commented 1 year ago

There's a Derail() method.

I can make a method on the ExecuteLevel script to call the relevant method if you like.

smileyface12349 commented 1 year ago

Just added a method: Call Fail() in ExecuteLevel

smileyface12349 commented 1 year ago

Great job!