Thursday, October 17, 2013

Gamemaker Journey -- Day 02

Another great day of Glory \o/
Couldn't spend to whole day today, but let's say about half a day.
I woke up, grumpy mood because of this damn collision problem. Then, with a fresh mind, I started to work on collision masks again. I felt so relieved when it actually worked! After many trials and errors, it appears that a custom collision mask is the best way.
Now the game can be fully played, this is awesome!
BUT, I came up with this strange bug while testing that almost ruined my day: gates will not open even if the character has picked up enough keys.
For simulating an inventory, each key pickup adds +1 theSILVER_KEY variable, and each collision with a door while SILVER_KEY>0 made plays the open gate animation, replace with and opened gate object (so that the Knight may pass behind) and adds -1 to SILVER_KEY.
But, I think that each time the players collide with a gate, he looses one key, even if he has zero.

Luckily earlier this morning I watched this video, out of curiosity:
http://www.youtube.com/watch?v=9crUsl-VR4c
It appears that, by chance, that was the solution!
Sorryfor the language I don't know how to code (yet?)
By assigning a Begin Step to the player :
Test SILVER_KEY:
if SILVER_KEY<0
then set SILVER_KEY to 0
Thus SILVER_KEY will never be negative! And each key pickup brings SILVER_KEY into the positive, always.

This is so nice!
The first level isfully playable now !

I came up with some new ideas for future levels :

- Obcurity: When the Knight begins, he is in the dark and he uncovers the maze by walking.
- Trapped door: picking an object behind a door makes this door shut. The Knight is trapped! niark niark.
- Traps & monsters : this signifies that I should take into consideration HPs, Lives, etc. (later).

Also my girlfriend suggested that instead of walking offscreen, the Knight should really climb the stairs. This is a nice idea, and I think I know how I could put it up.

So long!


No comments:

Post a Comment