We would like to build a community for Small Basic programmers of any age who like to code. Everyone from total beginner to guru is welcome. Click here to register and share your programming journey!


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
3D maze in browser controlled by Small Basic
#86
Currently if there is a monster in view a distance of 1000 is returned.

You can get rid of the monsters by using a maze (set in settings) with none seeded.

I guess at some point it would be good to just report distance and say if it is a wall, monster or other player.  Not sure how to do this with a single distance value as it is now, probably another return data flag?

I don't plan to add anything more, except I may just report the distance to the monster instead of 1000 and find some other way to say it is a monster using a flag for example.  If there is a monster or other player there, then the distance cannot be the distance to the wall behind it since the engine doesn't actually know what is not shown behind another object.

I am open to suggestions on this!

EDIT

I will change so it reports the distance to whatever is there, it will also return a string describing what it saw - this will be the internal object name which will be a wall, enemy or player label.

Hopefully thats it where dist is always the distance to whatever is directly infront of you, and there is also a distLabel string returned saying what it is you see - a little trickier than I thought so hopefully nothing broken - the distance was used to prevent passing through walls and 1000 used for enemies and other players to let us pass throughthem - logic had to change a bit.
[-] The following 1 user Likes litdev's post:
  • AbsoluteBeginner
Reply


Messages In This Thread
RE: 3D maze in browser controlled by Small Basic - by litdev - 02-18-2025, 05:30 PM

Forum Jump:


Users browsing this thread: 43 Guest(s)