Since my last post I decided to try and
attack what I felt would be the hardest thing to accomplish, the
wheel menu system.
Fortunately I realized after a bit of
pondering that I did something similar when I made the start menu for
CatAttack!!!
My solution was to create an animation
for each of the possible rotations, start and exit. Doesn't look
like much (right now), but it works the way I need it to. A state
machine will be used for each of the possible animations and the
accompanying logic that each selection will have to do. It's not
fully set up yet, but since I've done something similar before I
don't see an issue.
The next task that needed to
be done is an inventory system (this turned out to be a lot harder
than the wheel menu).
While there are a quite a few drag and
drop inventory system tutorials on the net, I wanted one that would
operate somewhat like Tetris (uneven “blocks”) and would function
easily using a controller. This was quite a goal that I had set for
myself, and after spending days watching/doing tutorials on arrays
and matrices I came to the realization that it's going to be a while
before I have a working understanding on how they operate and how to
make them do what I want. Being the impatient artiest I am, I
decided on a workaround solution using the knowledge I already have
and understand.
So the first thing I needed to solve
was grid based movement. Thankfully there are quite a few tutorials
on the subject and I managed to find one that gave me enough
framework to build upon (the red cursor moves smoothly between 64X64
tiles).
The second issue was grabbing items in
the inventory and having the player decide what to do with it via a
button press. The solution was an easy pop up menu that would ask
what the player wanted to do with the grabbed item, animation and
logic controlled by a state machine.
The third and most difficult issue was
instantiating these irregular blocks onto a grid. This is the part
were I spent days looking at array tutorials. My solution was forgo
the array for now and spawn the item in the top left corner, then to
create a “track”, have the item travel around this track looking
for a free spot using raycast to detect area colliders on each item.
This is horribly inefficient, but dose the job. I haven't inserted
this framework into my MVP yet so it is possible my solution will
fall apart when trying to actually integrate it. But I'm positive I
can overcome it with my bubblegumnojutsu.
Anyway I bought some Godot tutorials on
Udemy. I'll probably spend the next few days doing tutorials and
reinforcing my foundations as I try to integrate the inventory system
into my MVP.
No comments:
Post a Comment