It’s a trap! – Week 1

My work today consisted in making a functioning trap for the moth. The trap represents a spider’s web, that can trap the moth until it is destroyed or the player gets “eaten” by a spider.

This is a visual representation of the web:


The octagone is a placeholder for the actual web, which will later be implemented in the project.

In order for the challenge to be more realistic, if the player does not see the web in time and gets caught in it, the sprite will be automatically be dragged to the middle of it and will have ~3 seconds to escape. I am really pleased about how it ended up.

Coding wise, I had to implement a state – the “caught” state,  which unables the movement unless you use a power up when it goes back to the “movement” state. I made the web destroyable by the “dodge” abilty and in the future it will be destroyable also by the sonar, of course, under some conditions.

I think the hardest pract of this task was configuring out the state machine itself and how to make use of it. The coding was a medium effort because I had to do some documentation regarding classes in unity and some variables. Having Jacob as my Lead Coder is a great thing because he is far more experienced than me and can help me with some information that might be hard to understand at a first look.

Testing it worked as a charm. It took me 4-5 tries but it was more like tweaking the code rather than trying to rewrite it or changing it. We already had some scripts for the failure state or the “moving to the middle” (see power up flower for reference) so I was able to make use of those, making it even more easier for me to understand how to make the trap fully workable – with the stun and the destroyable object.

I stated above that I am pleased of the result because it is working as intended, everyone tested it and was also pleased by the result and I am eager to start on my new task. Needless to say – It’s a trap!



One thought on “It’s a trap! – Week 1

  1. After reading the first sentence i already have a good idea of what i could expect from the post. Being a moth and escaping spiderwebs seems like a good and thematic mechanic for the game. The explanation for how the trap would work in game was good and easy to understand. The part for the coding was more extensive and explained most of how the code worked without actually explaining with code. Nice to see that you and your lead coder make such a good team together and help eachother out. Smart to reuse the code for “moving to the middle” and the failure state, the less code you have to create the better, isn’t it? The text as a whole was nicely structured, the picture explained and except for a few grammatical errors completely understandable. I hope the rest of the coding and production goes as smoothly as this and you will have a great game in no time.


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 )

Google+ photo

You are commenting using your Google+ 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 )

Connecting to %s