Search Results

Search found 560 results on 23 pages for 'cocos2d'.

Page 22/23 | < Previous Page | 18 19 20 21 22 23  | Next Page >

  • How to avoid being forked into oblivion by a more powerful contributor?

    - by Den
    As recently reported here: Xamarin has forked Cocos2D-XNA, a 2D/3D game development framework, creating a cross-platform library that can be included in PCL projects. However the founder of the project that was forked says: The purpose of the MIT license is to unencumber your fair use. Not to encourage you to take software, rebrand it as your own, and then "take it in a new direction" as you say. While not illegal, it is unethical. It seems that the GitHub page of the new project doesn't even indicate that it's a fork in a typical GitHub manner, opting for an easily-removable History section instead (see bottom). So my questions are: Was Xamarin's action and the way the action was done ethical or not? Is it possible to avoid such a situation if you are a single developer or a small unfunded group of developers? I am hoping this could be either a wiki question or there will be some objective answers grounded on modern OSS ethics/philosophy.

    Read the article

  • Long running calculation on background thread

    - by SundayMonday
    In my Cocos2D game for iOS I have a relatively long running calculation that happens at a fairly regular interval (every 1-2 seconds). I'd like to run the calculation on a background thread so the main thread can keep the animation smooth. The calculation is done on a grid. Average grid size is about 100x100 where each cell stores an integer. Should I copy this grid when I pass it to the background thread? Or can I pass a reference and just make sure I don't write to the grid from the main thread before the background thread is done? Copying seems a bit wasteful but passing a reference seems risky. So I thought I'd ask.

    Read the article

  • How to store and update data table on client side (iOS MMO)

    - by farseer2012
    Currently i'm developing an iOS MMO game with cocos2d-x, that game depends on many data tables(excel file) given by the designers. These tables contain data like how much gold/crystal will be cost when upgrade a building(barracks, laboratory etc..). We have about 10 tables, each have about 50 rows of data. My question is how to store those tables on client side and how to update them once they have been modified on server side? My opinion: use Sqlite to store data on client side, the server will parse the excel files and send the data to client with JSON format, then the client parse the JOSN string and save it to Sqlite file. Is there any better method? I find that some game stores csv files on client side, how do they update the files? Could server send a whole file directly to client?

    Read the article

  • Changing location after CommitAnimations

    - by Will Youmans
    I'm using the following code to move a UIImageView: shootImg.image = [UIImage imageNamed:@"Projectile Left 1.png"]; [UIView beginAnimations:nil context:nil]; shootImg.center = CGPointMake(shootImg.center.x+1000, shootImg.center.y); [UIView commitAnimations]; This works but what I want to do is after [UIView CommitAnimations]; I want to set the location of shootImg using CGPointMake. If I just put it after commitAnimations then the animation doesn't fully complete. Any suggestions? I'm not using any frameworks like cocos2d and if you need to see any more code just ask.

    Read the article

  • How to find a programming mentor?

    - by Dvole
    I decided to learn programming. I've been reading SO for few days, and I think I will start with C++, as I read some articles. I am aware of loops, arrays, program logic and objects a little and I need someone to look me over and help me with small questions I get when doing my first projects. So here is the question - where do I find such guy? I don't got any friends who program and all. EDIT: 2 years later, I am still looking for mentor. I did not actively code just started 3 months again. I work on Objective-C and iOS programming and game programming with Cocos2d. If you want to become my mentor, drop me a or comment.

    Read the article

  • How do I repeatedly move an image by 1 pixel?

    - by Will
    I have a method that is moving a UIImageView called shootImg across the screen: -(IBAction)shoot{ if (appDelegate.shootInt > 0) { if (direction == 1) { shootImg.center = CGPointMake(shootImg.center.x+1, shootImg.center.y); appDelegate.shootInt = appDelegate.shootInt - 1; shootLabel.text = [NSString stringWithFormat:@"%d", appDelegate.shootInt]; } This does seem to work. But it only moves shootImage 1 pixel. What I want to do is make it repeatedly move 1 pixel. I tried a while loop but that didn't seem to work. I'm not using cocos2d or anything like that and if you need to see more code just ask. Thanks :)

    Read the article

  • Base on User Drawing Create Polygon Body as well Image

    - by Siddharth
    In my game, I want to provide a user with drawing feature. By free hand drawing user create a polygon shape. So in my game implementation I have to create body for all found vertices and I have to generate image based on that polygon shape. So my problem is how to create image that match the user provided vertices. In cocos2d I listen that there is an implementation of something like Image Masking. But I don't understand how that thing I implement in andengnine. Please provide any guidance on how to create image same as user generated polygon shape.

    Read the article

  • Letting the user draw a Polygon Body and Image

    - by Siddharth
    In my game, I want to provide the user with a drawing feature. By free hand drawing, the user creates a polygon shape. Then, in my game implementation, I have to create a body for the found vertices and generate an image based on that polygon shape. My problem is how to create an image that matches the user-provided vertices. I've heard that cocos2d has something called Image Masking. I don't understand how I could implement it in AndEngine. Could someone help?

    Read the article

  • Sound Delay With AVAudio Player

    - by Will Youmans
    I'm using the following code in my viewDidLoad to load a sound: NSURL * url = [NSURL fileURLWithPath: [NSString stringWithFormat:@"%@/Moto - Hit Sound.mp3", [[NSBundle mainBundle] resourcePath]]]; NSError * error; hitSoundPlayer = [[AVAudioPlayer alloc]initWithContentsOfURL:url error:&error]; hitSoundPlayer.numberOfLoops = 0; Then I'm using this in a void method to play the sound: if(CGRectIntersectsRect(main.frame, enemy1.frame)){ [hitSoundPlayer play]; } This does seem to work, however the first time the sound is played there is a lot of lag and the game stops temporarily. I'm using this same method for when in an IBAction and it works fine, it must be the fact that it's also detecting a collision that makes the sound lag. If I want to be able to play sounds quickly and on the spot without any sort of lag am I doing the right thing? Do I want to use another method? I'm not using any frameworks like cocos2d. If you need to see any more code just ask.

    Read the article

  • Rotating object along bezier curve: not rotating enough?

    - by Paul
    I tried to follow the instructions from the threads on the forum (Cocos2d rotating sprite while moving with CCBezierBy) with Unity, in order to rotate my object as it moves along a bezier curve. But it does not rotate enough, the angle is too low, it goes up to 6 instead of 90 for example, as you can see on this image (the y eulerAngle is at 6, I would expect it to be around 90 with this curve) : Would you know why it does this? And how to make the rotation toward the next point? Here is the code (in c# with Unity) : (I am comparing x and z to get the angle, and adding the angle to eulerAngles.y so that it rotates around the y axis) void Update () { if ( Input.GetKey("d") ) start = true; if ( start ){ myTime = Time.time; start = false; } float theTime = (Time.time - myTime) *0.5f; if ( theTime < 1 ) { car.position = Spline.Interp( myArray, theTime );//creates the bezier curve counterBezier += Time.deltaTime; //compare 2 positions after 0.1f if ( counterBezier > 0.1f ){ counterBezier = 0; cbDone = false; newpos = car.position; float angle = Mathf.Atan2(newpos.z - oldpos.z, newpos.x - oldpos.x); angle += car.eulerAngles.y; car.eulerAngles = new Vector3(0,angle,0); } else if ( counterBezier > 0 && !cbDone ){ oldpos = car.position; cbDone = true; } Thanks

    Read the article

  • Using gluLookAt to move camera in 2D iPhone game ?

    - by Mr.Gando
    Hey guys, I'm trying to use gluLookAt to move the camera in my iPhone game, but every time I've tried to use gluLookAt my screen just goes "blank" ( grey in this case ) I'm trying to render a simple triangle and to move the camera, this is my code: to setup my scene I do: glViewport(0, 0, backingWidth, backingHeight); glMatrixMode(GL_PROJECTION); glLoadIdentity(); glRotatef(-90.0, 0.0, 0.0, 1.0); //using iPhone in horizontal mode glOrthof(-240, 240, -160, 160, -1, 1); glMatrixMode(GL_MODELVIEW); then my "triangle rendering" code looks like: GLfloat triangle[] = {0, 100, 100, 0, -100, 0,}; glClearColor(0.7, 0.7, 0.7, 1.0); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glEnableClientState(GL_VERTEX_ARRAY); glColor4f(1.0, 0.0, 0.0, 1.0); glVertexPointer(2, GL_FLOAT, 0, &triangle); glDrawArrays(GL_TRIANGLES, 0, 6); glDisableClientState(GL_VERTEX_ARRAY); This draws a red triangle in the middle of the screen, when I try to apply gluLookAt ( I got the implementation of the function from Cocos2D so I asume it's correct ), i do: glMatrixMode(GL_MODELVIEW); glLoadIdentity(); gluLookAt(0,0,1,0,0,0,0,0,1); // try to move the camera a bit ? GLfloat triangle[] = {0, 100, 100, 0, -100, 0,}; glClearColor(0.7, 0.7, 0.7, 1.0); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glEnableClientState(GL_VERTEX_ARRAY); glColor4f(1.0, 0.0, 0.0, 1.0); glVertexPointer(2, GL_FLOAT, 0, &triangle); glDrawArrays(GL_TRIANGLES, 0, 6); glDisableClientState(GL_VERTEX_ARRAY); This leads me to grey screen (glClearColor is grey), I've tried all sort of things and read what I've found about gluLookAt on the net, but no luck :(, if someone could explain me or show me how to move to move the camera in a top-down fashion ( zelda, etc ), I would really appreciate it. Thanks!

    Read the article

  • Creating a newspaper that effects the game's economy?

    - by zardon
    I am writing a game in Objective C/cocos2d where a newspaper is a central part of what controls or rather effects the game's world economy as well as what a city might do (such as increase X, reduce Y) The newspaper is a bit like a "Chance card" in Monopoly, it has an effect on something. My question is, what is the best way to do write a newspaper that has both a random and specific effect within the game. Would the best strategy be to write out all the things a newspaper can affect, a PLIST of headlines (with placeholders). I think Tiny Tower uses a PLIST of events and it randomly picks an event, but I'm not sure how it actually parses it because certain events do different things. But then how do I parse all the scenarios that a newspaper can deliver? A big switch statement seems very long and complicated to do. I am wondering if there is a simpler way to handle this kind of thing. Related to this is that there might be no news that day and I'm not sure what the newspaper should display, should it just display the last headline? So, in summary. 1) A newspaper generates a headline, it affects different things, such as the world economy, prices, how city reacts 2) I need the newspaper to generate headlines (although there may be days when there are no headlines at all), but I am not sure how to parse it without using a big-ass switch statement. Thanks in advance.

    Read the article

  • In a Tower defense game, how to do buffs/debuffs

    - by Gabe
    The question is at the very bottom. If you understand Buffs/Debuffs in tower defense games then you should skip the bulk of this question and go to the bottom (seperated with the long line) I plan on making an IPhone TD game. The fact that its an iPhone game isn't relevant but I am coding in Objective-c with Cocos2D. I am relatively inexperienced in the field of game design so I'm looking for some advice from someone experienced in this field. In tower defense, there are two things that are relevant to my question: towers/enemies (both have their own classes/children). They each have stats like hp, damage, speed, etc. I want to add buffs/defuffs, for instance: Towers A,B and C each have 15 base damage. Tower D would be a buff tower with no damage, a tower with an AOE(area of effect) aura that gives 10% damage to all towers in range. Tower E might slow enemies in its AOE, a debuff. Stuff like that. The same could go for enemies. Enemy A is a boss that has a slow aura that affects towers and slows their base attack speed or something along those lines. So the question is, what would be the most effective way to implement this? If it was just towers then I would just mess around with the tower classes, but since tower classes and enemy classes are both affected, should I make a buff class? TD games can consume quite a bit of memory with large amounts of creeps and towers, and buffs I feel like would also consume quit a bit... So I'm trying to be as effective as possible.

    Read the article

  • Initializing OpenFeint for Android outside the main Application

    - by Ef Es
    I am trying to create a generic C++ bridge to use OpenFeint with Cocos2d-x, which is supposed to be just "add and run" but I am finding problems. OpenFeint is very exquisite when initializing, it requires a Context parameter that MUST be the main Application, in the onCreate method, never the constructor. Also, the main Apps name must be edited into the manifest. I am trying to fix this. So far I have tried to create a new Application that calls my Application to test if just the type is needed, but you do really need the main Android application. I also tried using a handler for a static initialization but I found pretty much the same problem. Has anybody been able to do it? This is my working-but-not-as-intended code snippet public class DerpHurr extends Application{ @Override public void onCreate() { super.onCreate(); initializeOpenFeint("TestApp", "edthedthedthedth", "aeyaetyet", "65462"); } public void initializeOpenFeint(String appname, String key, String secret, String id){ Map<String, Object> options = new HashMap<String, Object>(); options.put(OpenFeintSettings.SettingCloudStorageCompressionStrategy, OpenFeintSettings.CloudStorageCompressionStrategyDefault); OpenFeintSettings settings = new OpenFeintSettings(appname, key, secret, id, options); //RIGHT HERE OpenFeint.initialize(***this***, settings, new OpenFeintDelegate() { }); System.out.println("OpenFeint Started"); } } Manifest <application android:debuggable="true" android:label="@string/app_name" android:name=".DerpHurr">

    Read the article

  • How to procedurally (create) grow an artistic (2D) tree in real-time (L-System?).

    - by lalan
    Recently I programmed an L-system module, It got me interested further. I am a Plants vs Zombies junkie as well, really liked the concept of Tree of Wisdom. Would love to create similar procedural art just for fun and learn more. Question: How should I approach the process of creating an artistic tree (2d perhaps with fixed camera/perspective) dynamically? Ideally I would like to start with a plant (only a stem with a leaf) and grow it dynamically using some influence (input/user action) over its structure. These influences may result in different type of branching, curves in branches, its spread, location of fruits, color of flowers, etc. Want it to be really full of life/spirit. :) Plants vs Zombies: Tree of wisdom It would be great to dynamically grow a similar tree, but with lot more variation and animations happening. My Background: Student / Programmer, have used few game engines (Ogre3d, cocos2d, unity). Haven't really programmed directly using openGL, trying to fix that :). I am ready to spend considerable time, Please let me know about the APIs? and how would an expert like you would take on this problem? Why 2D? I think it's easier to solve the problem only considering 2 dimensions. Artistic inspirations: Only the tree, with fruits and leaves, without the shrubs at the bottom The large tree (visible branches, green leaves, flowers, fruits, etc) on the left, behind monkey. PixelJunk's Eden (Art style inspiration). Procedurally Generated Apple Tree using Fractals Please let me know if it was easy for you to understand the question, I may elaborate further. I hope a discussion of various approach would be helpful for everyone. You guys are awesome.

    Read the article

  • Algorithm for optimal control on space ship using accelerometer input data

    - by mm24
    Does someone have a good algorithm for controlling a space ship in a vertical shooter game using acceleration data? I have done a simple algorithm, but works very badly. I save an initial acceleration value (used to calibrate the movement according to the user's initial position) and I do subtract it from the current acceleration so I get a "calibrated" value. The problem is that basing the movement solely on relative acceleration has an effect of loss of sensitivity: certain movements are independent from the initial position. Would anyone be able to share a a better solution? I am wondering if I should use/integrate also inputs from gyroscope hardware. Here is my sample of code for a Cocos2d iOS game: - (void) accelerometer:(UIAccelerometer *)accelerometer didAccelerate:(UIAcceleration *)acceleration { if (calibrationLayer.visible){ [self evaluateCalibration:acceleration]; initialAccelleration=acceleration; return; } if([self evaluatePause]){ return; } ShooterScene * shooterScene = (ShooterScene *) [self parent]; ShipEntity *playerSprite = [shooterScene playerShip]; float accellerationtSensitivity = 0.5f; UIAccelerationValue xAccelleration = acceleration.x - initialAccelleration.x; UIAccelerationValue yAccelleration = acceleration.y - initialAccelleration.y; if(xAccelleration > 0.05 || xAccelleration < -0.05) { [playerSprite setPosition:CGPointMake(playerSprite.position.x + xAccelleration * 80, playerSprite.position.y + yAccelleration * 80)]; } else if(yAccelleration > 0.05 || yAccelleration < -0.05) { [playerSprite setPosition:CGPointMake(playerSprite.position.x + xAccelleration * 80, playerSprite.position.y + yAccelleration * 80)]; } }

    Read the article

  • Constant opacity with glBlendFunc on iPhone

    - by Jeff Johnson
    What glBlendFunc should I use to ensure that the opacity of my drawing is always the same? When I use glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA) and multiple images are drawn on top of each other, the result is more and more opaque until it's completely opaque after a certain number of imgaes. The closest I have come is to use glBlendFunc(GL_ONE_MINUS_DST_ALPHA, GL_ONE_MINUS_SRC_ALPHA) which maintains a constant opacity no matter how many images are on top of each other, although there is a slight variation in opacity if the images overlap each other. Any other render states I should consider trying? Any other ideas? I am making a drawing app for my kid and I don't want the images (brush) they draw to cover up the background. Heres the closest I've got: I want to have it so that the overlap part of the circles is the same color and opacity as the center part of the circle. I am using cocos2d iphone v. 0.99

    Read the article

  • Is there a 2d sprite library for webgl?

    - by Devon
    I am looking to build a 2d game using WebGL. I want the hardware acceleration that WebGL provides and I cannot get this from the 2D canvas context in the canvas tag. With that said, is there a tutorial on creating 2D sprites using webGL? Or, better yet, is there a 2D sprite library for WebGL? Ideally, I'm looking for something like cocos2d ported to WebGL. Not surprisingly, all of the demos, tutorials and libraries I have found for WebGL focus on 3D manipulation. Are there any WebGL libraries that support 2D sprites?

    Read the article

  • How have popular iPhone games been ported to Android?

    - by Cirrostratus
    I am not asking how could they have been, I want to know the real answer. Doodle Jump, Paper Toss and some others have versions on the iPhone and Android that are nearly exactly the same, with the iPhone version coming first. There is a small Objective-C compiler project for Android's NDK but the timing isn't right for these apps. There's also an Android port of Cocos2d but I doubt Doodle Jump used that. Titanium? Doubtful. As their respective code bases grow, I figure it'd get harder and harder to do an exact port from Objective-C to Java every release so I wonder if there is a better way. Are they sharing C++ code for example?

    Read the article

  • how to create a particle system on iphone and retain the created particles?

    - by lukya
    Hi all, I need to create a particle system and retain the created particles. I need to shake / move the created particles with the iphone accelerometer. Also, the number of particles needs to be very high (I need to show sand!). I do not have any OpenGLES programming experience. After initial search, I found Cocos2D can be used for particle generation. But there is no way of retaining the particles in the CCParticle system. As a work around, I tried creating many sprites at the end of particle generation and shown them as particles. But moving few number of sprites with accelerometer drops the frame rate considerably. Please suggest how this can be achieved and whether I should look for some other framework or if some kind of similar demo code is available. Thanks, Swapnil

    Read the article

  • Where to start openGL ES to create and rotate a cube in an iPhone?

    - by micropsari
    Hello. I've done some apps on iPhone using Objevtive-C and Cocos2d, and I'd like to start learning 3D. My first goal is to make a very simple app that: - Displays a 3D cube in the center of the screen. - And move the camera around the cube I want something very simple: no texture, no background. Where should I start to be able to do this app? I'm searching for some tutorials or exemples. Thanks!

    Read the article

  • Running a Ruby interpreter on iPad

    - by slothbear
    I'll be taking a trip soon with my iPad, without my laptop. I'd like to continue to tinker with Ruby while I'm on the road. I have an iPhone developer program membership, and I'm not interested in submitting this stuff to the app store. I found the shinycocos project, which appears to embed a Ruby interpreter in an app. But I can't get it to run, and it seems pretty customized for running cocos2d stuff. My first goal is to run an interactive command line like Try Ruby!. After that, I'd like to enter small programs in a UITextView and run them. I'd appreciate any clues, tips, or existing projects you might know of.

    Read the article

  • some thing wrong with memory?

    - by Rocker
    Hi there I am developing a game using Cocos2D. I got some error out of sudden after few time successfully played the game. And When i debugged it gives the error called EXC_BAD_ACCESS. here is the code. -(void) winGame { //the debug stopped here... WinningScene *winner = [WinningScene node]; [[Director sharedDirector] replaceScene:[FadeTransition transitionWithDuration:1.0 scene:winner]]; } if ((touchCount > 0 && touchCount ==2) && (rangeY2 > 0.0 && rangeY2 < 20.0)) { bras++; if (bras == 1) { //[self winGame]; [self runAction:[Sequence actionOne:[DelayTime actionWithDuration:0.5] two: [CallFunc actionWithTarget:self selector:@selector(winGame)]]]; } Could u guys tell me why ?

    Read the article

< Previous Page | 18 19 20 21 22 23  | Next Page >