i experimented with rays:
https://drive.google.com/file/d/1jJyTYdmz-OF-YaZR92Z7nWxZ6ngkFcKC/view )
And to create many sprites on one "base" i used "sprite points"
i experimented with rays:
https://drive.google.com/file/d/1jJyTYdmz-OF-YaZR92Z7nWxZ6ngkFcKC/view )
And to create many sprites on one "base" i used "sprite points"
For me this example didn't work as good, it is a slight drop in frame rate (1-2fps) compared to no raycasting. [edit] correction, there was a vast improvement in fps. I was using the example improperly. When I changed the animation to the textured wall it improved dramatically. Amazing work!
I haven't tried to make a projectile yet but I've thought about it quite a bit.
I'm curious what you mean by sprite points. Do you store the coordinates in object variables for the walls to be created? [edit] I looked more at your new example and I think I see what you mean. You're using the sensor to create the necessary objects when it hits the walls. I think this is what you mean?
I had thought of making 4 types of wall base for walls facing north, east, south, and west, then creating 8 at a time in a "repeat" condition
I think I still need to learn a great deal more before I can understand it. But it's fun to tinker with.
I notice I've been able to have up to 48fps in this version but as you say it lacks some consistency. I notice for me the place it has the hardest time is when you get close to walls, particularly corners.
I wonder if a perimeter around the projected walls to keep the player from getting too close to get a more consistent fps.
In this example, slowdown occurs when close to walls due to the placement of the "wall sprites". There are 181 rays and 181 "wall sprites". A "wall sprite" is "attached" to the end of each ray, therefore, when you come close to the wall, all the "wall sprites" are practically at the same point, since the rays "flow around" the obstacles that you create in the editor in 2D view.
It may not be ideal for what you are doing. Yours is a first person shooter. For what I'm doing, I don't need a lot of action components. I made a perimeter around the walls, and took out all of the extra stuff. I was able to maintain an almost consistent frame rate ~38-41.
I am going to try and see next if I can figure out how to broaden the ray to give a wider perspective, and see how that acts.
[edit] upon trying the broader perspective I am unsatisfied with the gaps that appear from the thinning rays. I may try wider tiles. I'm undecided at this point. I do like to experiment with it; it is a vast improvement over the previous method.