scene

Why does a scene take a scene manager as a parameter?

时光毁灭记忆、已成空白 提交于 2019-12-12 04:25:16
问题 I'm having problems understanding a game scene manager (FSM) in pygame that I try to replicate from this website: https://nicolasivanhoe.wordpress.com/2014/03/10/game-scene-manager-in-python-pygame/ I'll copy the code: # -*- encoding: utf-8 -*- # Modules import pygame, sys class Director: """Represents the main object of the game. The Director object keeps the game on, and takes care of updating it, drawing it and propagate events. This object must be used with Scene objects that are defined

Completely remove scene in AndEngine

老子叫甜甜 提交于 2019-12-12 01:26:06
问题 To switch between levels in my game I recreate my GameScene, but but when I switch levels about 3 or 4 times I get an errno 12 out of memory error. I need to be able to somehow delete the whole scene and stop it from running in the background. Is there a way to do this so I don't run out of memory? EDIT: This is my method in which I load the new scene. public void loadGameScene(final Engine mEngine, final SharedPreferences sp, final String map) { setScene(loadingScene); ResourcesManager

Reload and display blank JavaFX BarChart after launching the program

[亡魂溺海] 提交于 2019-12-11 18:41:40
问题 I'm working on a JavaFX program that can display different grocery items as a BarChart. My code structure uses an initial loading class, GroceryGrapher.java , a controller, GroceryGrapherController.java , and an .fxml file, GroceryGrapher.fxml . I'm relatively new to JavaFX and I've tried different approaches to creating and displaying my BarChart . For the most part I've resolved issues and can load the chart with its data and components, but my issue is that the chart won't display / update

Remove a group from scene

爱⌒轻易说出口 提交于 2019-12-11 10:49:43
问题 I´m using Three.js, and I created a group of meshes and inside another group pgrupo= new Array (); fgrupo=new Array (); scene.add(pgrupo[0]) pgrupo[0].add(fgrupo[0]): pgrupo[0].add(fgrupo[1]): How can I remove a fgroup from the scene? if I use: scene.remove(fgrupo[0]); or scene.remove(pgrupo[0]); Nothing happened. How can I delete this things from the scene? 回答1: Instead of using an Array use the THREE.Object3D and the .add() and .remove() methods. So pgrupo = new THREE.Object3D(); fgrupo = =

Unity not loading project properly

十年热恋 提交于 2019-12-11 10:47:57
问题 Me and some of my mates work together on a project in Unity. When I try to load the project, one of them gave to me (via Dropbox or USB-Stick, doesn't matter), I keep seeing the empty Hierarchy-window (I don't even see a main camera), although he created some objects in the scene. The scene is definetly loaded in the editor, the name of the scene is shown at the top of the editor. I am not even able to instantiate a prefab in that scene, prefabs from the project are shown with a grey file

cocos2d start / stop running Scene

馋奶兔 提交于 2019-12-11 07:48:15
问题 I'm trying to load one scene. This runs fine the first time, but when I try to reload again appears a white square where the animation is placed. This is the code to start and stop the scene. What I'm missing? thanks. -(void)runScene:(OTAnimationCC2d *)animation { scene = [CCScene node]; [scene addChild:animation]; if ([[[CCDirector sharedDirector] runningScene] isRunning]) { [[CCDirector sharedDirector] replaceScene:scene]; } else { [[CCDirector sharedDirector] runWithScene:scene]; } } -

Change javafx background from a function

一世执手 提交于 2019-12-11 06:04:23
问题 I would like to change the scene background from another function besides the void start, something like the following; the code below however does not change the image, I guess I am missing something like the below 2 lines in the thread... scene.setRoot(Mainpane); stage.show(); Code: @Override public void init() throws IOException { new Thread(() -> { System.out.println(" ... Prayer Detection Starting....."); for (;;) { try { DatagramSocket socket = new DatagramSocket(8888, InetAddress

How to use one object selected from previous scene to the current scene?

梦想的初衷 提交于 2019-12-11 04:07:58
问题 I am working on a FPS game. I which my first scene in Main menu scene. Which is fine. In the second scene user is selecting the gun which he want to use (There are four guns). When he press play i am loading the new scene(gamePlay). How can i keep track of the gun which the user selected? so, he can use that gun in the gamePlay? its easy when you are working in a single scene by switching your camera. But how to do it in the new scene? 回答1: This is how I have been doing and it works really

How to destroy a game object marked “DontDestroyOnLoad” when a new scene loads?

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-11 03:48:15
问题 So I created a music player to play music through all my menu and story scenes without interrupting, but then in my game scene I want to delete that music. How can destroy the playing music when my game scene loads? Here is my music script: #pragma strict var offsetY : float = 40; var sizeX : float = 100; var sizeY : float = 40; var musicPrefab : Transform; function Start () { if (!GameObject.FindGameObjectWithTag("MM")) { var mManager = Instantiate (musicPrefab, transform.position,

javafx scene builder 2 is not launching

房东的猫 提交于 2019-12-10 23:16:42
问题 I was using javafx scene builder just fine few weeks ago. but from yesterday it wont even launch. No error message or anything. just wont work. I tried reinstalling, removing recently installed applications (such as daemon tools etc). Still no luck. Can anyone help me? I'm using windows 7 64 bit OS. Thanks 来源: https://stackoverflow.com/questions/26497006/javafx-scene-builder-2-is-not-launching