Categories
Mastering Development

Fast way to remove array of specific row values from 2D numpy array

I have a 2D array like this: a = np.array([[25, 83, 18, 71], [75, 7, 0, 85], [25, 83, 18, 71], [25, 83, 18, 71], [75, 48, 8, 43], [ 7, 47, 96, 94], [ 7, 47, 96, 94], [56, 75, 50, 0], [19, 49, 92, 57], [52, 93, 58, 9]]) and I want to […]

Categories
Mastering Development

How to make gravity function in pygame?

Unable to move player in pygame So, I was trying to create a simple physics system in pygame. My main goal was to add a Y gravity function that would move the player when activated. I have tried several times to make it work, but I guess I am missing something. Here is the code: […]

Categories
Development

Canvas problem whe i open file by index.html

`So, I’m confused. when I open this project by running a live server everything is good, but when I open this using index.html file it shows a lot of errors. What’s the problem? const heartCanvas = document.querySelector(“.gameField .heart canvas”); const heartContx = heartCanvas.getContext(“2d”); //canvas size heartCanvas.width = 1000; heartCanvas.height = 500; const heartCanvasHeight = heartCanvas.height; […]

Categories
C++ Development

C++ Win32 loading multiple bitmaps in WM_CREATE won’t load

I am trying to load some bitmaps when starting up the application. I am trying to load them in WM_CREATE but only the last bitmap i load will stay loaded. I can load the pictures in WM_PAINT but i have been told it’s better to load them in WM_CREATE. //before switch statement static HBITMAP bitmap1, […]