Box2d Android Game Programming [closed] - android

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
I want to create a physics based game by using box2d game engine.
I dont want to use any engines like cocos2d or libgdx or andengine,etc.
But only box2d.
It is a android game.
I have some doubts?.
1.Is it possible to create a game only using box2d physics engine?
No any other engine.
2.OR using android canvas with box2d?
3.OR using opengl with box2d?
4.Is box2d nice?
5.Angry birds is created by box2d. But do it only use box2d or anyother engine?.
If any of these is possible then, answer my Questions.

You can use Box2D alone in your game/app to simulate physics, but without input, drawing capabilities etc, how you will represent it on the screen and interact.
1 - You can create a project that has only box2D added to it, but you are limited to what you can achieve with it. See later answers for more insight to why.
2 - possible but why you would like to do that.
3 - every engine like libgdx, cocos2dx uses OpenGL to draw to the screen. Using raw OpenGL would mean you have pretty much recreate what those engines are doing, so you would have to write an engine pretty much. If you don't have some really innovative ways that you want to implement in to an engine, I don't see a reason what so ever apart from educating your self to create one. You would have to integrate renderer, input controllers, audio system at minimum. Most engines have been developed for years and have nice features like scene graphs.
4 - box2D is very nice, it has been one of the most commonly used 2d physics engines. There is also Chipmunk but its based on earlier version of Box2d. There is also Nape which is faster then Box2d but its only AC3 from what I know.
5. The physics in Angry Birds have been simulated using Box2d. I don't know what they used for the rest, but some sort of an engine similar to cocos2dx, libgdx etc.
My opinion you should spend a bit of time to evaluate different engines and pick one that suits you. Writing your own is quite a monstrous task. Do not underestimate how much work goes in to creating a commercially viable engine and by that I mean something that you can use to create a game. Use one of the existing ones and learn from them. There is quite a few:
Moai
Cocos2d/2dx
Love
LibGDX
Unity 3D ( bit a nightmare to work in 2d, but possible )
Haxe
Xamarin
etc. there is just to many to list them all

No, box2D can't be used "alone". You need something else to, at least, draw on the screen, interact with the user, etc. Box2D only computes the physical part of your game.
So :
1) No
2 / 3) Yes (As long as you repaint your game scene all the time, while updating Box2D)
4) I never tried other libs
5) Don't know.

Related

Python, Kivy and Android Game [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
I want to create a game for Android and want to try something new.
I really love python and want to use it for developing an Android game.
Game is not simple, it would be 3D RPG game. I found Kivy Crossplatform Framework and PyGame. I really liked both but I'm not sure if Python would be the right for me.
Is it easy to deploy python games on android?
Can Pygame handle 3D action game on android?
I don't think there is a python solution with strong 3d support at the moment, and certainly not with strong ready-rolled tools to make a complex 3d game easy.
Basic pygame doesn't really have 3d support - you can see this previous question for some specific answers, but essentially it's mostly a wrapper for the 2d sdl graphics library. Of course you can do pseudo-3d by managing all the 2d projection yourself (expect this to be slow though), and I think in principle you can directly call opengl and display the results (there are a few examples), but pygame doesn't offer much help to you there.
Kivy works by doing everything in opengl, and in principle does support access to the 3d opengl es api, including fully three dimensional vertex manipulation, as well as shaders etc.. For instance, one of its examples is a 3d rotating monkey head. However, in its current state the framework works almost entirely in 2D, there is no abstraction of apis like camera, lighting. It should be possible to add them with enough effort and there has been a little work on it recently, but it doesn't exist right now. You can do a youtube search for kivy 3d for some simple examples of 3d stuff in kivy. On the flip-side, kivy is quite powerful and easy to use for deploying python apps on android, so that part at least is covered.
So, neither of these provide all the tools you need for a complex 3d game, though I think kivy is closer. If anything, your best bet might be to integrate kivy with an external graphics library if possible. For instance, this video shows a kivy app using the pandas 3d game engine for a fully 3d interactive city model in a museum. Something like this might let you do what you want on android, but I really don't know (it's just conjecture), and even if it's technically possible there would be lots of complexity on the way like integrating the library with kivy and compiling it for android - if the latter is even possible.
I don't want to sound pessimistic, but I think none of this is an easy project. However, I also don't have a strong idea of what would be involved if just using java and an existing popular game engine, and I don't know a lot about the details of kivy's opengl potential. If you're interested I suggest asking at the kivy mailing list or irc channel - even if you get the same answer, you can probably get someone who can answer more confidently than me!
There is also Ignifuga, but it's only for 2D games.
I think you should go with javascript+HTML5 instead, there are so many libs for games dev.

Android. 2D game development [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I would like to start developing a 2D game for Android, but i haven't got the slightest clue where to start. For instance, how are the Angry Birds games developed? I'm guessing it's a 2D engine or something?
Can anyone shed some light on the matter? Anything is appreciated as i have zero ideas on where to look first.
I've used AndEngine extensively and I really like it BUT
2D games - unless you have something really, really complicated in-mind (lots of physics and collision detection), I'd recommend you consider creating them in plain old HTML (HTML5, to be specific).
Why?
Because HTML5 works pretty-much everywhere and there are some really decent toolkits for making more complex stuff (including level editors and basic physics stuff).
Moreover, you can convert HTML5 into Apps for both Android, iOS and other platforms - e.g. your game will work pretty much everywhere with minimal extra effort. Using tools like Cordova(phonegap) even allows you to access things like cameras and tilt sensors in Apps created from your HTML5 code (Dolphin Browser on Android even allows those apps to run in the browser!)
If you do want fancier stuff, Corona is pretty decent and easy to learn and cross-platform too - and Andengine is great if you're happy to be stuck on Android!
I recommend LIBGDX
http://libgdx.badlogicgames.com/index.html
Open source, java, cross-platform, good support for Open-GL, lot's of examples and a good community.
Yes, Angry Birds was developed on its own 2D engine. I recommend to look at these engines:
Corona SDK - really simple crossplatform(!) engine. Nice one to start.
AndEngine - havent any type of documentation, but there are a lot of references and useful extensions, including Multiplayer. Good community
Marmalade (AirPlay SDK) - really powerful, but complex engine. Many hits were made on it
Also you can use Unity3D with 2D extension. Its awesome engine.
Good luck with your beginnings ;)
Persnally, To Get started with your first 2D game, Don't straight away start with a Game Engine or 2D Frameworks.
Here's a Game that I developed with just the bitmap manipulation logic and a java thread to run the game.
Parachute Penguins
https://play.google.com/store/apps/details?id=com.positivesthinking.parachutepenguinsfree
Create a Java thread that serves as a game loop.
Make use of SurfaceView and manipulate bitmaps and with onClickListeners you can achieve a simple 2D game.
Go for Game Engine and Frameworks once you are comfortable with it.
I'd recommend AndEngine. They have a really good forum plus their example code is pretty much self explanatory.
If you're looking for a headstart, follow this tutorial.
Go for AndEngine!
Felgo (felgo.com) offers several tutorials for any skill level. It's a cross-platform 2D game engine.
There is already an open-source Angry Birds clone that was made with Felgo.
It also also comes with ready-to-use game templates for the most successful game genres like tower defense, platform games or puzzle games and provides reusable components for handling multiple display resolutions & aspect ratios, animations, particles, physics, multi-touch, gestures, pathfinding and more to prototype and build games within days API reference.
It is all well documented!
Try here, this helped me loads: http://www.javacodegeeks.com/2011/06/android-game-development-tutorials.html
I already answered similar question in another post: Android 2D game development without an engine
I posted a tutorial at http://www.youtube.com/watch?v=PnnHGCKrIzw
Assuming that you are familiar with Java, Eclipse (or similar compiler), Google API, etc. Here are the steps to build a full-blown 2D Android game:
Use drawable-nodpi for sprite images (gives sprite size consistency
across screen densities and sizes)
Use different layouts to support various screen sizes (e.g.
layout-large, layout-xlarge, etc...)
Use TranslateAnimation and ObjectAnimator to animate sprite movements across screen
Use math to figure out sprites collision (e.g. screen coordinates
and sprite location etc.)
Use handlers and condition statements to control the game events
You can test the outcome of following the above guide to developing a 2D Android game by checking out the game Yum Yum Pow available on Google Play. The free limited version is available also on Google Play and can be downloaded at:
https://play.google.com/store/apps/details?id=com.wildroid.yum.yum.pow.limited

Cocos vs AndEngine for android [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
I want to make a game using Tiled Map Editor and I want to move the character around using a D-Pad for moving the character
So I'm wondering which Engine would be better
AndEngine or Cocos2d
Keep in mind i'm a beginner at this so I'd like to stare at a lot of tutorials. :-D
Thanks
Both engines supprot loading TMX map quite easy and input from D-PAD. So if your requirements are only that, there is no big difference. Just use what you familiar with.
Cocos2d-android don´t have support anymore. You must use cocos2d-x, cross-plataform, use JNI to use c++ code. More info HERE.
Cocos2d-x is great to create games, but i have not use AndEngine never.
Libgdx : Java (Good documentation/Sample example)
(Android/iOs/3D support also)
Cocos2d-x : C++ (Good documentation and Sample example)
(Android/iOS/window/bada/blackbarry/etc/3D supports)
AndEngine : Java (Documentation is **OK** but bit of issue )
(Android)
Cocos2d-android : Java (bIT of documentation/ easy to use )
(Almost dead only android)
If familiar with java choose LibGdx OR cocos2d-x for C++.
I recommended that you should choose cocos2d-X
I started with Cocos2d-android as it appeared a better option , but after a while I was shocked that I could not find any tutorials for Cocos2d-android
either go the Cocos2d-x-android , or take AndEngine
I never tried Cocos2d-x-android , but I can confirm that AndEngine is pretty good and got lots of examples and enough tutorials to get you started [AndEngine lacks documentation though .. but that won't be a problem if you started with the official examples]
Edit: AndEngine is kinda dead now
There are a hell lot of bugs in AndEngine...
i had first the same dilemma of choosing one thing over other but my options include libgdx,andengine and cocos2dx...
Though libgdx is a framework but its the most powerfull of them all and you can go very deep in the code (u might create some extraordinary events)...but for a beginner like me thats a tough one as i have no experience of game programming (also the kind of easy docu given at its site allures you to use it but after a while when you want to create something of your own you are puzzled)..
But the best performance is guranteed !!
Next comes the AndEngine ..excellent work doen by Nicolas..but alas the bug count is ever rising and there are not consistent results around the devices..its one of the major drawback..you can avoid bugs but when performance is hitted hard you have no option but to leave it !!
Cocos2d-x(this is what AndEngine without bugs and good-performance would be like in the future)..
but the only drawback with cocos is the programming on not-a-mac OS...you dont have the usual code completion and tiny-miny features which are programmers essentials these days..but for performance and bug-resistent coding we have a runner-up to libgdx !!
For Android, I would highly recommend LibGDX: native, good documentation, and large community/forum.

Cross-Platform 3d-Engine to embed in iOS/Android-View? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
For my new app, I want to have a native iOS or Android UI, plus a 3d view that shows some graphs. While my initial plan to use CSS transforms in a WebView to achieve the desired 3d effect has failed because the performance was not anywhere near usable, I'm looking for another solution. Here are what I think are my options:
1. Recreate the scene in OpenGL ES
I'd recreate our graphing engine completely in OpenGL. This would certainly be possible, but probably be very hard to do for people like me who actually never did 3d programming before. Would it be possible to port OpenGL code written for iOS to Android? Or would I have to create the engine twice?
2. Use readymade 3d engine like Unity3d
I stumbled over Unity3d, Marmalade and similar tools that would probably help me create the 3d scenes more easily. However, it seems at a first glance like I would have to create the entire application in the respective authoring system. I'd to use native controls for anything except the 3d view. Is that possible in those tools? If yes, is it possible to port the 3d from iOS to Android or vice versa?
Did I ask the right questions; did I make the correct assumptions? Does anything sound wrong to you? What did I miss?
Are these all the options I have? Or is there maybe something else, a hybrid solution of some sorts?
Which option should I choose?
Edit: To clarify, I don't want to show iOS or android controls inside the 3d view, but rather around it: The user interface would be native and the 3d part would be contained inside one view.
Pretty complex one ;-)
(1) OpenGL vs. engine:
I think it would be possible to write the major part of the OpenGL code in a way that it is portable for example in C++ using Objective-C++ on iOS and NDK on Android (just an idea, never used NDK). Now it depends on the graphical part where to go. If you say graphs, do you mean you "only" need function graphs to plot on the screen? Or do you have more objects like in games or architectural apps to display in OpenGL?
If the latter is the case, the bigger problem appears to be the seamless integration of models. Every scene containing more than some cubes is designed in a modelling tool and can be exported into several formats (obj, dae, fbx, ...). But then you need to import it into your app. That's where game engines come to play regardless whether Unity, SIO2, Bork, Unreal, Oolong, ...
If you need to plot graphs, the manual OpenGL solution might be worth to consider. Although even then some research on existing engine maybe useful because OpenGL isn't that intuitive and you will need some time to make friends. I did plotting multiple graphs with zooming, coloring, ... in an iPhone app using OpenGL directly but it was a pure research project and portability was less important.
(2) Mixing OpenGL with GUI elements
Basically it's not possible to display a standard UIButton within an OpenGL view. But you can have OpenGL views and regular UI views and switch between them. I don't know of any tool that allows you doing both OpenGL based stuff and regular GUI programming and further on platform independent.
So on one hand you need to create your 3D stuff in the tool of your choice and then integrate native UI code. For Unity and iOS there some resources how to do it How to access Unity assets natively on Android or iPhone? or Mixing Unity generated code with Objective-C in iOS?
On the other hand you will need a platform independent framework to get regular GUI programming done so that you can run it on both Android and iOS. I am not familiar with this topic but I've heard from Mono based frameworks.

Android games android apps beginner question [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
as a title how to start creating android games?
Is there any sample code for android games creation , what graphic library used ?
Thanks.
There are basically two graphics systems for Android. Canvas, which is not hardware accelerated (all stuff is done by the CPU).
The more powerful and hardware accelerated alternative (if you're using it correctly) system is OpenGL. Google has done a very good work on wrapping the OpenGL system into one basic view, which is GLSurfaceView.
However, you should start looking at the Sample API demos, where the Lunar Lander demo is a great start. If you're already going hardcore and want to learn about the OpenGL system, the SpriteMethodTest is a good start, created by Chris Pruett, which also has done an open source project called Replica Island.
If you're intersted in some other resources about games, see:
Writing real time opengl-es game for android - some question (optimizing)
Android: Deciding between SurfaceView and OpenGL (GLSurfaceView)
Game Development for Android: A Quick Primer
Google I/O 2009 - Writing Real-Time Games for Android
Google I/O 2010 - Writing real-time games for Android redux
Android graphics overview: http://developer.android.com/guide/topics/graphics/index.html
3d graphics intro: http://developer.android.com/guide/topics/graphics/opengl.html
2d graphics intro: http://developer.android.com/guide/topics/graphics/2d-graphics.html
As for general gaming development, you should read up on fundamentals before trying to make games on it. It is quite different to program on mobile platforms.
http://developer.android.com/guide/topics/fundamentals.html
A couple game examples:
JetBoy: http://developer.android.com/resources/samples/JetBoy/index.html
LunarLander: http://developer.android.com/resources/samples/LunarLander/index.html
Snake: http://developer.android.com/resources/samples/Snake/index.html
It's kind of a vague question, since there is everything from word games to first-person shooter games. Have you looked at the Lunar Lander sample project?
You can use the Canvas provided by the method onDraw of an View to draw 2D graphics. Sometimes it's enough for an game.
You can also use OpenGL ES to hardware accelerated drawing.
It sounds to me like you're looking for something more like App Inventor which abstracts a ton of programming for the creator at the cost of flexibility.
Well... I was also very keen to making android games as a hobbist.... as I proceed with my research... I found that there are many nice open frameworks available for this purpose, I highly recommend LibGDX for making android games. This is mostly java based but ports your game for Desktop, Android as well as iOS.

Categories

Resources