The next step is
to implement a mining system allowing players to mine rocks. This feature,
unlike the previous, is going to be quite challenging. I have been looking
around on the internet for help sources and have found very little, therefore a
lot of the implementation will come from experimentation.
I am going to
treat the ore blocks like enemies to the Player, this will make the
implementation easier and I will use ‘health’ as a way of determining the
rock’s state. I will incorporate this with the work that I have just done for Unit 603 – Using AI in Computer Games,
to which I created a working state machine system. These states can help me to
determine the physical state of each rock as it gets damaged, and I’m hoping to
be able to use these states to change the sprite.
EDIT - 27/01/2018: Update!
I have
implemented the mining part of the system. There is currently no interaction,
but there is collision being detected. The solution I found was to fire out a
Ray-cast in the direction that the player is facing (determined by movement
input). The hit data of the Ray-cast is stored in a variable, which I am
currently using to log the name of the object hit to the console. One problem
that I have come across is that I’m not sure how to deal with the animations. I
believe that I would need to create a totally new set of animations for if the
player is walking and mining at the same time. To combat this, as it looks
strange, I have made it so that the Player can only mine when not moving
(mining interrupts movement).
I also added a
nice sky background to the level that I made in GIMP. It was created using a
simple gradient of blue to white. Furthermore, the camera now finds the Player
in the scene at game start and follows him around. There’s a bit of smoothing
time, the camera ‘lags’ behind the Player, I’ve done this because I find that
it’s easier on the eyes if the player isn’t always
in the centre of the screen. For the duration of the next week, I will be
working on implementing the second part to the mining: applying damage to the rocks.
No comments:
Post a Comment