game-engine

Libgdx pause/resume not called when window is being dragged (Windows)

不羁岁月 提交于 2019-12-12 08:48:46
问题 I am creating a Java game with libgdx. Really liking the engine so far but I noticed an issue when dragging the game window. Rendering seems to stop (which is okay) but I cant find any events that get called during this state. Is there any way I can trap it? It not a big deal for rendering as I cap the deltaTime, but for input the keyUp events don't get fired which messes up my movement code for the player (if you are to release the keys while dragging the window). Is there anything I can do?

Difference between using Canvas and JPanel for a 2D game engine (and Buffering?)

≯℡__Kan透↙ 提交于 2019-12-12 04:37:21
问题 I learned from various tutorials to use a Canvas on top of a JFrame to render images for a 2D Game Engine. I had to create a BufferStrategy to keep the image smooth and such, but recently I've heard using a JPanel instead to render images. Should I use JPanel? If so, do I still need to create a BufferStrategy or is it integrated. Am I just really misinformed and am I even making sense? I'm a beginner so feel free to try to correct me and guide me- I am very overwhelmed with this for some

Getting around issues with templates inside Dll in C++?

情到浓时终转凉″ 提交于 2019-12-12 03:53:33
问题 Background: I currently have a game engine project structured in visual studio so that my 'Engine' is compiled into a dll for another project 'Game' to consume. The idea being I can swap out different game projects and still use the same engine dll code. Within my engine code I'm creating my own framework for which all other engine code will use. This will help to separate my implementation from the rest of my code and make modification easier if need be. Since all my framework code with be

Diagonal win checks in Connect 4 [duplicate]

淺唱寂寞╮ 提交于 2019-12-12 03:23:53
问题 This question already has answers here : Connect 4 check for a win algorithm (5 answers) Closed 3 years ago . I am developing a Connect 4 game with 7x7 fields, horizontal and vertical checks but I dont get diagonal checks works I can win as long as one of the tokens is not in the last column. This are all checks: private static int getWinningInDiagonals() { // Top-Left -> Bottom-Right for (int column = 0; column < 7; column++) { int count = 0; for (int row = 0; row < 7; row++) { if (field[row

Creating user UI using Flixel

偶尔善良 提交于 2019-12-11 21:42:44
问题 I am new to game development but familiar with programming languages. I have started using Flixel and have a working Breakout game with score and lives. What I am trying to do is add a Start Screen before actually loading the game. I have a create function that adds all the game elements to the stage: override public function create():void // all game elements { How can I add this pre-load Start Screen ? I'm not sure if I have to add in the code to this create function or somewhere else and

My exe does not pass anything to logfile (jampded.exe) [duplicate]

拜拜、爱过 提交于 2019-12-11 21:02:03
问题 This question already has an answer here : Reading Console Buffer / Output C++ (1 answer) Closed 5 years ago . I want to create a simple handler for my game server. It will read the console directly and take any action i want. BUT! I can't pass the output from the server to my exe or txt. ping google.com > ping.log It works fine, everything will be logged in my log file. Also I created an exe, that can read the output data this way: ping google.com | my.exe It also works fine, my exe's

Cocos2d-x Background image is not displaying properly

主宰稳场 提交于 2019-12-11 18:08:26
问题 i am new to Cocos2dx 3.0 alpha and converting my game from Corona SDK to Cocos2d-x 3.0 alpha . I am displaying a background image like this. auto sprite = Sprite::create("bg.png"); sprite->setPosition(Point(visibleSize.width/2 + origin.x, visibleSize.height/2 + origin.y)); this->addChild(sprite, 0); But the image is distorted in iOS simulator. I also get these 3 warnings in console. May be 1 warning for each image, as i am displaying 3 images. libpng warning: iCCP: known incorrect sRGB

Initiating a derived class with specific variable values

本小妞迷上赌 提交于 2019-12-11 16:57:47
问题 For the below code snippet, how do I initialize instances of class Enemy with variables (such as x, y, type)? I have it working correctly, it triggers the instances no matter how many of them I insert... I just need to know the best way of creating an enemy with certain variables that will differ for each of my instances... particularly when some of those variables are in the base class and others are not. class BaseObject { public: virtual void Render() = 0; int x; int y; }; class Enemy :

Scrollable board for HTML5 GAME should use SVG's or Canvas

ぐ巨炮叔叔 提交于 2019-12-11 15:18:46
问题 I wish to create a simple webgame that involves a tiled board. I have a collection of svg's for the background of each square (i.e one for grass, one for stone, one for dirt etc). I also have svg's for items that will be displayed on the layer above the background (such as trees, wood, sword). I have an in memory database of what the background for each square is and if and which item it contains. I wish to be able to: * Zoom in or out * Scroll left or right * Scolll up or down * Have items

Is there any sophisticated role-playing game framework available? [closed]

筅森魡賤 提交于 2019-12-11 14:54:13
问题 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 4 years ago . I'm looking for a role-playing game framework which fulfills the following critera: Open source / Free for non-commercial Targeted language doesn't matter as long as it's not too obscure (C# or Java would be great) The framework doesn't have to provide any graphics, sounds or other "low level" stuff The