Categories
Game Creation Mastering Development

Any ideas as to how a role playing game collision can be made in pygame WITHOUT the use of sprites

Would you use the player’s position X and Y and subtract the tiles X and Y so that if I were to touch the sides my character cannot pass through the specified tile? Is there some other type of thing going on that I don’t understand. (Just want to clarify I am trying to make […]

Categories
Mastering Development

implementing python code on GPU using numba

so I have a function that work on cpu in order to make some computation on an image data set but the data is too big therefore I’ve decided to run it on the gpu using numba the function is below : from numba import jit , cuda @jit(target="cuda") def create_celebahq_cond(tfrecord_dir, celeba_dir, delta_dir, num_threads=4, num_tasks=100, […]

Categories
Mastering Development

Efficient neighbourhood search in numpy ndarray instead of nested conditional for loops

Although there are many instances of the question: "What is the numpy alternative to nested for loops", I was unable to fins a suitable answer for my case. Here it goes: I have a 3D numpy array with "0" background and other integers as foreground. I would like to find and store the foreground voxels […]

Categories
Mastering Development

when we reshape numpy array, how is the stride size inferred?

I have an 1×1024 1-d array (flattened image). To see the image, I want to reshape its size as 32×32. I can easily achieve this by doing x.reshape(-1,32) and it works as I intended. It doesn’t screw the image. It reads the 1d array with 32-width stride each time. Say this time, there are 4 […]

Categories
Mastering Development

Reducing misses on template matching (using transparent template)

I’m trying to determine the position of puzzle piece on a puzzle image. I have an image of a puzzle piece (transparent png) an image of a puzzleboard whith a white outline around the correct position Firstly i extract the contour on image 1. and use it to draw my final template. Then i match […]

Categories
Mastering Development

convert sine-waves package examples to react component

I’m trying to use sine-waves package sine-waves package , in react app, first thing I did is looking for examples, border wave particularly and start to convert it to react component and when I tried to start the app, it gives me this error : is there a problem in canvas with react any help […]

Categories
Mastering Development

How to convert .wav file into an image for neural network?

I am trying to perform sound classification using neural network and would like to convert the audio file of 4 seconds in .wav file format to be converted to an image. I would prefer to use Librosa library. Also I would like to know how to read this image and provide it as an input […]

Categories
Mastering Development

How do I correctly render individual letters in different colors with alpha blending?

I want to draw text where each letter has a different solid color. For text like this. I can’t simply draw the text character by character, since, for example, fi and fa have different rendering for f. Some fonts have triplet rendering, where the middle character would depend on the font behind it, and the […]

Categories
Mastering Development

Space Invaders: Loading Images

I’m trying to make Space Invaders as a project, I’ve watched Tech With Tim’s video on creating it and I have done this so far. I’m planning to add a scoring system, but so far it only increases if the player ship hits the enemy ship. I’m further planning on having a final boss level, […]

Categories
Mastering Development

Organizing scripts for Multiple templates Angular

Hi every one I’m new to Angular so I had some issues ; I have 3 different templates , each one is corresponding to some componenent into my project , I put all my assets into assets folder and all the links and js scripts into index.html , but there are some scripts that are […]