Categories
Mastering Development

How to control the frames per second rendered by OpenGL driver?

For a simple scene, on windows with Intel graphics we are showing 500fps. Of course that does not mean we can actually show that many given a normal screen refresh rate of 60 to 130, but there is clearly headroom. On my laptop running Ubuntu with a decent NVIDIA card, the same code shows about […]

Categories
Mastering Development

How to make an object constructor in JavaScript;

Could you please explain me what’s wrong in the following code? function box (width, height, color) { this.width=width; this.height=height; this.color=color; this.style.width=width; this.style.height=height; this.style.backgroundColor=color; } var box1 = new box (100, 100, ‘red’); document.body.appendChild(box1);

Categories
Game Creation Mastering Development

How Do I make My Sprite Aim At The Player Any Position The Player Is At? Pygame

so I have a function here called Lookat() that suppose to aim at the player but how can I call the Lookat() function on my main loop to make it aim at the player like how could I get the position? and call it because my position of my player sprite will be updating each […]

Categories
Game Creation Mastering Development

How can I efficiently render a tile-based map with many Z-levels, where the levels act like hollowed out voxels?

My map setup is a little different to what you normally have with tilemaps. The map itself is a rectangular prism, with a width, height, and depth being variable. In my case, width is the x-axis horizontally across the screen, height is the y-axis vertically across the screen; and depth is the z-level, or how […]

Categories
Mastering Development

Camera 2 Api Error – the error that does not take pictures

I am having an issue with the Camera 2 Api. When I try to take a picture it would not function. The system would not crash. The error only occurs when I try to take a picture. Furthermore, I took all the permissions that I need in another activity. The following error occurs. Access denied […]

Categories
Game Creation Mastering Development

Enemies Bullet Shooting At Player Problem How To Fix?

I am trying to make my enemies shoot at my player rect where ever the position the player is and when it collides with the rect it should remove the -1 health ***my problem is that when the enemy shoots its bullet dont attack the player it just hoover over its head for shootss in […]

Categories
Mastering Development

How to fix GIF weirdness in JLabel?

When I try to use a GIF in a JLabel either resized or normal, it smears and produces an odd effect: The GIF I’m using: Layout of the JPanel it is attached to is null, and images that are accessed are part of a jar file. Here’s the code for creating and adding the label: […]

Categories
Mastering Development

Dynamically Change a traingles size in p5.js Javascript Framework

I have a project where I need to move my collectable item by editing the x_pos and y_pos properties of a created object. I can get that to work fine, but the object is supposed to dynamically size as well based on a size property of the object and everything i have tried either makes […]

Categories
Game Creation Mastering Development

Spawning objects inside rectangle JS

I’m making a JS game “Monopoly”, where I spawning players in random position inside a rectangle. I need a formula that spawns circles INSIDE a rectangle, without being outside. Here what I have tried: randomPosition(left, top, width, height, id) { // var x = left + Math.random() * (width-2*this.#playerRadius) + this.#playerRadius; // var y = […]

Categories
Game Creation Mastering Development

When Player Image Scrolling Left, Enemy Mob Scrolls To How Do I fix This?? Pygame

I have a problem with my enemy where when my player scrolls left the enemy scrolls with the player is there anyway to fix this even Video my full code is below its to long to fit here though what I was trying to do is make my enemy not to change its position when […]