game-engine

Pygame FPS is only 0.0

Pygame FPS is only 0.0 Question: So, I am making a game engine in python using pygame. I am trying to get and display fps using pygame.time.Clock().get_fps(), but it is only saying 0.0 . Here is the basic code: import pygame from pygame.locals import * screen = pygame.display.set_mode() while 1: print(pygame.time.Clock().get_fps()) pygame.time.Clock().tick(60) I just need …

Total answers: 2

Why can't I load a .OBJ file into Python Ursina?

Why can't I load a .OBJ file into Python Ursina? Question: I am using the python Ursina engine. I want to import a .OBJ file, but it never works, yet no errors are raised. I have tried: from ursina import * from ursina.mesh_importer import * app = Ursina() model123 = load_model(‘model123.obj’) model123Entity = Entity(model=model123) def …

Total answers: 2

Ursina engine texture mapping

Ursina engine texture mapping Question: So the problem I’m facing is that I cannot figure out how to apply textures to a model in a way that texture would be different on each side. For example I wanted to create Minecraft like grass blocks with bottom being brown, sides – green and brown and top …

Total answers: 2

How to access objects from specific layer in blender game engine

How to access objects from specific layer in blender game engine Question: I want to make a game with progressive level generation. I have some diferent parts of the level on another layer and I spawn them in the first layer using add object in python controller. The problem is when there are multiple objects …

Total answers: 1

Detect mouseover an image in Pygame

Detect mouseover an image in Pygame Question: I have an image: newGameButton = pygame.image.load(“images/newGameButton.png”).convert_alpha() I then display it on the screen: screen.blit(newGameButton, (0,0)) How do I detect if the mouse is touching the image? Asked By: mattjegan || Source Answers: I’m sure there are more pythonic ways to do this, but here is a simple …

Total answers: 3