Search Results

Search found 198 results on 8 pages for 'bullets'.

Page 1/8 | 1 2 3 4 5 6 7 8  | Next Page >

  • Adding a short delay between bullets

    - by Sun
    I'm having some trouble simulating bullets in my 2D shooter. I want similar mechanics to Megaman, where the user can hold down the shoot button and a continues stream of bullets are fired but with a slight delay. Currently, when the user fires a bullet in my game a get an almost laser like effect. Below is a screen shot of some bullets being fired while running and jumping. In my update method I have the following: if(gc.getInput().isKeyDown(Input.KEY_SPACE) ){ bullets.add(new Bullet(player.getPos().getX() + 30,player.getPos().getY() + 17)); } Then I simply iterate through the array list increasing its x value on each update. Moreover, pressing the shoot button (Space bar) creates multiple bullets instead of just creating one even though I am adding only one new bullet to my array list. What would be the best way to solve this problem?

    Read the article

  • improve Collision detection memory usage (blocks with bullets)

    - by Eddy
    i am making a action platform 2D game, something like Megaman. I am using XNA to make it. already made player phisics,collisions, bullets, enemies and AIs, map editor, scorolling X Y camera (about 75% of game is finished ). as i progressed i noticed that my game would be more interesting to play if bullets would be destroyed on collision with regular(stationary ) map blocks, only problem is that if i use my collision detection (each bullet with each block) sometimes it begins to lag(btw if my bullet exits the screen player can see it is removed from bullet list) So how to improve my collision detection so that memory usage would be so high? :) ( on a map 300x300 blocks for example don't think that bigger map should be made); int block = 0; int bulet= 0; bool destroy_bullet = false; while (bulet < bullets.Count) { while (block < blocks.Count) { if (bullets[bulet].P_Bul_rec.Intersects( blocks[block].rect)) {//bullets and block are Lists that holds objects of bullet and block classes //P_Bul_rec just bullet rectangle destroy_bullet = true; } block++; } if (destroy_bullet) { bullets.RemoveAt(bulet); destroy_bullet = false; } else { bulet++; } block = 0; }

    Read the article

  • How to Align Gun with Bullets

    - by Shane
    I have a top-down 2D shooter. I have an image of a player holding a gun, that rotates to face the mouse. Please note that the gun isn't a separate image tethered to the player, but rather part of the player. Right now, bullets are created at the player's x and y. This works when the player is facing the right way, but not when they rotate. The bullets move in the right direction, but don't come from the gun. How can I fix this? TL;DR: When the player rotates, bullets don't come from gun. public void fire() { angle = sprite.getRotation(); System.out.println(angle); x = sprite.getX(); y = sprite.getY(); Bullet b = new Bullet(x, y, angle); Utils.world.addBullet(b); }

    Read the article

  • How are these bullets done?

    - by Mike
    I really want to know how the bullets in Radiangames Inferno are done. The bullets seem like they are just billboard particles but I am curious about how their tails are implemented. They can curve so this means they are not just a billboard. Also, they appear continuous which implies that the tails are not made of a bunch of smaller particles (I think). Can anyone shead some light on this for me?

    Read the article

  • How are these bullets done?

    - by Mike
    I really want to know how the bullets in Radiangames Inferno are done. The bullets seem like they are just billboard particles but I am curious about how their tails are implemented. They can curve so this means they are not just a billboard. Also, they appear continuous which implies that the tails are not made of a bunch of smaller particles (I think). Can anyone shead some light on this for me?

    Read the article

  • Resizing custom bullets without changing the font size - Word 2010

    - by Citroenfris
    I'm trying to make some custom bullets in Word 2010 with the help of a picture. I thought if I made the picture the desired size everything would work out fun, but it didn't. The problem is that the bullets are always bigger than the text which is not what I had in mind. So my question is, is there any way to properly size the custom made bullets or is there another way to create these so they are actually smaller than my text. If I change the font size of my text the bullets automatically become bigger as well. I would include an image but I don't have the sufficiënt reputation to do so. Thank you in advance.

    Read the article

  • Checking collision of bullets and Asteroids

    - by Moaz ELdeen
    I'm trying to detect collision between two list of bullets and asteroids. The code works fine, but when the bullet intersects with an asteroid, and that bullet passes through another asteroid, the code gives an assertion, and it says about it can't increment the iterator. I'm sure there is a small bug in that code, but I can't find it. for (list<Bullet>::iterator itr_bullet = ship.m_Bullets.begin(); itr_bullet!=ship.m_Bullets.end();) { for (list<Asteroid>::iterator itr_astroid = asteroids.begin(); itr_astroid!=asteroids.end(); itr_astroid++) { if(checkCollision(itr_bullet->getCenter(),itr_astroid->getCenter(), itr_bullet->getRadius(), itr_astroid->getRadius())) { itr_astroid = asteroids.erase(itr_astroid); } } itr_bullet++; }

    Read the article

  • How are bullets simulated in video games?

    - by mahen23
    I have been playing games like MW2 recently and, as a programmer, I tend to ask myself how do they make the game so immersive. For example, how to they simulate bullet speed. When an NPC fires a bullet from his gun, does the bullet really travel from his gun to the given target or do they they completely ignore this part and just put a bullet hole on the target? If the bullet is really travelling from the gun to the target, at what speed is it actually travelling?

    Read the article

  • rotate sprite and shooting bullets from the end of a cannon

    - by Alberto
    Hi all i have a problem in my Andengine code, I need , when I touch the screen, shoot a bullet from the cannon (in the same direction of the cannon) The cannon rotates perfectly but when I touch the screen the bullet is not created at the end of the turret This is my code: private void shootProjectile(final float pX, final float pY){ int offX = (int) (pX-canon.getSceneCenterCoordinates()[0]); int offY = (int) (pY-canon.getSceneCenterCoordinates()[1]); if (offX <= 0) return ; if(offY>=0) return; double X=canon.getX()+canon.getWidth()*0,5; double Y=canon.getY()+canon.getHeight()*0,5 ; final Sprite projectile; projectile = new Sprite( (float) X, (float) Y, mProjectileTextureRegion,this.getVertexBufferObjectManager() ); mMainScene.attachChild(projectile); int realX = (int) (mCamera.getWidth()+ projectile.getWidth()/2.0f); float ratio = (float) offY / (float) offX; int realY = (int) ((realX*ratio) + projectile.getY()); int offRealX = (int) (realX- projectile.getX()); int offRealY = (int) (realY- projectile.getY()); float length = (float) Math.sqrt((offRealX*offRealX)+(offRealY*offRealY)); float velocity = (float) 480.0f/1.0f; float realMoveDuration = length/velocity; MoveModifier modifier = new MoveModifier(realMoveDuration,projectile.getX(), realX, projectile.getY(), realY); projectile.registerEntityModifier(modifier); } @Override public boolean onSceneTouchEvent(Scene pScene, TouchEvent pSceneTouchEvent) { if (pSceneTouchEvent.getAction() == TouchEvent.ACTION_MOVE){ double dx = pSceneTouchEvent.getX() - canon.getSceneCenterCoordinates()[0]; double dy = pSceneTouchEvent.getY() - canon.getSceneCenterCoordinates()[1]; double Radius = Math.atan2(dy,dx); double Angle = Radius * 180 / Math.PI; canon.setRotation((float)Angle); return true; } else if (pSceneTouchEvent.getAction() == TouchEvent.ACTION_DOWN){ final float touchX = pSceneTouchEvent.getX(); final float touchY = pSceneTouchEvent.getY(); double dx = pSceneTouchEvent.getX() - canon.getSceneCenterCoordinates()[0]; double dy = pSceneTouchEvent.getY() - canon.getSceneCenterCoordinates()[1]; double Radius = Math.atan2(dy,dx); double Angle = Radius * 180 / Math.PI; canon.setRotation((float)Angle); shootProjectile(touchX, touchY); } return false; } Anyone know how to calculate the coordinates (X,Y) of the end of the barrel to draw the bullet?

    Read the article

  • Friday Fun: Let The Bullets Fly 2

    - by Asian Angel
    Friday is finally here again, so take a few minutes to relax and have some fun! In this week’s game you are a pistol carrying sharp-shooter with a mission to eliminate the legion of evil henchmen scattered across different locations. Do you have the skill and patience needed to defeat them? How To Properly Scan a Photograph (And Get An Even Better Image) The HTG Guide to Hiding Your Data in a TrueCrypt Hidden Volume Make Your Own Windows 8 Start Button with Zero Memory Usage

    Read the article

  • Stuck on Ubuntu startup screen (5 orange bullets)

    - by psyboy14
    I recently download Ubuntu 12.04 LTS onto my Macbook Pro 5-5. Everything worked seamlessly, save for the brightness control. I couldn't change the screen brightness from the hardware buttons, nor from the system preferences. To fix it, I used the instructions here: MacbookPro 5-5 LCD Brightness Control At #2, I restarted my laptop, only to see that it went straight to the Ubuntu Startup Screen, with the 5 orange dots (Usually they all startoff white, then turn orange to indicate progress). From there, I tried controlling the brightness from the keyboard, and it worked, but sadly, my computer is still stuck on the loading screen. (Yes, I have tried manually restarting it) Could you please help? Thank you in advance

    Read the article

  • Spawning bullets on command in Box2D

    - by recharge330
    I'm making a simple bullet hell game but I can't figure out how to get my character to shoot. Lets say I have bulletBody and shipBody, how would I continually spawn bulletBodies using the shipBody coordinates. I've tried a function that uses an array of b2bodies and just assigns them the bodydef and fixture but that causes the game to crash. C++ sample code would be best but any help is appreciated. EDIT: It looks like any reference to my b2World in a function will cause the game to crash. How do I declare the bodies without using a b2World as an argument in the function.

    Read the article

  • Android Array Lag?

    - by Mike
    I am making a platform game for Android. It is sort of a tile based game. I added bullets and enemies with AI and a bunch of tile types. I created a simple map with no Enemies. Everything was running well and smooth until I shot a bunch of bullets randomly everywhere. A couple of hundreds of bullets later, the FPS lowered. I made a test to find out if the bullets were the problem so I made another simple map with just a tile to stand on and left it for a while. Minutes later, I played around with it a bit to check if the FPS changed and it didnt. I reloaded the same map and shot a lot of bullets. Minutes later, the FPS was visibly lower even after the number of bullets were zero. Points to note: Programmed FPS is 30 Tested on a Samsung Galaxy Y and Samsung Galaxy W Any tile, enemy, bullet that is off screen is not drawn to prevent lag Bullets collide with Tiles (if they dont collide with in 450 frames, they are removed from the array) I used List bullets = new ListArray(); I used bullets.add(new Bullet(x, y, params...)); I used for(...){ if(...){ bullets.remove(i); } } Code for bullet: private void drawBullets(Canvas canvas) { for (int i = 0; i < bullets.size(); i++) { Bullet b = bullets.get(i); b.update(canvas); //updates physics if (b.t > blm) { //if the bullet is past its expiry bullets.remove(i); i--; } else { if (svx((b.x)) > 0 && svx(b.x) < width && svy((b.y)) > 0 && svy(b.y) < height) { // if bullet is not off screen b.draw(canvas); // draw the bullet } } } } I tried searching for solutions and references but I have no luck. I'm guessing that the lag has something to do with the Array and the Bullets or Classes that I've loaded? I'm not sure! Someone please help! Thanks in advance! :)

    Read the article

  • Aligning Numbered Bullet Points in Word 2007

    - by Frustratedwithbullets
    Hello, I am putting together a very large business manual which incorportaes numbered heading, steps to follow, diagrams, etc. When using the bullet points, they align perfectly as I work through the processes. However when I include a diagram, or something different from the "norm" of text, the alignment changes. I would like all the bullets points to be aligned in the whole document regardless of where they appear in the document. Is there a way to save the settings so that the bullets always appear in the same position? Currently I am having to reset the indents by dragging the tabs on the ruler. This will be a large document, so I don't want to manually adjust the numbered bullets every time. Help would be greatly appreciated. Thanks very much.

    Read the article

  • Extract Bullets and Tables information in Word doc from c#

    - by Siva
    Hi All, I need to create an word document based on the template in c#. I have tags for only the paragraphs. Is there any way to replace the bullets and tables that are already available in the template based on the user input. I was able to replace the paragraph with input text using the Replace command in the Word InterOp. Need help to do the rest of the items. Replace the bullets based on the user input Fill the tables with the input values Code for replacing the Paragraph based on the tag: FindAndReplace(wordApplication, "/date/", DateTime.Now.Date.ToString("MMM dd, yyyy")); FindAndReplace(){ wordApplication.Selection.Find.Execute(ref findText, ref matchCase, ref matchWholeWord, ref matchWildCards, ref matchSoundsLike, ref matchAllWordsForms, ref forward, ref wrap, ref format, ref replaceWithText, ref replace, ref matchKashida, ref matchDiacritics, ref matchAlefHamsa, ref matchControl); } Thanks in Advance. ASAP

    Read the article

  • Trying to make a game with C++, using lists to store bullets and enemies, but they are not erased

    - by XD_dued
    I've been trying to make a pretty simple space shooter game with C++, and I have been having a lot of trouble trying to use lists to store enemies and bullets. Basically I followed the post here almost exactly to store my bullets: SDL Bullet Movement I've done something similar to store my enemies. However, when I call bullets.erase(it++), for some reason the bullet is not erased. When the bullet movement is run for the next frame, it tries to re delete the bullet and segfaults the program. When I comment out the erase line, it runs fine, but the bullets are then never erased from the list... Is there any reason why the elements of the list aren't being deleted? I also set it up to print the number of elements in the list for every iteration, and it does not go down after deleting. Thanks! EDIT: Here's the specific code I'm using to store my enemies and having them act: std::list<Grunt*> doGrunts(std::list<Grunt*> grunts) { for(std::list<Grunt*>::iterator it = grunts.begin(); it != grunts.end();) { if((*it)->getHull() == 0) { delete * it; grunts.erase(it++); } else { (**it).doUnit(grunts, it); ++it; } } } Grunt is my enemy class, and the list grunts is a global variable. Is that my problem? When I pass the global into the function it becomes local? I assumed lists would be a reference type so thought this wouldn't be a problem. Sorry if this was a dumb question, I'm very new to C++, this is the first major thing I'm working on.

    Read the article

  • Aligning Numbered Bullet Points in Word 2007

    - by FrustratedwithWord
    I am putting together a very large business manual which incorporates numbered headings, steps to follow, diagrams, etc. When using the bullet points, they align perfectly as I work through the processes. However when I include a diagram, or something different from the "norm" of text, the alignment changes. I would like all the bullet points to be aligned in the whole document regardless of where they appear in the document. Is there a way to save the settings so that the bullets always appear in the same position? Currently I am having to reset the indents by dragging the tabs on the ruler. This will be a large document, so I don't want to manually adjust the numbered bullets every time. Help would be greatly appreciated. Thanks very much.

    Read the article

  • jQuery: list appended not displaying bullets

    - by Shizhidi
    I have the following html: <!DOCTYPE html> <html> <head> <script src="http://code.jquery.com/jquery-latest.js"></script> </head> <body> <span>not so important</span> <span title="some specific text"><img src="/img/some.gif" /></span> <span title="more specific text">important 1</span> <span title="more specific text">important 2</span> <span title="more specific text">important 3</span> <span title="more specific text"><img src="/img/some.gif" /></span> <ul> <li>example 1</li> <li>example 2</li> <li>example 3</li> <ul> <script> var ul = $('body').append($('<ul>')); $("span[title*='specific text']") .contents() .filter(function(){ return $(this).nodeType != 1; }) .each(function(){ ul.append($('<li>' + $(this).text() + '</li>')); }) </script> </body> </html> I want to retrieve the text within a 'span' whose title attribute contains "specific text", in this case "important 1", "important 2" and "important 3". Then I want to list them below just like the example. However the bullets do not appear, why is that? Any hints would be appreciated!

    Read the article

  • Issues Converting Plain Text Into Microsoft Word Bulleted Lists

    - by user787832
    I'm a programmer. I hate status reports. I found a way to live with it. While I am working in my IDE ( Visual Slickedit ) I keep a plain text file open in one of the file/buffer tabs. As I finish things I just jot down a quick note into that file. At the end of the week that becomes my weekly status report. Example entries: The Datatables.net plugin runs very slowly in IE 8 with more than 2,000 records. I changed the way I did the server side code to process the data to make less work for the plugin to get decent performance for the IE 8 users. I made a class to wrap data from the new data collection objects into the legacy data holder objects. This will let the new database code be backward compatible with the legacy code until we can replace it. I found the bug reported by Jane. The software is fine. The database we use for the test site has data that is corrupted in a way it wouldn't be for production site At the end of the month I go back to each weekly *.txt file and paste all of the entries into a MS Word file for a monthly report. I give the monthly report to a liason to the contracting company who has to compile everyone's monthly reports into a single MS Word 2007 document. His problem, soon to be my problem, comes when he highlights my paragraphs like the ones above to put bullets in front of my paragraphs. When he highlights my notes to put bullets in front of them with MS Word 2007, Word rearranges the text a bit and the new line chars/carriage returns stagger the text so the text is no longer in neat chunks. This: I found the bug reported by Jane. The software is fine. The database we use for the test site has data that is corrupted in a way it wouldn't be for production site Becomes This: I found the bug reported by Jane. The software is fine. The database we use for the test site has data that is corrupted in a way it wouldn't be for production site I tried turning word wrap on in my IDE for the text files I put my status notes in. It just puts some kind of newline character in anyway. Searching/Replacing those chars in the text files has the result of destroying the paragraphs. Once my notes are pasted into MS Word, Word automatically translates them into paragraph breaks. Searching/Replacing them there has similar results. Blank lines separating the notes disappears. One big mess. What I would like is to be able to keep adding my status notes to a text file as I am now, but do something different when I paste the notes into MS Word such that my liason can select the text, hit the bulleting command and NOT have the staggered text as shown above. Any ideas? Thanks much in advance Steve

    Read the article

  • Bullets WILL NOT dissapear in firefox

    - by DunlopBurns
    Hoping you can help me with a problem. I cannot get rid of Bullets in Firefox, i don't want any anywhere, hence my list-style-type: none!important being everywhere. It only appears in Firefox as far as i can tell. the HTML.... <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> <head> <title>littleprints.nl</title> <meta name="description" content="----" /> <meta name="keywords" content="----" /> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script> <script type="text/javascript" src="js/slimbox2.js"></script> <link rel="stylesheet" href="css/slimbox2.css" type="text/css" media="screen" /> <link rel="stylesheet" href="layout.css"/> <link rel="stylesheet" href="style.css"/> </head> <body> <div id="container"> <div id="inline1"> <div id="mainpic"> <img src="myimages/circle.jpg" width="100%" alt="Circle bracelet"/> </div> <div id="intro"> <p>Hi and welcome to little prints NL. we make this and that all by hand with 100% silver. my name is Donna Burns and i work by commision, ive been studying for 4 years and am currently learning to become a goldsmith.</p> </div> </div> <div id="inline2"> <p>Click for more...</p> <div id="images"> <a href="myimages/photos/dogtag.jpg" rel="lightbox-gal" title="Beautiful, isn't it?" ><img src="myimages/work/chunky.gif" alt="chunky"/></a> <a href="myimages/photos/hearts.jpg" rel="lightbox-gal" title="Beautiful, isn't it?" ><img src="myimages/work/hearts.gif" alt="hearts"/></a> <a href="myimages/photos/close.jpg" rel="lightbox-gal" title="Beautiful, isn't it?" ><img src="myimages/work/close.gif" alt="close"/></a> <a href="myimages/photos/pearl.jpg" rel="lightbox-gal" title="Beautiful, isn't it?" >&nbsp;</a> <a href="myimages/photos/flower.jpg" rel="lightbox-gal" title="Beautiful, isn't it?" >&nbsp;</a> <a href="myimages/photos/frontcircle.jpg" rel="lightbox-gal" title="Beautiful, isn't it?" >&nbsp;</a> <a href="myimages/photos/dogtag.jpg" rel="lightbox-gal" title="Beautiful, isn't it?" >&nbsp;</a> </div> </div> </div><!--end container--> <div id="footer"> <div id="footalign"> <div id="social"> <ul> <li> <a href="http://www.facebook.com/littleprints" title="Little Prints"> <img src="myimages/facebook.png" width="50px" height="50px" alt="FB"/> </a> </li> <li> <a href="contact.html" title="contact"> <img src="myimages/at.gif" alt="@"/> </a> </li> </ul> </div> <div id="contact"> <p><br/>To enquire about a charm either phone:<br/> 0787463289<br/> or use one of the methods to the side.</p> </div> </div> </div> </body> </html> the CSS... * {margin: 0; padding: 0; border: 0;} html, body { background-color: #000000;image; text-align: center; font: 16px/1.8 Verdana, Arial, Helvetica, sans-serif; list-style-type: none!important; text-decoration: none;} #container { position: relative; width: 900px; top: 0; min-height: 100%; margin-left: auto; margin-right: auto; padding-top: 20px; background-image: URL(myimages/back2.gif); margin-bottom: 180px; } #footer { background-color: #555555; position: relative; clear: both; bottom: 0; width: 900px; height: auto; margin-left: auto; margin-right: auto; margin-bottom: 20px; padding-bottom: 22px; margin-top: -180px; } #inline1{ display: inline-block; margin-top: 250px; margin-bottom: 20px; } #inline2 { display: inline-block; margin-top: 30px; margin-bottom: 50px; } #mainpic { float: left; width: 68%; margin-left: 20px; } #intro { float: right; width: 20%; margin-left: auto; margin-right: 50px; margin-top: 20px; } #images { margin-bottom: 20px; margin-left: auto; margin-right: auto; } #footalign { display: inline; width:900px; list-style-type: none; } #contact { text-align: center; background-color:#555555; float: middle; list-style-type: none; } #social{ background-color:#555555; float: right; list-style: none; padding:0; padding-right: 5px; text-align:center; list-style-type: none!important; } #social img{ border: none; list-style-type: none!important; margin: 3px; } #social ul{ border: none; list-style-type: none!important; } #social a{ display:inline-block; -webkit-transition:all .5s ease-out; -moz-transition:all .5s ease-out; -ms-transition:all .5s ease-out; -o-transition:all .5s ease-out; transition:all .5s ease-out; list-style-type: none!important; } #social a:hover{ display:inline-block; -webkit-transform:translate(-10px,0px); -moz-transform:translate(0px,-10px); -ms-transform:translate(-10px,0px); -o-transform:translate(-10px,0px); transform:translate(-10px,0px); list-style-type: none!important; } #form { margin-top: 250px; margin-bottom: 50px; } .nav1 {font-family: sans-serif;font-size: 22px;text-shadow: 2px 2px 5px #000000;} a:link {text-decoration:none; color:#000000; padding:3px;} a:visited {text-decoration:none; color:#000000;} a:active {text-decoration:none; color:#555555;} a:hover {text-decoration:none; color:#555555;} .nav2 {font-family: sans-serif;font-size: 22px;text-shadow: 2px 2px 5px #ffffff;} a:link {text-decoration:none; color:#ffffff; padding:3px;} a:visited {text-decoration:none; color:#ffffff;} a:active {text-decoration:none; color:#555555;} a:hover {text-decoration:none; color:#555555;} .p1 { color: #ffffff; } div#images img { max-width: 500px; height: auto; }

    Read the article

  • JQuery UI Autocomplete showing as bullets

    - by awshepard
    The JQuery UI Demo page for autocomplete (link) has a nice looking search box and drop down with nice colors and highlights and such. When I implement it for myself, I end up with a bulleted list. How do I get my drop down of suggestions to look like theirs? A few notes/code fragments: I'm working in .NET land, so I'm using the <asp:ScriptManager> tag with <asp:ScriptReference>s inside it to get the hosted jquery.min.js (1.4.2) and jquery-ui.min.js (1.8.1) files from Google. My input box is fairly simple: <div class='ui-widget'> <label for="terms">Term: </label> <input id="terms" class="ui-autocomplete-input"> </div> My autocomplete looks like: $(""#terms"").autocomplete({source:""GetAttributesJSON.aspx"",minLength:2}); I get the correct data back, so that's not the issue. I just want fancy graphics. Any thoughts would be much appreciated.

    Read the article

1 2 3 4 5 6 7 8  | Next Page >