Skip to content

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

Closed
samuelh2005 wants to merge 14 commits into
obiwac:masterfrom
samuelh2005:master
Closed

[Community] Loading screen and menu screen and pause screen#61
samuelh2005 wants to merge 14 commits into
obiwac:masterfrom
samuelh2005:master

Conversation

@samuelh2005

@samuelh2005 samuelh2005 commented Feb 6, 2022

Copy link
Copy Markdown

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

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

Copy link
Copy Markdown
Author

The world saving is defiantly quicker than the loading

@samuelh2005

Copy link
Copy Markdown
Author

There is no joystick support for the buttons yet :(

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

obiwac commented Feb 6, 2022

Copy link
Copy Markdown
Owner

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

@obiwac obiwac left a comment

Copy link
Copy Markdown
Owner

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!

Comment thread community/main.py
Comment thread community/main.py Outdated
Comment thread community/main.py Outdated
Comment thread community/main.py Outdated
Comment thread community/main.py Outdated
Comment thread community/main.py Outdated
Comment thread community/main.py
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
Copy Markdown
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).

Comment thread community/gui.py
Comment thread community/scene.py
if texture is None:
self.texture = pyglet.image.SolidColorImagePattern(convert_hashColor_to_RGBA(color)).create_image(width,height)
else:
self.texture = texture

Copy link
Copy Markdown
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.)

@samuelh2005

Copy link
Copy Markdown
Author

Thank you, will try do them :)

@samuelh2005

Copy link
Copy Markdown
Author

how do i merge them into my branch?

@obiwac

obiwac commented Feb 6, 2022

Copy link
Copy Markdown
Owner

Pardon, how do you merge what into your branch?

@samuelh2005

Copy link
Copy Markdown
Author

your sugesstions

@drakeerv

drakeerv commented Feb 6, 2022

Copy link
Copy Markdown
Contributor

There is no joystick support for the buttons yet :(

There should be? Idk it works for me

@samuelh2005

Copy link
Copy Markdown
Author

@drakeerv but no support for my GUI clickable buttons yet

@drakeerv

drakeerv commented Feb 6, 2022

Copy link
Copy Markdown
Contributor

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

@obiwac

obiwac commented Feb 6, 2022

Copy link
Copy Markdown
Owner

your sugesstions

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

@Jukitsu

Jukitsu commented Feb 6, 2022

Copy link
Copy Markdown
Contributor

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

@samuelh2005

Copy link
Copy Markdown
Author

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

@Jukitsu

Jukitsu commented Feb 6, 2022

Copy link
Copy Markdown
Contributor

on_resize is missing on the main window

@Jukitsu

Jukitsu commented Feb 6, 2022

Copy link
Copy Markdown
Contributor

"refresh rate" is unnecessary

@Jukitsu

Jukitsu commented Feb 6, 2022

Copy link
Copy Markdown
Contributor

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

@obiwac

obiwac commented Feb 6, 2022

Copy link
Copy Markdown
Owner

@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
@samuelh2005

Copy link
Copy Markdown
Author

Most things are done now

@obiwac

obiwac commented Feb 14, 2022

Copy link
Copy Markdown
Owner

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

@samuelh2005

Copy link
Copy Markdown
Author

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

@obiwac

obiwac commented Feb 14, 2022

Copy link
Copy Markdown
Owner

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 😄

@samuelh2005

Copy link
Copy Markdown
Author

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

@abhra2020-smart

abhra2020-smart commented Feb 26, 2022

Copy link
Copy Markdown
Contributor

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
Copy Markdown
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
Copy Markdown
Contributor

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

wdym? easter egg? noice

@obiwac

obiwac commented Feb 26, 2022

Copy link
Copy Markdown
Owner

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

@aniketm32012 aniketm32012 left a comment

Copy link
Copy Markdown

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

@samuelh2005

Copy link
Copy Markdown
Author

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?

@samuelh2005

Copy link
Copy Markdown
Author

Closing in favour for #104

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.

7 participants