Hot answers tagged

8

Am I hurting myself by learning C++ before... No, C++ is a good way to learn about all the basics of programming, including Object Oriented programming, and memory management which might be handled for you in other languages. There's got to be a reason the university requires C++ It is an industry standard across the world. It is quite portable as there ...


8

It is against the Apple and Mac OS terms of agreement to install Mac OS on anything aside from an Apple authorized machine. You are in breach of your user agreement by doing even that. So app-store stuff aside - you are in legal hot water. However! Pushing that aside, I'd like to note at least one game has been published with a similar method as the one you ...


7

You're not hurting yourself because you're doing what is required by your school. Learning to program is only partially about learning the syntax of a specific language (and it's a small part!). Right now you're learning to think logically and like a programmer. Don't worry about learning things you don't need, because it's all useful in some way.


7

Xcode can indeed be used to create games. You can do anything a Mac/iOS device is capable of by programming in Xcode. I think you should focus on what part of the project you want to focus on. As you state you are a brand new Objective-C programmer (welcome). In my opinion it would be quite a mouth full to try and just into Objective-C programming whilst ...


6

If you'd like to learn Objective-C, I suggest you have a look at cocos2d. It's an open-source 2d engine (written in Objective-C) that allows you to write games for iOS or Mac OS using XCode. It's not as easy to create games with as with a package like Unity, but there are lots of tutorials (and even books) for cocos2d to be found. A good place to start ...


5

I actually found a simple solution! Changed the character objects to not only include info and sprite, but also a CGPath. Then implemented a method, to loop all character objects, and check for CGPathContainsPoint( params ...) instead for CGRectContainsPoint( params ...) Tutorial I used: http://www.youtube.com/watch?v=HxHZwzaadNQ - "The magic of ...


5

Absolutely! XCode is the standard programming IDE for the Mac and iOS. So if your goal is making a game for iOS, you will probably be using XCode along with a few other helping technologies of your choice (e.g. OpenGL ES 2.0). But since you mentioned game engines I'd also recommend you to use one, since they'll save you a lot of time and effort: If you ...


4

NVIDIA's Cg Toolkit should be able to compile (or translate) shaders offline and spit errors. Another option is to create a tiny executable yourself that takes in a shader file and tries to compile it with your GPU driver's compiler (or perhaps such a compiler is already provided for you by the vendor). Though I think at least in the latter cases many ...


4

This is a pretty late reply, but some new options have shown up recently to address this. Khronos released a reference compiler called glslangValidator that can perform syntax validation (and more) on GLSL shader files. If there are any issues with your shader, it will print them out with line number information. You can set up a custom pre build step or ...


4

This is a very interesting topic. You can build the water effect using SpriteKit and its integrated physics engine. Step 1 Create a Physics World Create many little circular SKSpriteNode(s), each one will have a circular physics body matching the graphics representation Step 2 Then every frame you'll need to: Draw all the sprites on a buffer Apply a ...


3

To get the complete bounding rectangle of a node and its child nodes you use the calculateAccumulatedFrame method. It's a member of SKNode. I ran into this when adding my SKSpriteNodes to separate SKNodes as layers for parallax and HUD elements. I kept getting (0,0) width/height for my bounding rect on the SKNode, and I found this. It returns a CGRect, and ...


3

Wrapping the SKEmitterNode in an SKEffectNode allows the EmitterNode to be rendered into a framebuffer which is subsequently rendered onto the screen. I tested this out (after much push and pull of different nodes and scenes and views) and this results in the exact effect you want, where the Add blend mode is applied to a background that is not rendered ...


3

No, if you are referring to writing Objective-C using the Cocos2D framework to do animations, your animator will not be able to do so without xCode. He could write the code in a text file and pass that to you, but will not be able to compile them to check that they do work (which really defeats the purpose I suppose.) However, if you only need sprite ...


3

I'm unfamiliar with objective C, so I can't give any specific code. But the general way to accomplish things like this is by doing a per pixel collision check. Basically it works just like how you have it based on the rectangle, but before firing the touch event, you have to loop through all the pixels that were touched and make sure at least one of them ...


2

Remember that SpriteKit's physics system is based on "SKPhysicsBody"s, which are added to "SKSpriteNode"s. Those physics bodies, however, needn't be attached to visible nodes. The simplest method is to create a SpriteNode with no actual sprite or visible body, add it as a child to the area you want on the visible shape, and categorize it differently from ...


2

Objective-C is but one of many languages you can learn to use for iOS programming. Not only are you completely free to write C and C++ code on iOS (with some caveats), Apple also supports a language called Objective-C++, which is exactly what it sounds like. While you do not need to use Objective-C to program your core application, the Apple APIs are all ...


2

C++ is where almost every new programmer learn about object-oriented designs first (at least in my area, it's true). So you are not hurting yourself. Also you can develop iOS (even Android )apps in C++. If you are thinking to go into game-development, C++ is the de-facto language here, supported by most of the game-engines. So learning C++ is always a ...


2

I dont know the version of the sdk you are using, but in the latest version Game Center now support multiplayer games, witch means now Game Center can handle all data exchange. Take a look at this tutorial: How To Make A Simple Multiplayer Game with Game Center Tutorial: Part 1/2


2

Do as ryrich said, however the actual code on Objective-C would be something like this: (Assuming your CCNode class is called "Seal") int sealCounter = 0; for (id *node in self.children) { if ([node isKindOfClass:[Seal class]]) { sealCounter++; } }


2

Build your own level editor - it's the conclusion I came to after having developed several games. A simple editor would involve creating some simple buttons (the items in the levels) and some simple logic for positioning, rotating and scaling them on stage. After you have all the items in a level just push their details (position, type, etc) to an/or several ...


2

You may want to modify the collisionBitMask property of your SKPhysicsBodies. You can set a bitmask to make collision rules. Objects that shares a same bit collides together. Since collisionBitMask is a UInt32, you can set up to 32 different layers of collision. Set your projectiles in different layers depending on who launched the projectile. Here's an ...


2

I think your problem is not program but staff. You need a Beta tester to give you comment on what to pike down or buff up. If your character has certain unique skill it can also contribute or harm the player. Also note on some games, it's not actually possible to kill high level monster without a bit of team play. You can also apply randomness on range ...


2

One simple options is to just draw everything twice. Consider a screenful of your background clouds and other stuff that you want to scroll: +------+ | CC | | RR| +------+ (Assume that CC represents a cloud, and maybe RR represents a rock or some other background object.) If you have a "second copy" (logically or physically) of this background ...


2

The answer at https://answers.unrealengine.com/questions/274013/fresh-install-new-c-third-person-project-doesnt-co.html suggests that you are using a version of OSX or XCode that is not currently supported by Unreal Engine. I don't know the version you are using, but you should check the UE documentation and make sure you have the correct versions. ...


1

Right now I'm not in a place to go over your code thoroughly, but at a glance I'm wondering if you need to declare your code with C linkage as explained here: extern "C" { float FooPluginFunction(); }


1

The trick is to use the CCScrollViewDelegate methods to detect scroll events. Add a CCLabelTTF and call it _pageLabel. In Xcode, make the scene containing your scroll view adhere to the CCScrollViewDelegate : @interface myScene : CCNode <CCScrollViewDelegate> Then, in didLoadFromCCB, set the scroll view delegate to self : _scrollView.delegate = ...


1

just use gameCenterController for dismissing. [gameCenterController dismissViewControllerAnimated:YES completion:nil];


1

It seems that Unity 4.1 changed the trampoline project pretty significantly. There must be a plugin or something that your older project is using that is referencing that old file and needs to be updated to Unity 4.1.


1

This is only a guess, but as far as I know you should include SDL as <SDL.h>. As I can see that you include SDL as <SDL/SDL.h> and SDL Mixer as "SDL_mixer.h", the problem is that the header of SDL_mixer.h includes <SDL_types.h>, but in your case it would have to be <SDL/SDL_types.h>. You should either extend the include search path ...


1

Found the answer: it was the Normals: GLfloat norms[36] = { 0, -1, 0, 0, -1, 0, 0, -1, 0, 1, 0.25, -0.5, 1, 0.25, -0.5, 1, 0.25, -0.5, -1, 0.25, -0.5, -1, 0.25, -0.5, -1, 0.25, -0.5, 0, 0.5, 1, 0, 0.5, 1, 0, 0.5, 1 }; These are the correct ones. For some reason the maths I used produced some numbers that were negative when they shouldn't have been. ...



Only top voted, non community-wiki answers of a minimum length are eligible