game-development

Phaser3 Scenes transitions

别说谁变了你拦得住时间么 提交于 2020-01-14 10:14:23
问题 I'm new to Phaser3 and before starting a crazy project, I want to know how I should start, switch between scenes. I saw that there are several functions, start, launch, switch, run, resume, pause, etc... Example, lets say I want to have 2 scenes, a Menu and a Game. I boot on the Menu and I want to go to the Game scene and if I click on a button then come back to the Menu scene. I've achieved this by calling the start function, but I noticed that the all, init , preload and create functions

Phaser3 Scenes transitions

自闭症网瘾萝莉.ら 提交于 2020-01-14 10:13:52
问题 I'm new to Phaser3 and before starting a crazy project, I want to know how I should start, switch between scenes. I saw that there are several functions, start, launch, switch, run, resume, pause, etc... Example, lets say I want to have 2 scenes, a Menu and a Game. I boot on the Menu and I want to go to the Game scene and if I click on a button then come back to the Menu scene. I've achieved this by calling the start function, but I noticed that the all, init , preload and create functions

Camera does not follow player

时间秒杀一切 提交于 2020-01-05 08:42:35
问题 I use libgdx have one player which moves in x direction from left to right. Now I want the camera to follow it (like in Flappy Bird for example). What happen is that the player go out off screen when it reaches the right border of screen and the camera don't follow him. I have tried following options but none of them worked: camera.position.set(player.getX(), camera.position.y, 0); camera.position.set(player.getX(), 0, 0); Vector3 vector3= camera.unproject(new Vector3(player.getX(), 0f, 0f));

Flow Free Like Random Level Generation with only one possible solution?

旧巷老猫 提交于 2020-01-03 17:47:36
问题 I've implemented the algorithms marked as the correct answer in this question: What to use for flow free-like game random level creation? However, using that method will create boards that may have multiple solutions. I was wondering if there is any simple restrictions or modification that can be made to the algorithm to make sure that there is only one possible solution? 回答1: Creating unique Numberlink/Flow Free is very difficult. If you look at my algorithm proposal in the mentioned thread,

Implementing BFS in Java

我的未来我决定 提交于 2020-01-01 09:14:08
问题 I am a beginner in Java, and I need some help. I am trying to implement Breadth First Search algorithm to solve a puzzle game (Unblock Me a game on Android). I am done with the GUI, but I am stuck with the algorithm. So far I can count the available moves of each block, which supposed to be the children nodes of the root node. Each node (linkedlist) has the position of each block, and all the nodes are being stored in a Set. What I need now is to mark each node as visited, so I don't get into

Can't flip direction of ball without messing up gravity

别等时光非礼了梦想. 提交于 2019-12-29 02:12:09
问题 I am making a game like pong except that there is only one paddle and the ball moves in projectile motion. The goal is to keep the ball bouncing on your paddle for as long as possible. I when I have the ball hit the paddle the direction of the y component of the velocity has it's sign flipped. The issue with this is that when the ball is moving up gravity acts upon in in that direction, speeding it up. The code is below This is the code for my ball class, this is the tick method which is

Can't flip direction of ball without messing up gravity

你说的曾经没有我的故事 提交于 2019-12-29 02:12:07
问题 I am making a game like pong except that there is only one paddle and the ball moves in projectile motion. The goal is to keep the ball bouncing on your paddle for as long as possible. I when I have the ball hit the paddle the direction of the y component of the velocity has it's sign flipped. The issue with this is that when the ball is moving up gravity acts upon in in that direction, speeding it up. The code is below This is the code for my ball class, this is the tick method which is

Referencing a object that is on the stage inside a class?

最后都变了- 提交于 2019-12-25 04:15:07
问题 So I had the issue with ENTER FRAME so I moved it to a separate class and this is what the class looks like package { import flash.display.MovieClip; import flash.events.Event; import flash.accessibility.Accessibility; import flash.display.DisplayObject; import flash.display.Stage; public class enemy extends MovieClip { public function enemy() { // constructor code this.addEventListener(Event.ENTER_FRAME, moveEnemy); } public function moveEnemy(e:Event):void{ this.x += 5; if(stage.player

increase game speed and keep same distance between nodes

北城余情 提交于 2019-12-24 19:47:15
问题 I am working on a game where I have two functions . The first function is used to create a row of obstacles. The gameSpeed variable is used to decide how frequently a new row of obstacles is added. Example : if I set gameSpeed to 3 then a new obstacle row is added every 3 seconds. func addobstalce() { lastYieldTimeInterval += timeSinceLastUpdate if lastYieldTimeInterval > gameSpeed { lastYieldTimeInterval = 0 nextRow(cR: currentRow) } } and the second function is used to add movement to them.

How to automatically close App_A when I close App_B using batchfile

帅比萌擦擦* 提交于 2019-12-24 19:16:13
问题 Hi everyone I'm a newbie in batchfiling but loved tinkering and coding every other time. Can I make a batch file that closes two program simultaneously? Example, I created a batchfile that opens two program, App_A (gamepad imulator) is minimized App_B (offline RPG Game) normal window. What I want is when I close App_B App_A would automatically close too so that I don't have to restore the window and manually close the imulator. this is the code I just did which I also found in this site and