game-engine

How can I use different images for my snake's body parts in my snake game? (Python, Pygame, Snake)

谁都会走 提交于 2020-05-13 10:55:13
问题 Explanation I am currently working on a snake game with Pygame but I have a problem because my snake currently consists only of squares but I would find it better if the snake contained a drawn 25x25 picture for the snake head, the body, the tail and for a bent body part so that when the snake changes its height and direction, this part still looks connected to the snake. I have also added a sample image so that you can better understand what I mean by the diffrent body parts. This is the

How can I use different images for my snake's body parts in my snake game? (Python, Pygame, Snake)

拥有回忆 提交于 2020-05-13 10:54:00
问题 Explanation I am currently working on a snake game with Pygame but I have a problem because my snake currently consists only of squares but I would find it better if the snake contained a drawn 25x25 picture for the snake head, the body, the tail and for a bent body part so that when the snake changes its height and direction, this part still looks connected to the snake. I have also added a sample image so that you can better understand what I mean by the diffrent body parts. This is the

Pixels Array Too CPU Intensive

断了今生、忘了曾经 提交于 2020-01-24 18:57:46
问题 I have been working on a Java 2D game for a little while. It is a raster graphics system with an array of pixels (integers). private BufferedImage image = new BufferedImage(WIDTH, HEIGHT, BufferedImage.TYPE_INT_RGB); private int[] pixels = ((DataBufferInt) image.getRaster().getDataBuffer()).getData(); I then create an array of integers separately, manipulate it with the screen objects (rendered from external image files, such as .png), then copy that array into my main one, which is projected

D3D11CreateDeviceAndSwapChain(…) was not declared in this scope

时光怂恿深爱的人放手 提交于 2020-01-17 14:42:49
问题 I am trying to make a simple Engine using c++ and DirectX 11. I am using Geany. This makes things worse for me because linking the d311 library was difficult, but I have to use it for 2 reasons: I want to make it without any IDE help, more to-root possible, and Because we use it at school. While I was following some tutorials and books I got stuck because my IDE doesn't recognize the method. How can I solve that? Update:i found out that the D310CreateDeviceAnsSwapChain(..) works but Idk what

Creating 2d platforms using JavaScript

会有一股神秘感。 提交于 2020-01-14 04:37:07
问题 I'm developing a HTML5 Canvas game using EaselJS and I've written a function that allows me to create "blocks" just by setting one or more images, size and position. and by "blocks", what I mean is: I'm doing this using two methods: First method: With this method the blocks are created in the available space inside the location I've set, using the images randomly. Second method: The blocks are created inside the location I've set using specific images for the top left corner, top side, top

Slick2D game speed changing

爱⌒轻易说出口 提交于 2020-01-14 03:34:11
问题 I created a game using Swing, and it was a bit unreliable, so I started remaking it using Slick2D game engine and I have encountered issues. The background of the game rolls across the screen at a certain about of pixels each time the update method is called. This keeps speeding up and slowing down, so the background will move very fast, and then very slow, and keeps fluctuating. I have tried * by delta (which monitors the refresh rate, I think!) on my value which moves the background, but as

What is the optimal render loop in Dart 2?

廉价感情. 提交于 2020-01-13 20:35:08
问题 I am looking for ideas regarding an optimal/minimal structure for the inner render loop in Dart 2, for a 2d game (if that part matters). Clarification / Explanation: Every framework / language has an efficient way to: 1) Deal with time. 2) Render to the screen (via memory, a canvas, an image, or whatever). For an example, here is someone that answered this for the C# language. Being new to Flutter / Dart, my first attempt (below), is failing to work and as of right now, I can not tell where

Resource on making a point and click game (no flash) [closed]

↘锁芯ラ 提交于 2020-01-12 04:04:14
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 6 years ago . I have played many Point and Click adventure game (Broken Sword, Sam & Max, Dott, Indiana Jones, etc ...). I wanted to understand how to create such games. There are not much resources apart from Flash games which don't like much. It can be just theory or specifically platform oriented tutorials. My preference

libgdx changing sprite color while hurt

不羁的心 提交于 2020-01-11 12:32:07
问题 I am using libgdx to make a little platformer and I would like to make the enemies blink in red while the player hurt them with his weapon. I already tried to change the sprite color and the sprite batch color with no success, it only melt the new color with the one of the texture. sprite.setColor(Color.RED); spriteBatch.draw(sprite); the effect I want to achieve is: going from sprite texture to full red and then back again. I think there is something to do with the Blending function, but I

Investigation of optimal sleep time calculation in game loop

此生再无相见时 提交于 2020-01-09 09:02:43
问题 When programming animations and little games I've come to know the incredible importance of Thread.sleep(n); I rely on this method to tell the operating system when my application won't need any CPU, and using this making my program progress in a predictable speed. My problem is that the JRE uses different methods of implementation of this functionality on different operating systems. On UNIX-based (or influenced) OS:es such as Ubuntu and OS X, the underlying JRE implementation uses a well