When the game changes levels I have a method that loads a new background and also changes several global properties of the SKScene ie enemy speed etc. Problem is when I redraw the background in a new level it covers all other nodes (created in initWithSize) . Is there a work around or a better approach redrawing the background?
Placing background node covers all other nodes level transition
172 views Asked by dancingbush At
1
There are 1 answers
Related Questions in SPRITE-KIT
- Label not showing on Tutorial SKScene
- How to create a mini-map of a SpriteKit scene using a different camera position
- Get name of SKTextureatlas
- Determine whether player character is at rest on static node
- How to detect the location of a mouseDown event for a iOS App using Swift?
- Update node's physicsbody with texture animation?
- How to detect touch inputs in SKScene on watchOS SpriteKit?
- Get actual size of applied texture to physicsBody?
- Changing a texture on a custom spritenode class drops the framerate, but only the first time?
- Swift Playground does not find SpriteKit particle file
- Why is SKTextureAtlas(dictionary:) Crashing
- SpriteKit animations freeze in second window on second display on Apple Silicon
- How to prevent SpriteKit overlay in SceneKit to get all key down events
- How can I Wrap a SKScene around a SCNNode as its texture?
- Prevent SpriteKit Metal Renderer from Exceeding Texture Size limit
Related Questions in BACKGROUND-POSITION
- Why background-position with a percentage value does not move the background?
- Background-image not taking full width on resizing
- Background position tied to scroll only running once
- Offset Background Image
- Want to move icon on hover from left to right with the background color
- Safari 16.3 (Ventura): background-position is incorrect when browser is zoomed
- The location of an background image appears not centered when publishing my Website
- Using jQuery to add extra/subtract to background position value based on mouse movement
- CSS background position starting from given pixels on top?
- How to get a seamless parallax effect using svg as a background and not reset the animation?
- Calc for a Background-Position when a Calc is used for Width and Height
- Why is there an offset in the background position of an image?
- moving background image back to initial position with jquery
- How to make a CSS Shimmer Effect on Image?
- CSS background-size and background-position
Related Questions in SKSCENE
- What is the best way to evenly spread a longitudinal line of SKSpriteNodes across the SKScene width?
- How to transitions between scenes using SpriteView in SwiftUI?
- How to determine size of SCNPlane to cover entire SKScene
- Frame drop when presenting a new scene in SpriteKit
- AdMob Banner Ad won't display in Swift SpriteKit game
- SKScene's update function appears to not work
- Neither adding a SKShapeNode nor adding a SKLabelNode to a SKScene appears to work?
- Adding a Mac trackpad scroll gesture to a SKScene
- How do I eliminate SKScene.scaleMode = .aspectFit cutting off on all 4 sides with rotation?
- My SKScene will show sized correctly in the Simulator, before rotation, but not after?
- How to create a 'snow that's pile up' effect in SwiftUI
- SpriteKit simulation step stutter
- How to detect two simultaneous touches in xcode spritekit?
- Listening for click/touch events in SKScene on MacOS in a SwiftUI SpriteView
- How to pass in parameters to SKScene Class and then present the scene, within SpriteKit
Related Questions in LEVELS
- Cant see object when cloning in new level
- Factor() to order data not working after specifying separate scale for each group
- Replace specific levels of a row with NA, based on conditions across ALL factor columns of a data frame
- R stacked bar plot with ordered columns and column elements
- Maintaining Factor Order in ggplot
- Keeping unused levels in ggplot2 bar plot does not work properly
- Nesting one factor within another in ggplot figures
- Summarizing factor counts by other variables in R
- reorder factor levels manually using indices with tidyverse
- Do large amount of scenes cause performance issues in unity?
- Sum of payments in date range, sum tested against ladder of 9 levels, adding to a count for each level
- Testing lines in last candle crossing
- The issue is that it should show the price values (coordinates) from which the line comes on a price scale, not on a graph! How to fix it?
- OpenCV and color levels
- How to get the level of a docx heading in Python?
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
If I understand what you are saying you have a level which has a background node and other nodes that are displayed during the level. When you change levels, you add a new background, presumably as a child of SKScene, correct?
If this is the case, that is why it covers everything. By adding it later onto the node tree, it gets drawn last, and hence covers everything.
There are a few ways you can handle this:
-Have a different scene per level. This way each scene is self contained and will not interfere with the other scene's contents.
-removeAllChildren on the SKScene, and then add your background and anything else you need for the new level.
-If you really wanted to, you could just replace the texture for the original background with the newer background. But if you do this, you still potentially need to clean up old nodes.
Having a different scene is probably the better option out of the bunch.