Castle

this is NOT my first game. just a new forum acc.

Warning! this game crashes a lot! if you find any bugs, report them, or suggest changes to the code! thanks.
do not spoil anything the game has to offer. there isnt a lot, but there will be much more later.
Extra Stuff.
Heavily based off of Spooky’s Jumpscare Mansion
no end yet. it will be at door 500 later.
Have fun!

5 Likes

Awesome game! I love the art of the enemy and the walls! And I like the idea of how you set the castle levels.

One thing however:

Your level loading code sometimes crashes the game:
image

The reason is because you are generating a random number between zero and the LENGTH of the list (from 0 to 5). This isn’t right because the “Get value at” block uses the INDEX of the level which starts counting from ZERO.
Say we wanted to select the 5th level. The index would actually be 4 because it starts counting from zero.

Since the “length of” block counts from 1 the max generated number can be a 5 which in index position doesn’t exist and results in the game crashing when it tries to load it.

To fix this, simply make the random go from 0 to the length of the list - 1 !

I hope my explanation wasn’t too all over the place. Feel free to ask questions! Otherwise, keep up the good work!

3 Likes

Very cool, is that RAY CASTING? :boom:

1 Like

oh, nice! thanks a lot! this will speed up testing for sure!

2 Likes

yo welcome back

2 Likes

I’m pretty sure I made it out the castle :slightly_smiling_face: