Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Checking location example #1

Open
davidkreynolds opened this issue Jun 11, 2021 · 2 comments
Open

Checking location example #1

davidkreynolds opened this issue Jun 11, 2021 · 2 comments

Comments

@davidkreynolds
Copy link

Hi,
Imagine a game with a player, and one or more moving targets. The targets move automatically, and the player can be moved using right and left arrow. Can you include an example of how to locate the player, and calculate whether his bullet has hit the target.
I'm sure that some of this is in the docs, but I've had difficulty getting any documentation on this package.
Thanks,
David.

@Amerikranian
Copy link
Owner

Hello.
What you are requesting is not a part of Lucia. It would heavily depend on your implementation of the game. For example, you could have a sorted list of coordinates for entities and then perform something like a Binary Search to find whether they collide. This assumes that your game is only 1D, however. Another approach would be to employ some techniques discussed here, but this also makes several assumptions about your game. As you can see, there is not a right way to do it. Lucia was designed to be a basic framework, not a true game engine with collision and such. You can find a longer example of how to use Lucia here if you are still confused on how it works.
However, I wish to provide a basic warning. From what I understand, the current version of Lucia is deprecated. I think somebody is working on Lucia 2.0, but I do not know so for certain. Default Lucia tools like menus remove the ability to use common patterns like State because they block while the menus are up. Finally, Lucia sound pool does not support caching, which means that any time you play a sound it immediately gets discarded and must be loaded into memory before use. I recommend avoiding using the engine and switch directly to Pygame / Pyglet / insert another less well-known engine here. I would also recommend using Cytolk and Synthizer for speech and sound output respectively. It may be more work at first, but you will not be limited in what you can do.

@davidkreynolds
Copy link
Author

davidkreynolds commented Jun 11, 2021 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants