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

[Community] Loading screen and menu screen and pause screen #61

Closed
wants to merge 14 commits into from

Conversation

ajh123
Copy link

@ajh123 ajh123 commented Feb 6, 2022

Currently the menu background is not tilled and the single player button once clicked the game freezes then the world loads. Buttons do not work properly if window scaled
Still execute main.py to run it

@ajh123 ajh123 marked this pull request as draft February 6, 2022 13:10
@ajh123 ajh123 changed the title [Community] Loading screen and menu screen [Community] Loading screen and menu screen and pause screen Feb 6, 2022
@ajh123 ajh123 marked this pull request as ready for review February 6, 2022 15:17
@ajh123
Copy link
Author

ajh123 commented Feb 6, 2022

The world saving is defiantly quicker than the loading

@ajh123
Copy link
Author

ajh123 commented Feb 6, 2022

There is no joystick support for the buttons yet :(

@obiwac obiwac added the enhancement New feature or request label Feb 6, 2022
@obiwac
Copy link
Owner

obiwac commented Feb 6, 2022

Cool! I'll check it out in a bit.

The world saving is defiantly quicker than the loading

That makes sense, all saving does is save block ID's of modified chunks, whereas loading has to load every chunk & generate their meshes, which is the most computationally expensive part.

There is no joystick support for the buttons yet :(

@drakeerv

Copy link
Owner

@obiwac obiwac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good!

A couple other things I wanted to note:

  • When the game starts loading, it should be paused by default.
  • Resizing doesn't work properly anymore (on_resize removed?).

Overall nice work!

community/main.py Show resolved Hide resolved
community/main.py Outdated Show resolved Hide resolved
community/main.py Outdated Show resolved Hide resolved
community/main.py Outdated Show resolved Hide resolved
community/main.py Outdated Show resolved Hide resolved
community/main.py Outdated Show resolved Hide resolved
self.texture_manager = texture_manager.TextureManager(16, 16, 256)
class MenuScreen(Scene):
def __init__(self, window):
image = pyglet.image.load("textures/dirt.png").get_texture()
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should probably set magnification filtering to GL_NEAREST (see episode 5).

community/gui.py Show resolved Hide resolved
if texture is None:
self.texture = pyglet.image.SolidColorImagePattern(convert_hashColor_to_RGBA(color)).create_image(width,height)
else:
self.texture = texture
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Texture should be tiled. Not sure how such a thing could be done easily with Pyglet, but you can set a texture to repeat in OpenGL like so:

gl.glTexParameteri(gl.GL_TEXTURE_2D, gl.GL_TEXTURE_WRAP_S, gl.GL_REPEAT)
gl.glTexParameteri(gl.GL_TEXTURE_2D, gl.GL_TEXTURE_WRAP_T, gl.GL_REPEAT)

(Don't forget to bind the texture obviously.)

@ajh123
Copy link
Author

ajh123 commented Feb 6, 2022

Thank you, will try do them :)

@ajh123
Copy link
Author

ajh123 commented Feb 6, 2022

how do i merge them into my branch?

@obiwac
Copy link
Owner

obiwac commented Feb 6, 2022

Pardon, how do you merge what into your branch?

@ajh123
Copy link
Author

ajh123 commented Feb 6, 2022

your sugesstions

@drakeerv
Copy link
Contributor

drakeerv commented Feb 6, 2022

There is no joystick support for the buttons yet :(

There should be? Idk it works for me

@ajh123
Copy link
Author

ajh123 commented Feb 6, 2022

@drakeerv but no support for my GUI clickable buttons yet

@drakeerv
Copy link
Contributor

drakeerv commented Feb 6, 2022

Ah I will try to get it working if I have free time

@obiwac
Copy link
Owner

obiwac commented Feb 6, 2022

your sugesstions

Ah well you can't "merge" those. You can address them by simply committing to your branch though.

@Jukitsu
Copy link
Contributor

Jukitsu commented Feb 6, 2022

I recommend adding the "Loading world" text just when clicking on "singleplayer" to prevent people getting confused why the game is suddendly freezing

@ajh123
Copy link
Author

ajh123 commented Feb 6, 2022

@Jukitsu I will do that once I've done the other stuff

@Jukitsu
Copy link
Contributor

Jukitsu commented Feb 6, 2022

on_resize is missing on the main window

@Jukitsu
Copy link
Contributor

Jukitsu commented Feb 6, 2022

"refresh rate" is unnecessary

@Jukitsu
Copy link
Contributor

Jukitsu commented Feb 6, 2022

and toggle fullscreen needs "window.set_fullscreen" isntead of self.set_fullscreen

@obiwac
Copy link
Owner

obiwac commented Feb 6, 2022

@Jukitsu quick tip: you can make a review for that kinda stuff instead of putting everything into individual comments

@obiwac obiwac marked this pull request as draft February 6, 2022 20:29
@ajh123
Copy link
Author

ajh123 commented Feb 13, 2022

Most things are done now

@obiwac
Copy link
Owner

obiwac commented Feb 14, 2022

Will take a look later today. Could you tell me which changes you made to the world save? There seem to be some conflicts.

@ajh123
Copy link
Author

ajh123 commented Feb 14, 2022

Just added a hidden jukebox somewhere to find. it's quite easy to find tho

@obiwac
Copy link
Owner

obiwac commented Feb 14, 2022

Right. I'll have to see if there's a way/write a program to easily merge Minecraft worlds because obviously git can't do that on its own 😄

@ajh123
Copy link
Author

ajh123 commented Feb 14, 2022

Still don't have a working on_resize implementation for the menus/buttons but the main game sill rezies

@abhra2020-smart
Copy link
Contributor

abhra2020-smart commented Feb 26, 2022

here's a good font: https://www.dafont.com/grand9k-pixel.font (click download btn there)

then use font in pyglet

@abhra2020-smart
Copy link
Contributor

Looking good!

A couple other things I wanted to note:

  • When the game starts loading, it should be paused by default.
  • Resizing doesn't work properly anymore (on_resize removed?).

Overall nice work!

In Minecraft, that's not how it works (as far as I know). It is not paused by default (when I say paused, I mean the pause menu is on screen).

@abhra2020-smart
Copy link
Contributor

Just added a hidden jukebox somewhere to find. it's quite easy to find tho

wdym? easter egg? noice

@obiwac
Copy link
Owner

obiwac commented Feb 26, 2022

In Minecraft, that's not how it works (as far as I know). It is not paused by default (when I say paused, I mean the pause menu is on screen).

If the world is still loading, then I do think it should be paused for better user experience.

@obiwac obiwac mentioned this pull request Mar 22, 2023
Copy link

@aniketm32012 aniketm32012 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code is not proper. It crashes the whole computer, windows 11, python v 3.9

@ajh123
Copy link
Author

ajh123 commented Mar 22, 2023

The code is not proper. It crashes the whole computer, windows 11, python v 3.9

@aniketm32012 The last time I tried it, it did work. But that was ages ago and pyglet may of changed somethings. Does the normal version (from obiwac) work?

@ajh123
Copy link
Author

ajh123 commented Dec 25, 2023

Closing in favour for #104

@ajh123 ajh123 closed this Dec 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants