Search Results

Search found 586 results on 24 pages for 'b ball'.

Page 8/24 | < Previous Page | 4 5 6 7 8 9 10 11 12 13 14 15  | Next Page >

  • Dragging a Sprite (Cocos2D) while Chipmunk is simulating

    - by itai alter
    Hello all! I have a simple project built with Cocos2D and Chipmunk. So far it's just a Ball (body, shape & sprite) bouncing on the Ground (a static line segment at the bottom of the screen). I implemented the ccTouchesBegan/Moved/Ended methods to drag the ball around. I've tried both: cpBodySlew(ballBody, touchPoint, 1.0/60.0f); and ballBody->p = cgPointMake(touchPoint.x,touchPoint.y); and while the Ball does follow my dragging, it's still being affected by gravity and it tries to go down (which causes velocity problems and others). Does anyone know of the preferred way to Drag an active Body while the physics simulation is going on? Do I need somehow to stop the simulation and turn it back on afterwards? Thanks!

    Read the article

  • Using Java Reflections to retrieve member classes

    - by darkie15
    Hi All, I am using .getDeclaredClasses() method to retrieve all the classes that have been defined in object. However, I am not able to retrieve anonymous classes defined in the class. Here is the code sample that I am testing: public class TempCodes { public static void main(String[] args) { Ball b = new Ball() { public void hit() { System.out.println("You hit it!"); } }; b.hit(); } interface Ball { void hit(); } } and this is what my code does: memClass = className.getDeclaredClasses(); if (memClass .length > 0) { for (int index = 0 ; index < memClass .length ; index++) { System.out.println("\t\t\t" + memClass [index]); } } Can anyone help me understand how to retrieve the anonymous class? Regards, darkie

    Read the article

  • Help with game development. Render loop?

    - by John
    Hello, I'm working on a simple game, this is my first game project. Most of the samples I find have a Render Loop where all the game logic is made too and I just don't like this. Let's say I have a ball with X=0, and a wall in X=10 and in a slow machine, the first loop places the ball in X=7 and in a second loop, it places the ball in X=14. It would just crash the game! Is this "render loop" the right way to make games? Should I write code to check for things like this in every frame? Example, new frame X=14, last frame have X=7, so I should check if there's anything from X=7 to X=14?? I was thinking that I should have a separated thread for the game logic and in the render loop, I should just "take a snapshot" of the current game logic and display that, no? How do you guys, experienced game developers work around this? thanks!

    Read the article

  • Multiple operations depending on the type of the object passed

    - by mixm
    Assuming I create a method which is passed an object and that method would perform an action depending on the object passed. How should I identify the object? I thought of using the class name to identify the object, but that may be impractical since I could easily change the class name of objects, and generate headaches during future development. Am I right? edit: for example, i have objects ball and bomb. if i have another object called wall, and the wall has the method to resolve collisions with the wall (e.g. the coordinates of the colliding ball and bomb) but have different logic depending on the colliding object (i.e. ball and bomb)

    Read the article

  • Pygame - Different sided collision question!

    - by Alex Lockwood
    Hi there everyone! I'm making a Pygame of, basically, "Breakout". I'm using collisions, and want a simple way to have different bounce effects of the different sides of one rectangle. What I currently have for the ball-to-bat collision is this: "dot" = ball; "bat" = bat; so you all understand. if dot.rect.colliderect(bat.rect):<br> dot.dy *= -1 I'd like something that interacts with each side, so could reverse the self.dx value of the ball when it hits the side of the bat, and only reversing the self.dy value when it strikes the top. Thanks!!! :D

    Read the article

  • Vertical circular motion : time(x/y) versus velocity equation

    - by adeeti
    Hi, I wanted to simulate the following through animation : A ball starts with a certain velocity at the bottom most point of a vertical circular loop and keeps rolling in it until its velocity permits. For this, I wanted to find velocity/x/y vs. time equation. For e.g. if the ball had mass : 5Kg, radius of the circular loop = 10m, and initial velocity of the ball is 200 m/s, what will its velocity and (x,y) position be after 5 seconds? thanks.

    Read the article

  • Sphere entering in to the cube.unity

    - by Parthi
    I am trying Roll a Ball unity tutorial.Everything is fine,but when I roll the ball it is moving through the cube instead of picking it. my player class is using UnityEngine; using System.Collections; public class player : MonoBehaviour { public float speed; // Use this for initialization // Update is called once per frame void Update () { float h = Input.GetAxis("Horizontal"); float v = Input.GetAxis("Vertical"); Vector3 move = new Vector3(h,0,v); rigidbody.AddForce(move * speed * Time.deltaTime); } void OnTriggerEnter(Collider other) { if(other.gameObject.tag == "Pick up") { other.gameObject.SetActive(false); } } }

    Read the article

  • Which techniques to study?

    - by Djentleman
    Just to give you some background info, I'm studying a programming major at a tertiary level and am in my third year, so I'm not a newbie off the street. However, I am still quite new to game programming as a subset of programming. One of my personal projects for next semester is to design and create a 2D platformer game with emphasis on procedural generation and "neato" effects (think metroidvania). I've written up a list of some techniques to help me improve my personal skills (using XNA for the time being). The list is as follows: QuadTrees: Build a basic program in XNA that moves basic 2D sprites (circles and squares) around a set path and speed and changes their colour when they collide. Add functionality to add and delete objects of different sizes (select a direction and speed when adding and just drag and drop them in). Particles: Build a basic program in XNA in which you can select different colours and create particle effects of those colours on screen by clicking and dragging the mouse around (simple particles emerging from where the mouse is clicked). Add functionality where you can change the amount of particles to be drawn and the speed at which they travel and when they expire. Possibly implement gravity and wind after part 3 is complete. Physics: Build a basic program in XNA where you have a ball in a set 2D environment, a wind slider, and a gravity slider (can go to negative for reverse gravity). You can click to drag the ball around and release to throw it and, depending on what you do, the ball interacts with the environment. Implement other shapes afterwards. Random 2D terrain generation: Build a basic program in XNA that randomly generates terrain (including hills, caves, etc) created from 2D tiles. Add functionality that draws the tiles from a tileset and places different tiles depending on where they lie on the y-axis (dirt on top, then rock, then lava, etc). Randomised objects: Build a basic program in XNA that, when a button is clicked, displays a randomised item sprite based on parameters (type, colour, etc) with the images pulled from tilesets. Add the ability to save the item as an object, which stores it in a side-pane where it can be selected for viewing. Movement: Build a basic program in XNA where you can move an object around in an environment (tile-based) with a camera that pans with it. No gravity. Implement gravity and wind, allow the character to jump and fall with some basic platforms. So my question is this: Are there any other commonly used techniques that I should research, and can I get some suggestions as to the effectiveness of the techniques I've chosen to work on (e.g., don't do QuadTree stuff because [insert reason here], or, do [insert technique here] before you start working on particles because [insert reason here])? I hope this is clear enough and please let me know if I can further clarify anything!

    Read the article

  • Parabolic throw with set Height and range (libgdx)

    - by Tauboga
    Currently i'm working on a minigame for android where you have a rotating ball in the center of the display which jumps when touched in the direction of his current angle. I'm simply using a gravity vector and a velocity vector in this way: positionBall = positionBall.add(velocity); velocity = velocity.add(gravity); and velocity.x = (float) Math.cos(angle) * 12; /* 12 to amplify the velocity */ velocity.y = (float) Math.sin(angle) * 15; /* 15 to amplify the velocity */ That works fine. Here comes the problem: I want to make the jump look the same on all possible resolutions. The velocity needs to be scaled in a way that when the ball is thrown straight upwards it will touch the upper display border. When thrown directly left or right the range shall be exactly long enough to touch the left/right display border. Which formula(s) do I need to use and how to implement them correctly? Thanks in advance!

    Read the article

  • Merck Serono Gains Deep Understanding of Product Portfolio Value-Drivers, Risks, and Sales Expectations Through Forecasting Solution

    - by Melissa Centurio Lopes
    Normal 0 false false false EN-US X-NONE X-NONE MicrosoftInternetExplorer4 /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-qformat:yes; mso-style-parent:""; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin-top:0in; mso-para-margin-right:0in; mso-para-margin-bottom:10.0pt; mso-para-margin-left:0in; line-height:115%; mso-pagination:widow-orphan; font-size:11.0pt; font-family:"Calibri","sans-serif"; mso-ascii-font-family:Calibri; mso-ascii-theme-font:minor-latin; mso-hansi-font-family:Calibri; mso-hansi-theme-font:minor-latin; mso-bidi-font-family:"Times New Roman"; mso-bidi-theme-font:minor-bidi;} Merck Serono S.A. is the biopharmaceutical division of Merck KGaA. It offers leading brands in 150 countries to help patients with cancer, multiple sclerosis, infertility, endocrine and metabolic disorders, as well as cardiovascular diseases. Challenges: Establish a better decision-making framework for its complex, development portfolio of pharmaceutical products, where single-point estimates or expected averages of portfolio values, portfolio risks, and sales forecasts are insufficient and can be misleading Enable the company to be aware at all times of the range of possible outcomes of technical and market risks and uncertainties, such as the technical uncertainty of whether a product will produce the desired clinical outcomes, or the market-related uncertainty of whether a product will be outperformed by its competitors Solutions to Overcome the Challenges: Used Oracle Crystal Ball to devise a Monte-Carlo-based approach to better analyze and define the values and risks of the company’s development portfolio, laying the groundwork for optimized decision-making Enabled a better understanding of the range of potential values and risks to improve portfolio planning Enabled detailed analysis of the likelihood of favorable or unfavorable outcomes, such as the likelihood of whether Merck Serono can meet its sales targets planned for the next ten years with its existing product portfolio Gained the ability to take into account correlative risks, synergies and project interactions, enabling Merck Serono to better forecast what the company may achieve—for example, that there is a 70% probability of a particular sales target being met Established Monte-Carlo-based analysis using Oracle Crystal Ball as a useful element in decision-making at the board level, as the approach provides a better analysis of values and risks associated with the company’s product portfolio “Oracle Crystal Ball enables us to make Monte Carlo simulations of the potential value and sales of our development portfolio. It is a very powerful tool for gaining a thorough understanding and improved awareness of value drivers, uncertainties, and risks, along with associated probabilities.” – Riccardo Lampariello, Associate Director, Merck Serono S.A Why Oracle “We chose Oracle Crystal Ball to enable us to perform Monte Carlo analysis, which gives us a deeper understanding and improved awareness of the value drivers, uncertainties and risks of our portfolio of development projects,” said Kimber Hardy, head of valuation and analysis, Merck Serono S.A. Normal 0 false false false EN-US X-NONE X-NONE MicrosoftInternetExplorer4 /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-qformat:yes; mso-style-parent:""; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin-top:0in; mso-para-margin-right:0in; mso-para-margin-bottom:10.0pt; mso-para-margin-left:0in; line-height:115%; mso-pagination:widow-orphan; font-size:11.0pt; font-family:"Calibri","sans-serif"; mso-ascii-font-family:Calibri; mso-ascii-theme-font:minor-latin; mso-hansi-font-family:Calibri; mso-hansi-theme-font:minor-latin; mso-bidi-font-family:"Times New Roman"; mso-bidi-theme-font:minor-bidi;} Click here to read the full version of the customer success story Normal 0 false false false EN-US X-NONE X-NONE MicrosoftInternetExplorer4 /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-qformat:yes; mso-style-parent:""; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin-top:0in; mso-para-margin-right:0in; mso-para-margin-bottom:10.0pt; mso-para-margin-left:0in; line-height:115%; mso-pagination:widow-orphan; font-size:11.0pt; font-family:"Calibri","sans-serif"; mso-ascii-font-family:Calibri; mso-ascii-theme-font:minor-latin; mso-hansi-font-family:Calibri; mso-hansi-theme-font:minor-latin; mso-bidi-font-family:"Times New Roman"; mso-bidi-theme-font:minor-bidi;}

    Read the article

  • UPK Pre-built Content Now Available for Additional Product Lines

    - by Karen Rihs
    UPK pre-built content development efforts are always underway and growing, and now include the recent release of new UPK pre-built content modules for three additional product lines! Oracle Utilities for Meter Data Management 2.0.1 Administrative Setup User Tasks VEE and Usage Rules Working with Measurement Data Fusion 11g Release 1 Functional Setup Manager General Ledger Global Human Resources Project Portfolio Management Self Service Procurement Oracle Crystal Ball 11.1.2 Oracle Crystal Ball For the most recent list of modules currently available for each product line, visit the UPK Resource Library on Oracle.com. For more information on how your organization can take advantage of UPK pre-built content, see our previous blog, The Value of UPK Pre-Built Content.  - Karen Rihs, UPK Outbound Product Management

    Read the article

  • SAT and then what?

    - by Marek
    I am on my way to make another Arkanoid game but this time I decided that I want it a little bit more realistic than just checking intersections between AABB and inverting one vector's component on collision. So I found SAT but I don't know how can I change direction of the ball in realistic matter. Maybe I'm wrong but it seems like knowing MTV doesn't give me much. So my question is what algorithms should I use to make it realistic? I also care about possibility of spinning ball with a pallet. I don't know how to do it exactly but I guess I will need to consider acceleration of the pallet.

    Read the article

  • Box 2D Collision Question

    - by Farooq Arshed
    I am very new to Box 2D Physics world. I wanted to know how to collide 2 bodies when one is Dynamic and other is Kinematic. The whole Scenario is explained below: I have 3 balls in total. I want to balls to remain in their places and the third ball to be able to move. When the third ball hits the other two balls then they should move according to the speed and direction from which they were hit. My gravity of the world is 0 because I only want z-axis gravity. I would also like some one to point me towards some good tutorials regarding Box 2D basics which is language independent. I hope I have explained my scenario well. Thanks for the help in advance.

    Read the article

  • Turn Your Browser Pane into a Game of Katamari Damacy

    - by Jason Fitzpatrick
    If you’re a fan of Katamari Damacy, a quirky and fun Japanese puzzle game made popular on the PlayStation, you’ll love this Javas script hack that turns your browser pane and its contents into a giant HTML-collecting game of Katamari Damacy. Katamari Damacy, for the unfamiliar, is a addictive game based on the premise that a galactic prince is on a mission to rebuild stars, constellations, and moons accidentally destroyed by his father. You roll around and collect objects (making yourself an increasingly larger ball in the process). This script hack puts a ball on your web browser pane (works best in Chrome) that you can roll around collecting elements from the web page. At first you can only grab links but as you grow you can grab increasingly large objects like photo elements off the page. It doesn’t have the sophisticated graphics of the Playstation version, of course, nor the detailed back story, but it’s a clever little hack that is sure to delight fans of Katamari Damacy. Katamari Hack [KatHack] Internet Explorer 9 Released: Here’s What You Need To KnowHTG Explains: How Does Email Work?How To Make a Youtube Video Into an Animated GIF

    Read the article

  • EaseFunction in LoopEntityModifier

    - by Siddharth
    For my game, I need EaseFunction in LoopEntityModifier. In my game, I am rotating ball over certain object. For giving effect I want to use EaseFunction. I want to rotate ball around an object take around 4 to 5 round that was already rotating but I want add some effect so that it looks good. For this I have to use EaseFunction which suits my needs. But if I put EaseFunction in rotation modifier then each round rotation modifier apply an effect of EaseFunction that I want only one time occur either starting or ending time. So if I can able to provide EaseFunction in LoopEntityModifier then it will good for me or something similar also work for me. At present my code is something similar like this. new LoopEntityModifier(new RotationModifier(...)); I hope someone has some idea on this.

    Read the article

  • How should I determine direction from a phone's orientation & accelerometer?

    - by Manoj Kumar
    I have an Android application which moves a ball based on the orientation of the phone. I've been using the following code to extract the data - but how do I use it to determine what direction the ball should actually travel in? public void onSensorChanged(int sensor, float[] values) { // TODO Auto-generated method stub synchronized (this) { Log.d("HIIIII :- ", "onSensorChanged: " + sensor + ", x: " + values[0] + ", y: " + values[1] + ", z: " + values[2]); if (sensor == SensorManager.SENSOR_ORIENTATION) { System.out.println("Orientation X: " + values[0]); System.out.println("Orientation Y: " + values[1]); System.out.println("Orientation Z: " + values[2]); } if (sensor == SensorManager.SENSOR_ACCELEROMETER) { System.out.println("Accel X: " + values[0]); System.out.println("Accel Y: " + values[1]); System.out.println("Accel Z: " + values[2]); } } }

    Read the article

  • Setting density for Android game

    - by Asghar
    I am developing an Android game, in which a ball (bitmap) translates( is in motion). So I have provided motion equations for the ball. I have checked my app on Samsung galaxy S2 whose actual density is roundly 252 dpi, and It works fine on that. So my question is that Does these motions of bitmaps in surfaceView, depends on actual density of phone( i.e 252 dpi for S2) or generalized density(i.e 240 dpi). I am confused whether if I run this app on 235 dpi smartphone, So will it have the same performance of motion as it is on Galaxy S2( with 252 dpi) or it would be little slow ? Any help will be appreciated.

    Read the article

  • Jumping over non-stationary objects without problems ... 2-D platformer ... how could this be solved? [on hold]

    - by help bonafide pigeons
    You know this problem ... take Super Mario Bros. for example. When Mario/Luigi/etc. comes in proximity with a nearing pipe image an invisible boundary setter must prevent him from continuing forward movement. However, when you jump and move both x and y you are coordinately moving in two dimensions at an exact time. When nearing the pipe in mid-air as you are falling, i.e. implementation of gravity in the computer program "pulling" the image back down, and you do not want them to get "stuck" in both falling and moving. That problem is solved, but how about this one: The player controlling the ball object is attempting to jump and move rightwards over the non-stationary block that moves up and down. How could we measure its top and lower x+y components to determine the safest way for the ball to accurately either fall back down, or catch the ledge, or get pushed down under it, etc.?

    Read the article

  • Creating several instances of the same object, and selecting only one

    - by hustlerinc
    I'm playing around with making a puzzle game, haven't done that much before I run into my first problem. Basically, I want to create a certain amount of the same object/function. But without hardcoding the different instances. I think maybe an array is a good idea? and then a for loop to push the objects in? And then I need to be able to select one of these objects by clicking on it, how would I do that? How do I know which ball in the array was clicked? A loop again? I made a jsFiddle example (you need to click the orange ball to select, then you can move it around by clicking the canvas). This is what I want to do, but with more balls. How would you solve this? Help appreciated.

    Read the article

  • Pygame - CollideRect - But How Do They Collide?

    - by Chakotay
    I'm having some trouble figuring out how I can handle collisions that are specifically colliding on the top or bottom a rect. How can specify those collisions? Here's a little code snippet to give you an idea of my approach. As it is now it doesn't matter where it collides. # the ball has hit one of the paddles. send it back in another direction. if paddleRect.colliderect(ballRect) or paddle2Rect.colliderect(ballRect): ballHitPaddle.play() if directionOfBall == 'upleft': directionOfBall = 'upright' elif directionOfBall == 'upright': directionOfBall = 'upleft' elif directionOfBall == 'downleft': directionOfBall = 'downright' elif directionOfBall == 'downright': directionOfBall = 'downleft' Thanks in advance. **EDIT** Paddle rect: top ____ | | | | | | Sides | | ---- bottom I need to know if the ball has hit either the top or the bottom.

    Read the article

  • What techniques can I use to render very large numbers of objects more efficiently in OpenGL?

    - by Luke
    You can think of my application as drawing a very large ball-and-stick diagram (or graph). At times, this graph can get very large, where the number of elements even outnumbers the pixels on the screen. Currently I am simply passing all of my textures (as GL_POINTS) and lines to the graphics card using VBO's. When the number of elements outnumbers the number of pixels, is this the most efficient way to do this? Or should I do some calculations on the CPU side before handing everything over to the GPU? If it matters, I do use GL_DEPTH_TEST and GL_ALPHA_TEST. I do some alpha blending, but probably not enough to make a huge performance difference. My scene can be static at times, but the user has control over a typical arc-ball camera and can pan, rotate, or zoom. It is during these operations that performance degradation is noticeable.

    Read the article

  • pygame.Rect around circle

    - by geekkid
    I'm trying to make a pong game in pygame , but i can't figure out how to but a ball circle , which i can create with pygame.draw.circle into a pygame.Rect object so i can use the colliderect function and manipulate the ball's position. For example, with rectangles, i can do something like this : rect = pygame.Rect(255, 255, 100, 100) pygame.draw.rect(screen, yellow, rect) and then when i change the pygame.Rect object position , the drawing primitives position also changes. How can the same effect be achieved when i want to draw a circle, instead of a rectangle? Thank you.

    Read the article

  • Is this asking too much of a browser?

    - by Matt Ball
    I'm embedding a large array in <script> tags in my HTML, like this (nothing surprising): <script> var largeArray = [/* lots of stuff in here */]; </script> In this particular example, the array has 210,000 elements. That's well below the theoretical maximum of 231 - by 4 orders of magnitude. Here's the fun part: if I save JS source for the array to a file, that file is 44 megabytes (46,573,399 bytes, to be exact). If you want to see for yourself, you can download it from my Dropbox. (All the data in there is canned, so much of it is repeated. This will not be the case in production.) Now, I'm really not concerned about serving that much data. My server gzips its responses, so it really doesn't take all that long to get the data over the wire. However, there is a really nasty tendency for the page, once loaded, to crash the browser. I'm not testing at all in IE (this is an internal tool). My primary targets are Chrome 8 and Firefox 3.6. In Firefox, I can see a reasonably useful error in the console: Error: script stack space quota is exhausted In Chrome, I simply get the sad-tab page: Cut to the chase, already Is this really too much data for our modern, "high-performance" browsers to handle? Is there anything I can do* to gracefully handle this much data? Incidentally, I was able to get this to work (read: not crash the tab) on-and-off in Chrome. I really thought that Chrome, at least, was made of tougher stuff, but apparently I was wrong... Edit 1 @Crayon: I wasn't looking to justify why I'd like to dump this much data into the browser at once. Short version: either I solve this one (admittedly not-that-easy) problem, or I have to solve a whole slew of other problems. I'm opting for the simpler approach for now. @various: right now, I'm not especially looking for ways to actually reduce the number of elements in the array. I know I could implement Ajax paging or what-have-you, but that introduces its own set of problems for me in other regards. @Phrogz: each element looks something like this: {dateTime:new Date(1296176400000), terminalId:'terminal999', 'General___BuildVersion':'10.05a_V110119_Beta', 'SSM___ExtId':26680, 'MD_CDMA_NETLOADER_NO_BCAST___Valid':'false', 'MD_CDMA_NETLOADER_NO_BCAST___PngAttempt':0} @Will: but I have a computer with a 4-core processor, 6 gigabytes of RAM, over half a terabyte of disk space ...and I'm not even asking for the browser to do this quickly - I'm just asking for it to work at all! ? *other than the obvious: sending less data to the browser

    Read the article

  • NUnit isn't running VS10 code

    - by Ball
    I'm trying to load a Visual Studio 2010 beta dll into the NUnit GUI. I get a popup error. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded. You may be attempting to load an assembly build with a leter version of the CLR than the version under which NUnit is currently running. How do I force an executable to run under .NET 4 beta?

    Read the article

  • Will a ScheduledExecutorService create new threads as needed?

    - by Matt Ball
    I'm using Executors.newScheduledThreadPool() to create a ScheduledExecutorService, specifying the number of threads like so: int corePoolSize = 42; ScheduledExecutorService foo = Executors.newScheduledThreadPool(corePoolSize); According to the JavaDocs, the corePoolSize argument sets the number of threads to keep in the pool, even if they are idle. Does this mean that this ExecutorService implementation may create more than corePoolSize threads as needed, similar to a cached thread pool?

    Read the article

< Previous Page | 4 5 6 7 8 9 10 11 12 13 14 15  | Next Page >