I was working on game using andengine ,I'm struck with the loading screen.Each time when I press my menu items It takes some time to load the next activity, meanwhile a black screen appears,so can anyone please help me in setting a screen with loading text instead of getting black screen.
I have searched on it and came to know that while game starts a loading page or splash screen is set to load all the resources background to avoid black screen,so please suggest me any possible ways to avoid that issue.
The key is to not break your application up into a set of activities as you would with a traditional android app. Instead, break your game up into a series of scenes.
Create a manager class to load and unload the scenes and textures for each scene.
As an added bonus, you will be able to animate the transition between menus and scenes.
If you need a detailed breakdown of how to implement this, take a look at the book:
AndEngine for Android Game Development Cookbook
Creating a surface view, and loading the textures for that view are slow costly operations. Each time you create a base game activity, you are creating and destroying your entire SurfaceView and all of the textures. For the best user expereince, you will want to avoid this at all costs.
Related
I have created a simple Unity AR Foundation app which places objects on a plane whenever the screen is touched. I would like to add some UI so the user can press a button rather than anywhere on the screen.
I have followed several different tutorials which seem to be doing mostly the same thing. I right-click the Hierarchy -> UI -> Button. I have scaled it so it should fit my mobile screen and anchored it to the center so it should be easy enough to find.
These are the canvas settings:
Might the UI somehow be hidden behind the camera feed from the AR Session Origin -> AR Camera? Am I missing any steps to anchor the UI to the screen?
As you can probably tell, I am very new to Unity but I feel like I have followed the tutorials for creating a UI, but it simply won't show. If you need more information, please just ask and I will provide.
Not sure but sounds like you might need to have that Canvas Scalar to scale with the screen size. Change the UI scale mode to Scale with Screen Size.
I was compiling the wrong scene. I had two very similar scenes, so when I compiled I didn't realize there were no changes and that I was inspecting the entirely wrong scene.
Once I changed to the correct scene the setup above worked as expected.
I have one little problem, maybe wrong approach. I created an ipad app (swift4) with SCNView, it works great, all transformations, lights, gestures... But I would like to display this scene on an external screen, connected by air play, not just to duplicate what i see on ipad. The SCNView is in UIView with another ui elements, that i don't want to display on external screen. How to get it work with smooth transformations on both screens? I have tried to clone scene nodes, but it did't work (maybe wrong code), another solution was to create new SCNView and load new scene, but then i don't know how to detect gestures to get the same transformations as on the main ipad display, and i think it costs more gpu calculations. Last solution was to snapshot the view and on an external screen display just the image, but again, i don't know how to listen to gestures or camera movements and make it smooth. Do you have few minutes to write me an example with the solution? With proper way, listeners on SCNView or different approach? I will be very grateful to you!
If you don't want to use AirPlay you may try ReplayKit. It allows you to stream your screen content and you can create TV app that will display it.
I may don't have the solution but I think is very possible to setup Airplay just for stream what you want, hidding UI elements.
Duplication or buffering frames to video seems such expensive approach but not that crazy... just check how ARKit does it.
I want to make an endless vertical scrolling layer that gives the impression that the main character is moving upwards. I have been brainstorming on how to achieve this.
My issue is that I want objects to appear as if they are coming from above and below the screen at the same time. Secondly, I want to be able to move the main character to create and destroy box2d joints between it and some of the objects appearing on the screen. What is the best way to achieve this with consuming too much memory? I would appreciate any help on this.
Apple did a wonderful tutorial of this in a WWDC 2011 video session. It was "UITableView Changes, Tips & Tricks" and it's about 35m40sec into the video.
Since the use of the UITableView is really just a UIScrollView for the purposes of the background, you could just use a UIScrollView and you can either have it move on timer or events as needed.
Think of your player as moving within a stationary bounding box. The background can scroll using the aforementioned pooling method (as the background tile scrolls off the screen it is placed into a pool, and before a new tile is instantiated the pool is checked for available reusable tiles). Thirdly, your enemy objects will simply approach from either the bottom of the screen or the top.
Imagine your idea without the scrolling background (flying effect) and you should find that the problem is relatively straightforward.
I also needed and endless scrolling background layer. This can do exactly that, and it is super simple to set up and use. Just copy the four files in to the cocos2d folder in your project, then follow the quick tutorial seen on the github. Make sure the image you use is seamless (when you line them up vertically you can't tell where one ends.
I am in process of creating a multiplayer game similar to the Scrabble / Wordfued / Rummi. I am trying to see what would be best way go about implementing the UI and their interactions.
I would be having a framework which would keep track of all the pieces on the board and the AI for knowing if it is a valid move.
I am trying to figure out what could be best solution to handle the UI part. The game board would be larger than would the current iPhone screen could support. So the board would have an effect of a scroll view. The same goes for the game tiles using which user can play. These are not fixed amount of tiles/cards and the same could be more in numbers which would also need another scroll view kind of effect.
There would be many more effect's were the user can move a complete set of tiles/cards from the board and place it in another location of the board. Or even a tile in between the set of tiles on the board.
So I am trying so see if I should go with two scroll view provided by iOS and handle all the detaching the tile/card from one scroll view and placing the same in GameBoard scroll view
Or
Should I go with something like cocos-2d which provides more advance game UI handling capabilities.
Please do let me know your thoughts and feedback on what could be the best choice for the same. Thanks in advance for all your help.
Words With Friends uses native UIKit views. It is quite simple and uses a transition to move between the two degrees of magnification (close up and not close up).
You can do everything quickly in UIKit with a UIScrollview. You can use drag events to move tiles around the screen, even changing their perspective/look during dragging. Using UIAnimation would allow you to do simple frame based animation for things like dropping a tile.
Cocos2d will be quicker if you already know a similar gaming library. However if you choose it you you'll miss out on using Interface Builder and a lot of conveniences in UIKit.
If you're starting from a base of zero with either approach, then only use Cocos2d if you want particle effects (like stars and sparkles, UIKit has nothing for this).
Otherwise I'd say try UIKit, it's easier and there are more resources on the web.
Guys. I'm writing a scrolling shooter game that has a very large Background image chopped up into smaller images to make it more manageable. Right now it is setup so when the GameNode is init'd. A big long list of Images are added to the ParallaxNode and it is added to the Game.
I thought I might save a lot of memory if I only kept one or two loaded into memory and swap them out as the Hero Character moves through the level. The problem is I can't seem to create a parallax background in another method that's called later. No errors it just doesn't show and seems to be the same code. Any Ideas?
Well I created the parallax layer having four layers in it and added it to the level layer which is extending from GameNode.
If you can post some code, that may help.