Daily Archives

Articles indexed Sunday November 27 2011

Page 3/12 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • How can I manage keyboard shortcuts in 11.10 Oneric?

    - by Mike
    In 10.04, I've had a keyboard shortcut defined via it's keyboard settings applet. Recently I have upgraded to 11.10 (I use gnome-classic). This shortcut still works, but I can't find it in System Setting's Keyboard applet. This means I don't know how to disable it. Not that it bothers me too much (now, at least), but not being able to control my own computer doesn't seem very pleasant. Where does Ubuntu store my keyboard shortcuts? BTW, I do not use compiz, and I can't find my shortcut in gconf either.

    Read the article

  • Desktop background won't change until restart

    - by Ben
    I'm new to Ubuntu and indeed Linux systems. I have 11.04 installed on my laptop. Here's the problem. When i select a picture for the desktop background, it says that Desktop Background has been changed but the changes do not apply right away. It is only after I have restarted the system that the changes will appear. This did not happen before. When i first started using this OS a few months ago the changes applied immediately. So what have i done that made this start acting wonky. Thank you for any help.

    Read the article

  • Wrong audio volume at boot

    - by skerit
    When I boot my computer and login the volume level is always way too loud. Unfortunately the only way to change it is a physical knob on my speaker. As soon as I can change the volume using my keyboard the volume immediately drops. Say the volume is at 100%, as soon as I turn the dial on my keyboard a little bit it drops to a normal level like 40% How do I get this to work in a clear way, like having it remember the audio level it was on at shutdown? Here's my audio card model: 82801JI (ICH10 Family) HD Audio Controller An Intel card on a Asus motherboard

    Read the article

  • Can't change folder background

    - by newcomer
    I tried to change via dragging from the Backgrounds and Emblems window, but the icon just goes back to that window rather than changing the folder background.However, I can change the task bar by this drag-n-drop. Probably it is something about changing ownership permission? if so how to change that? In /home/mashruf/.gconf/apps/nautilus/preferences/%gconf.xml file it says:, Should I change this file? how? <?xml version="1.0"?> <gconf> <entry name="click_policy" mtime="1297597800" type="string"> <stringvalue>single</stringvalue> </entry> <entry name="default_folder_viewer" mtime="1297597336" type="string"> <stringvalue>list_view</stringvalue> </entry> <entry name="media_autorun_x_content_open_folder" mtime="1297534321" type="list" ltype="string"> </entry> <entry name="media_autorun_x_content_ignore" mtime="1297534321" type="list" ltype="string"> </entry> <entry name="media_autorun_x_content_start_app" mtime="1297534321" type="list" ltype="string"> <li type="string"> <stringvalue>x-content/software</stringvalue> </li> </entry> <entry name="start_with_location_bar" mtime="1297300028" type="bool" value="true"/> <entry name="side_pane_view" mtime="1297269334" type="string"> <stringvalue>NautilusTreeSidebar</stringvalue> </entry> <entry name="navigation_window_saved_maximized" mtime="1297600306" type="bool" value="false"/> <entry name="navigation_window_saved_geometry" mtime="1297600306" type="string"> <stringvalue>964x608+59+2</stringvalue> </entry> <entry name="sidebar_width" mtime="1297390418" type="int" value="192"/> </gconf>

    Read the article

  • Kubuntu 11.10 very slow during file I/O

    - by dko
    After updating to Kubuntu 11.10, my file I/O performance has slowly just gotten worse and worse. It is to the point where I'm getting 1 MB/s write/read speeds to the drive. If I download something, the whole machine becomes unresponsive for at times up to 30 seconds. This usually causes a timeout in the download and the download then stops. Even extracting archive files, while extracting the computer is just unusable on top of the terrible read/write speeds. It isn't the drive as I have Windows installed as well and when I boot to it I have no issues with the drive. I did not have this issue using Kubuntu 11.04 and am thinking of downgrading. However, I'd much rather help out the Ubuntu community by working through these issues. I'm starting to lean towards the new Linux Kernel is just not working well with file handles. During file I/O my system usage does pick up, but it is not 100% CPU usage. My system is as follows. Samsung 2 TB hard disk drive AMD Phenom II x6 1055 4 GB RAM (only one in use according to system monitor) ATI 5850 HD

    Read the article

  • Can I use GNOME applets in Unity?

    - by Moma Antero
    Applets are small programs that you attach and start from the GNOME's toolbar. See picture: http://www.futuredesktop.com/audio-recorder/recorder-applet.ogv My favourite applets are: rec-applet: Smart audio recorder applet. You can get this from Launchpad. clipart-finder: Find and download clipart to your computer. You can get this from the Launchpad. 1) Can I use these applets in UNITY as is? 2) What changes I have to make to applets' code (rec-applet and clipart-finder) to make them usable in Unity? 3) Where is the applet-specification for Unity?

    Read the article

  • Oneiric desktop looks seriously defect after updates

    - by Matthijs
    Probably a coincidence, but after applying the fix to How to get the proper LightDM theme? and running the latest batch of updates, my desktop suddenly looked like this after rebooting: Funny thing is, it seems to be account specific, as my girlfriend's account seems unaffected. I can't logout because the whole entry is missing on the top right. Rebooting doesn't solve the issue. System settings (when run from the launcher) lacks a whole lot of icons and changeing the theme doesn't solve the problem (only changes the window top bar). I'm going to try the solution in How do I fix my theme? first, but if that doesn't work (likely, since I seem to have a slightly bigger problem than the one in that question) I'd love something else to try (other than creating a new account).

    Read the article

  • I can't install kbibtex (KD4)

    - by kacikuama
    I have ubuntu 11.10 and am trying to install the latest version of kbibtex but I can't do it. Anyone know how to do? I downloaded the tar.bz2 file from KD4 page (http://home.gna.org/kbibtex/download.html), followed the instructions but I get the following error: ~/kbibtex-0.4-beta1/build$ cmake ../ -DCMAKE_INSTALL_PREFIX=home -DCMAKE_BUILD_TYPE=BUILD_TYPE && make -- The C compiler identification is GNU -- The CXX compiler identification is GNU -- Check for working C compiler: /usr/bin/gcc -- Check for working C compiler: /usr/bin/gcc -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working CXX compiler: /usr/bin/c++ -- Check for working CXX compiler: /usr/bin/c++ -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done CMake Error at /usr/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:91 (MESSAGE): Could NOT find Qt4 (missing: QT_QMAKE_EXECUTABLE QT_MOC_EXECUTABLE QT_RCC_EXECUTABLE QT_UIC_EXECUTABLE QT_INCLUDE_DIR QT_LIBRARY_DIR QT_QTCORE_LIBRARY) Call Stack (most recent call first): /usr/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:252 (_FPHSA_FAILURE_MESSAGE) /usr/share/cmake-2.8/Modules/FindQt4.cmake:1162 (FIND_PACKAGE_HANDLE_STANDARD_ARGS) CMakeLists.txt:7 (find_package) -- Configuring incomplete, errors occurred! Someone can give me an idea of ??what's going on?

    Read the article

  • How to fix a dpkg broken by the Brother MFC-7340 deb driver

    - by Roman A. Taycher
    I'm getting an apt-get error that says E: The package brmfc7340lpr needs to be reinstalled, but I can't find an archive for it. (the brmfc7340lpr is a printer driver) its a local deb file, doing an dpkg or apt-get purge doesn't work, neither does apt-get install -f How do I reinstall a package from a local deb file? P.S. box-name% sudo apt-get upgrade [sudo] password for username: Reading package lists... Done Building dependency tree Reading state information... Done E: The package brmfc7340lpr needs to be reinstalled, but I can't find an archive for it. box-name% sudo apt-get purge brmfc7340lpr Reading package lists... Done Building dependency tree Reading state information... Done E: The package brmfc7340lpr needs to be reinstalled, but I can't find an archive for it. box-name% sudo dpkg --purge brmfc7340lpr dpkg: error processing brmfc7340lpr (--purge): Package is in a very bad inconsistent state - you should reinstall it before attempting a removal. Errors were encountered while processing: brmfc7340lpr box-name% sudo dpkg --install brmfc7340lpr-2.0.2-1.i386.deb Selecting previously deselected package brmfc7340lpr. (Reading database ... 725204 files and directories currently installed.) Preparing to replace brmfc7340lpr 2.0.2-1 (using .../brmfc7340lpr-2.0.2-1.i386.deb) ... Unpacking replacement brmfc7340lpr ... start: Unknown job: lpd dpkg: warning: subprocess old post-removal script returned error exit status 1 dpkg - trying script from the new package instead ... start: Unknown job: lpd dpkg: error processing brmfc7340lpr-2.0.2-1.i386.deb (--install): subprocess new post-removal script returned error exit status 1 start: Unknown job: lpd dpkg: error while cleaning up: subprocess new post-removal script returned error exit status 1 Errors were encountered while processing: brmfc7340lpr-2.0.2-1.i386.deb box-name% sudo apt-get install -f Reading package lists... Done Building dependency tree Reading state information... Done E: The package brmfc7340lpr needs to be reinstalled, but I can't find an archive for it. box-name%

    Read the article

  • Allow Firefox 8.0 access to /proc/[0-9]*/fd/?

    - by cvt76
    Today I discovered that Firefox 8.0 on Ubuntu 11.10 wanted to have read access to /proc/[0-9]*/fd/. I have made a custom usr.bin.firefox apparmor profile so I have spent many hours testing, but Firefox never wanted to have read access to the /proc/[0-9]*/fd/ directory before, and now suddenly it want it every time I browser the web. The orginal apparmor Firefox profile or any af the abstractions do not allow read access to /proc/[0-9]*/fd/ so I do not understand why this is suddenly happening. Does it sound reasonable that Firefox want to read the /proc/[0-9]*/fd/ directory? or is my system defective?

    Read the article

  • How do I align my partition table properly?

    - by Jorge Castro
    I am in the process of building my first RAID5 array. I've used mdadm to create the following set up: root@bondigas:~# mdadm --detail /dev/md1 /dev/md1: Version : 00.90 Creation Time : Wed Oct 20 20:00:41 2010 Raid Level : raid5 Array Size : 5860543488 (5589.05 GiB 6001.20 GB) Used Dev Size : 1953514496 (1863.02 GiB 2000.40 GB) Raid Devices : 4 Total Devices : 4 Preferred Minor : 1 Persistence : Superblock is persistent Update Time : Wed Oct 20 20:13:48 2010 State : clean, degraded, recovering Active Devices : 3 Working Devices : 4 Failed Devices : 0 Spare Devices : 1 Layout : left-symmetric Chunk Size : 64K Rebuild Status : 1% complete UUID : f6dc829e:aa29b476:edd1ef19:85032322 (local to host bondigas) Events : 0.12 Number Major Minor RaidDevice State 0 8 16 0 active sync /dev/sdb 1 8 32 1 active sync /dev/sdc 2 8 48 2 active sync /dev/sdd 4 8 64 3 spare rebuilding /dev/sde While that's going I decided to format the beast with the following command: root@bondigas:~# mkfs.ext4 /dev/md1p1 mke2fs 1.41.11 (14-Mar-2010) /dev/md1p1 alignment is offset by 63488 bytes. This may result in very poor performance, (re)-partitioning suggested. Filesystem label= OS type: Linux Block size=4096 (log=2) Fragment size=4096 (log=2) Stride=16 blocks, Stripe width=48 blocks 97853440 inodes, 391394047 blocks 19569702 blocks (5.00%) reserved for the super user First data block=0 Maximum filesystem blocks=0 11945 block groups 32768 blocks per group, 32768 fragments per group 8192 inodes per group Superblock backups stored on blocks: 32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968, 102400000, 214990848 Writing inode tables: ^C 27/11945 root@bondigas:~# ^C I am unsure what to do about "/dev/md1p1 alignment is offset by 63488 bytes." and how to properly partition the disks to match so I can format it properly.

    Read the article

  • Database Management System do exist?

    - by Bakaburg
    I want to build a database for my no-profit association, and i was planning to do it by myself. But then i realize that really i don't have the time to buid a solid, secure system. So i was thinking, maybe like cms do exist, maybe there are also database management systems. I mean a layer of abstraction over the database that allow you manage data, manage access to data, create widgets with and expand the data. Maybe with a frontend to use this data and a backend to manage it. that is a cms but not based on pages and post but on data! Moreover, i would like some standard solution, because my IT management position ends this year, so i need something that will be easy to use and expand even by someone that is not a developer. So do exist something that fit my need? PS: i would really like some modern and visually pleasant solution, javascritp and ajax heavy and that relies the fewest is possible on server and reloading of the pages.

    Read the article

  • Is there any reason to allow Yahoo! Slurp to crawl my site?

    - by James Skemp
    I thought a year or more ago Yahoo! would be using another search engine for results, and no longer using their own Slurp bot. However, a couple of the sites I manage Yahoo! Slurp continues to crawl pages, and seems to ignore the Gone status code when returned (as it keeps coming back). Is there any reason why I wouldn't want to block Yahoo! Slurp via robots.txt or by IP (since it tends to ignore robots.txt in some cases anyways)? I've confirmed that when the bot does hit it is from Yahoo! IPs, so I believe this is a legit instance of the bot. Is Yahoo Search the same as Bing Search now? is a related question, but I don't think it completely answers whether one should add a new block of the bot.

    Read the article

  • How much to charge Ruby on Rails Website [closed]

    - by eWizardII
    I figured it be appropriate to ask this question on webmasters, over the stackoverflow site seeing as there are similar questions here. I am freelancing for a client in the Boston area, who has the html/css templates for their site made by another web designer. They are basically looking for someone to set up the template, and then make the backend so that a user can purchase music on their site (they are musicians). I am wondering then what would be an appropriate amount to charge them to develop such a system, I am a student, and this would be my 3rd Ruby on Rails project, but probably at least the 20 web design project I have been hired to do and I have other programming knowledge, Python, C, etc. I am thinking of suggesting that they pay 1000usd to set up such a system, but I don't know if this is appropriate. To me it seems justifiable given my experience, and the low end of RoR developers I have seen charging 25usd/hr all the way up to 150usd/hr. Any advice would be appreciated.

    Read the article

  • Book recommend: Start learning web design with css with basic HTML knowledge

    - by Minh Hieu
    I've already known some HTML, tables, link, image,...etc but just at a basic level. Now I want to learn how to build a layout for a website and design also. I want to start building a layout right a way and just learning from it, not really like reading so much theories, explanations. Many books are so verbose, they teach from the beginning of HTML or explain things too much. I don't want to waste my time. So are there any good books for me?

    Read the article

  • Bingbot seems to be adding "ForceRecrawl: 0" to URLs when crawling my sites

    - by Louis Somers
    I'm seeing this in the iis-logs of two websites that I maintain: GET /an/existing/page/on/my/site+ForceRecrawl:+0 - 80 - 207.46.195.105 HTTP/1.1 Mozilla/5.0+(compatible;+bingbot/2.0;++http://www.bing.com/bingbot.htm) I get about one or two of these per day from these IP addresses: 207.46.195.105, 65.52.110.190.. an more, all belonging to msnbot-ip.search.msn.com Probably Microsoft has a bug in their crawler? Any way, doing a search on "ForceRecrawl: 0" in major search engines comes up with a bunch of random sites. Doing the search on StackOverflow or here gave no results (to my amazement). Am I the only one seeing this? I first noticed these on the 9th of this month, and I'm seeing them pass almost daily since... Another thing that I think is crazy, is that the URL http://www.bing.com/bingbot.htm redirects to mail.live.com (hotmail). Currently I'm returning 404's but I'm considering to catch these, strip the trailing " ForceRecrawl: 0" and process as if it were a legitimate url. Could anyone shed some light on this? Could it have to do with some configuration or so in Bing's Webmaster Tools?

    Read the article

  • Buy internet country domain name: .fr .co.uk .de .com.au .sg etc

    - by user700580
    I already bought a domain name .com on godaddy for my company. I would like to reserve the same name with country specific domain extention, but not sure where to buy them and how to do it. Here are the ones that I would like to buy: Europe: fr, co.uk, de, ch, es, it, nl, se, no, ru australia: com.au asia: sg Godaddy has all except 1 in europe, australia and singapore. Should I find a website that sell all of them or should I buy some of them in godaddy and others elsewhere? Any suggestions where to buy them? Until now i've always buy .com domain names only so not sure how to do it. Thanks

    Read the article

  • XNA Easy Storage XBOX 360 High Scores

    - by user1003211
    To followup from a previous query - I need some help with the implementation of easystorage high scores, which is bringing up some errors on the xbox. I get the prompt screen, a savedevice is selected and a file are all created! However the file remains empty, (I've tried prepopulating but still get errors). The full portions of the scoring code can be found here: http://pastebin.com/74v897Yt The current issue in particular is in LoadHighScores() - "There is an error in XML document (0, 0)." under line data = (HighScoreData)serializer.Deserialize(stream); I'm not sure whether this line is correct either: HighScoreData data = new HighScoreData(); public static HighScoreData LoadHighScores(string container, string filename) { HighScoreData data = new HighScoreData(); if (Global.SaveDevice.FileExists(container, filename)) { Global.SaveDevice.Load(container, filename, stream => { File.Open(Global.fileName_options, FileMode.OpenOrCreate, FileAccess.Read); try { // Read the data from the file XmlSerializer serializer = new XmlSerializer(typeof(HighScoreData)); data = (HighScoreData)serializer.Deserialize(stream); } finally { // Close the file stream.Close(); // stream.Dispose(); } }); } return (data); } I call: PromptMe(); when the Start button is pressed at the beginning. I call: if (Global.SaveDevice.IsReady){entries = LoadHighScores(HighScoresContainer, HighScoresFilename);} during the menu screen to try and display the highscore screen. I call: SaveHighScore(); when game ends. I've tried altering the struct code to a class but still no luck. Any help greatly appreciated.

    Read the article

  • Axis-Aligned Bounding Boxes vs Bounding Ellipse

    - by Griffin
    Why is it that most, if not all collision detection algorithms today require each body to have an AABB for the use in the broad phase only? It seems to me like simply placing a circle at the body's centroid, and extending the radius to where the circle encompasses the entire body would be optimal. This would not need to be updated after the body rotates and broad overlap-calculation would be faster to. Correct? Bonus: Would a bounding ellipse be practical for broad phase calculations also, since it would better represent long, skinny shapes? Or would it require extensive calculations, defeating the purpose of broad-phase?

    Read the article

  • XNA 3D model collision is inaccurate

    - by Daniel Lopez
    I am creating a classic game in 3d that deals with asteriods and you have to shoot them and avoid being hit from them. I can generate the asteroids just fine and the ship can shoot bullets just fine. But the asteroids always hit the ship even it doesn't look they are even close. I know 2D collision very well but not 3D so can someone please shed some light to my problem. Thanks in advance. Code For ModelRenderer: using System; using System.Collections.Generic; using System.Linq; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Audio; using Microsoft.Xna.Framework.Content; using Microsoft.Xna.Framework.GamerServices; using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Input; using Microsoft.Xna.Framework.Media; namespace _3D_Asteroids { class ModelRenderer { private float aspectratio; private Model model; private Vector3 camerapos; private Vector3 modelpos; private Matrix rotationy; float radiansy = 0; private bool isalive; public ModelRenderer(Model m, float AspectRatio, Vector3 initial_pos, Vector3 initialcamerapos) { isalive = true; model = m; if (model.Meshes.Count == 0) { throw new Exception("Invalid model because it contains zero meshes!"); } modelpos = initial_pos; camerapos = initialcamerapos; aspectratio = AspectRatio; return; } public float RadiusOfSphere { get { return model.Meshes[0].BoundingSphere.Radius; } } public BoundingBox BoxBounds { get { return BoundingBox.CreateFromSphere(model.Meshes[0].BoundingSphere); } } public BoundingSphere SphereBounds { get { return model.Meshes[0].BoundingSphere; } } public Vector3 CameraPosition { set { camerapos = value; } get { return camerapos; } } public bool IsAlive { get { return isalive; } } public Vector3 ModelPosition { set { modelpos = value; } get { return modelpos; } } public void RotateY(float radians) { radiansy += radians; rotationy = Matrix.CreateRotationY(radiansy); } public Matrix RotationY { set { rotationy = value; } get { return rotationy; } } public float AspectRatio { set { aspectratio = value; } get { return aspectratio; } } public void Kill() { isalive = false; } public void Draw(float scale) { Matrix world; if (rotationy == new Matrix(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)) { world = Matrix.CreateScale(scale) * Matrix.CreateTranslation(modelpos); } else { world = rotationy * Matrix.CreateScale(scale) * Matrix.CreateTranslation(modelpos); } Matrix view = Matrix.CreateLookAt(camerapos, Vector3.Zero, Vector3.Up); Matrix projection = Matrix.CreatePerspectiveFieldOfView(MathHelper.ToRadians(45.0f), this.AspectRatio, 1f, 100000f); foreach (ModelMesh mesh in model.Meshes) { foreach (BasicEffect effect in mesh.Effects) { effect.World = world; effect.View = view; effect.Projection = projection; } mesh.Draw(); } } public void Draw() { Matrix world; if (rotationy == new Matrix(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)) { world = Matrix.CreateTranslation(modelpos); } else { world = rotationy * Matrix.CreateTranslation(modelpos); } Matrix view = Matrix.CreateLookAt(camerapos, Vector3.Zero, Vector3.Up); Matrix projection = Matrix.CreatePerspectiveFieldOfView(MathHelper.ToRadians(45.0f), this.AspectRatio, 1f, 100000f); foreach (ModelMesh mesh in model.Meshes) { foreach (BasicEffect effect in mesh.Effects) { effect.World = world; effect.View = view; effect.Projection = projection; } mesh.Draw(); } } } Code For Game1: using System; using System.Collections.Generic; using System.Linq; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Audio; using Microsoft.Xna.Framework.Content; using Microsoft.Xna.Framework.GamerServices; using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Input; using Microsoft.Xna.Framework.Media; namespace _3D_Asteroids { /// <summary> /// This is the main type for your game /// </summary> public class Game1 : Microsoft.Xna.Framework.Game { GraphicsDeviceManager graphics; int score = 0, lives = 5; SpriteBatch spriteBatch; GameState gstate = GameState.OnMenuScreen; Menu menu = new Menu(Color.Yellow, Color.White); SpriteFont font; Texture2D background; ModelRenderer ship; Model b, a; List<ModelRenderer> bullets = new List<ModelRenderer>(); List<ModelRenderer> asteriods = new List<ModelRenderer>(); float time = 0.0f; int framecount = 0; SoundEffect effect; public Game1() { graphics = new GraphicsDeviceManager(this); graphics.PreferredBackBufferWidth = 1280; graphics.PreferredBackBufferHeight = 796; graphics.ApplyChanges(); Content.RootDirectory = "Content"; } /// <summary> /// Allows the game to perform any initialization it needs to before starting to run. /// This is where it can query for any required services and load any non-graphic /// related content. Calling base.Initialize will enumerate through any components /// and initialize them as well. /// </summary> protected override void Initialize() { // TODO: Add your initialization logic here base.Initialize(); } /// <summary> /// LoadContent will be called once per game and is the place to load /// all of your content. /// </summary> protected override void LoadContent() { // Create a new SpriteBatch, which can be used to draw textures. spriteBatch = new SpriteBatch(GraphicsDevice); font = Content.Load<SpriteFont>("Fonts\\Lucida Console"); background = Content.Load<Texture2D>("Textures\\B1_stars"); Model p1 = Content.Load<Model>("Models\\p1_wedge"); b = Content.Load<Model>("Models\\pea_proj"); a = Content.Load<Model>("Models\\asteroid1"); effect = Content.Load<SoundEffect>("Audio\\tx0_fire1"); ship = new ModelRenderer(p1, GraphicsDevice.Viewport.AspectRatio, new Vector3(0, 0, 0), new Vector3(0, 0, 9000)); } /// <summary> /// UnloadContent will be called once per game and is the place to unload /// all content. /// </summary> protected override void UnloadContent() { } /// <summary> /// Allows the game to run logic such as updating the world, /// checking for collisions, gathering input, and playing audio. /// </summary> /// <param name="gameTime">Provides a snapshot of timing values.</param> protected override void Update(GameTime gameTime) { KeyboardState state = Keyboard.GetState(PlayerIndex.One); switch (gstate) { case GameState.OnMenuScreen: { if (state.IsKeyDown(Keys.Enter)) { switch (menu.SelectedChoice) { case MenuChoices.Play: { gstate = GameState.GameStarted; break; } case MenuChoices.Exit: { this.Exit(); break; } } } if (state.IsKeyDown(Keys.Down)) { menu.MoveSelectedMenuChoiceDown(gameTime); } else if(state.IsKeyDown(Keys.Up)) { menu.MoveSelectedMenuChoiceUp(gameTime); } else { menu.KeysReleased(); } break; } case GameState.GameStarted: { foreach (ModelRenderer bullet in bullets) { if (bullet.ModelPosition.X < (ship.ModelPosition.X + 4000) && bullet.ModelPosition.Z < (ship.ModelPosition.X + 4000) && bullet.ModelPosition.X > (ship.ModelPosition.Z - 4000) && bullet.ModelPosition.Z > (ship.ModelPosition.Z - 4000)) { bullet.ModelPosition += (bullet.RotationY.Forward * 120); } else if (collidedwithasteriod(bullet)) { bullet.Kill(); } else { bullet.Kill(); } } foreach (ModelRenderer asteroid in asteriods) { if (ship.SphereBounds.Intersects(asteroid.BoxBounds)) { lives -= 1; asteroid.Kill(); // This always hits no matter where the ship goes. } else { asteroid.ModelPosition -= (asteroid.RotationY.Forward * 50); } } for (int index = 0; index < asteriods.Count; index++) { if (asteriods[index].IsAlive == false) { asteriods.RemoveAt(index); } } for (int index = 0; index < bullets.Count; index++) { if (bullets[index].IsAlive == false) { bullets.RemoveAt(index); } } if (state.IsKeyDown(Keys.Left)) { ship.RotateY(0.1f); if (state.IsKeyDown(Keys.Space)) { if (time < 17) { firebullet(); //effect.Play(); } } else { time = 0; } } else if (state.IsKeyDown(Keys.Right)) { ship.RotateY(-0.1f); if (state.IsKeyDown(Keys.Space)) { if (time < 17) { firebullet(); //effect.Play(); } } else { time = 0; } } else if (state.IsKeyDown(Keys.Up)) { ship.ModelPosition += (ship.RotationY.Forward * 50); if (state.IsKeyDown(Keys.Space)) { if (time < 17) { firebullet(); //effect.Play(); } } else { time = 0; } } else if (state.IsKeyDown(Keys.Space)) { time += gameTime.ElapsedGameTime.Milliseconds; if (time < 17) { firebullet(); //effect.Play(); } } else { time = 0.0f; } if ((framecount % 60) == 0) { createasteroid(); framecount = 0; } framecount++; break; } } base.Update(gameTime); } void firebullet() { if (bullets.Count < 3) { ModelRenderer bullet = new ModelRenderer(b, GraphicsDevice.Viewport.AspectRatio, ship.ModelPosition, new Vector3(0, 0, 9000)); bullet.RotationY = ship.RotationY; bullets.Add(bullet); } } void createasteroid() { if (asteriods.Count < 2) { Random random = new Random(); float z = random.Next(-13000, -11000); float x = random.Next(-9000, -8000); Random random2 = new Random(); int degrees = random.Next(0, 45); float radians = MathHelper.ToRadians(degrees); ModelRenderer asteroid = new ModelRenderer(a, GraphicsDevice.Viewport.AspectRatio, new Vector3(x, 0, z), new Vector3(0,0, 9000)); asteroid.RotateY(radians); asteriods.Add(asteroid); } } /// <summary> /// This is called when the game should draw itself. /// </summary> /// <param name="gameTime">Provides a snapshot of timing values.</param> protected override void Draw(GameTime gameTime) { GraphicsDevice.Clear(Color.CornflowerBlue); switch (gstate) { case GameState.OnMenuScreen: { spriteBatch.Begin(); spriteBatch.Draw(background, Vector2.Zero, Color.White); menu.DrawMenu(ref spriteBatch, font, new Vector2(GraphicsDevice.Viewport.Width / 2, GraphicsDevice.Viewport.Height / 2) - new Vector2(50f), 100f); spriteBatch.End(); break; } case GameState.GameStarted: { spriteBatch.Begin(); spriteBatch.Draw(background, Vector2.Zero, Color.White); spriteBatch.DrawString(font, "Score: " + score.ToString() + "\nLives: " + lives.ToString(), Vector2.Zero, Color.White); spriteBatch.End(); ship.Draw(); foreach (ModelRenderer bullet in bullets) { bullet.Draw(); } foreach (ModelRenderer asteroid in asteriods) { asteroid.Draw(0.1f); } break; } } base.Draw(gameTime); } bool collidedwithasteriod(ModelRenderer bullet) { foreach (ModelRenderer asteroid in asteriods) { if (bullet.SphereBounds.Intersects(asteroid.BoxBounds)) { score += 10; asteroid.Kill(); return true; } } return false; } } } }

    Read the article

  • matrix 4x4 position data

    - by freefallr
    I understand that a 4x4 matrix holds rotation and position data. The rotation data is held in the 3x3 sub-matrix at the top left of the matrix. The position data is held in the last column of the matrix. e.g. glm::vec3 vParentPos( mParent[3][0], mParent[3][1], mParent[3][2] ); My question is - am I accessing the parent matrix correctly in the example above? I know that opengl uses a different matrix ordering that directx, (row order instead of column order or something), so, should the mParent be accessed as follows instead? glm::vec3 vParentPos( mParent[0][3], mParent[1][3], mParent[2][3] ); thanks!

    Read the article

  • help animating player in corona sdk

    - by andrew McCutchan
    working on a game in the corona sdk with lua and I need help so the player animates on the line drawn. Right now he animates at the beggining and the end but not on the line. here is the player code function spawnPlayerObject(xPlayerSpawn,yPlayerSpawn,richTurn) --spawns Rich where we need him. -- riches sprite sheet and all his inital spirites. We need to adjust this so that animations 3-6 are the only ones that animate when moving horizontally local richPlayer = sprite.newSpriteSet(richSheet1,1,6) sprite.add(richPlayer, "rich", 1,6,500,1) rich = sprite.newSprite(richPlayer) rich.x = xPlayerSpawn rich.y = yPlayerSpawn rich:scale(_W*0.0009, _W*0.0009) -- scale is used to adjust the size of the object. richDir = richTurn rich.rotation = richDir rich:prepare("rich") rich:play() physics.addBody( rich, "static", { friction=1, radius = 15 } ) -- needs a better physics body for collision detection. end and here is the code for the line function movePlayerOnLine(event) --for the original image replace all rich with player. if posCount ~= linePart then richDir = math.atan2(ractgangle_hit[posCount].y-rich.y,ractgangle_hit[posCount].x-rich.x)*180/math.pi playerSpeed = 5 rich.x = rich.x + math.cos(richDir*math.pi/180)*playerSpeed rich.y = rich.y + math.sin(richDir*math.pi/180)*playerSpeed if rich.x < ractgangle_hit[posCount].x+playerSpeed*10 and rich.x > ractgangle_hit[posCount].x-playerSpeed*10 then if rich.y < ractgangle_hit[posCount].y+playerSpeed*10 and rich.y > ractgangle_hit[posCount].y-playerSpeed*10 then posCount = posCount + 1 end end I don't think anything has changed recently but I have been getting an error when testing of " attempt to upvalue "rich" a nil value" on the second line, richDir = etc.

    Read the article

  • 2D XNA C#: Texture2D Wrapping Issue

    - by Kieran
    Working in C#/XNA for a Windows game: I'm using Texture2D to draw sprites. All of my sprites are 16 x 32. The sprites move around the screen as you would expect, by changing the top X/Y position of them when they're being drawn by the spritebatch. Most of the time when I run the game, the sprites appear like this: and when moved, they move as I expect, as one element. Infrequently they appear like this: and when moved it's like there are two sprites with a gap in between them - it's hard to describe. It only seems to happen sometimes - is there something I'm missing? I'd really like to know why this is happening. [Edit:] Adding Draw code as requested: This is the main draw routine - it first draws the sprite to a RenderTarget then blows it up by a scale of 4: protected override void Draw(GameTime gameTime) { // Draw to render target GraphicsDevice.SetRenderTarget(renderTarget); GraphicsDevice.Clear(Color.CornflowerBlue); Texture2D imSprite = null; spriteBatch.Begin(SpriteSortMode.FrontToBack, null, SamplerState.PointWrap, null, null); ManSprite.Draw(spriteBatch); base.Draw(gameTime); spriteBatch.End(); // Draw render target to screen GraphicsDevice.SetRenderTarget(null); imageFrame = (Texture2D)renderTarget; GraphicsDevice.Clear(ClearOptions.Target | ClearOptions.DepthBuffer, Color.DarkSlateBlue, 1.0f, 0); spriteBatch.Begin(SpriteSortMode.FrontToBack, null, SamplerState.PointClamp, null, null); spriteBatch.Draw(imageFrame, new Vector2(0, 0), null, Color.White, 0, new Vector2(0, 0), IM_SCALE, SpriteEffects.None, 0); spriteBatch.End(); } This is the draw routine for the Sprite class: public virtual void Draw(SpriteBatch spriteBatch) { spriteBatch.Draw(Texture, new Vector2(PositionX, PositionY), null, Color.White, 0.0f, Vector2.Zero, Scale, SpriteEffects.None, 0.3f); }

    Read the article

  • Looking for a royalty free sci-fi sounding song thats 1:00+ long, and costs <= $5

    - by CyanPrime
    I'm looking for a royalty free sci-fi sounding song thats 1:00+ long, and costs less then, or is $5 usd. I want to have a nice BGM for my engine demo I'm going to release for a game I'm planing on having go commercial. I don't want to spend too much money on it, so my limit is $5 usd. I want it to be at least a 1:00 in length. Where should I look? Or even better, do you have a link to a song that meets the criteria?

    Read the article

  • Collision filtering techniques

    - by Griffin
    I was wondering what efficient techniques are out there for mapping collision filtering between various bodies, sub-bodies, and so forth. I'm familiar with the simple idea of having different layers of 2D bodies, but this is not sufficient for more complex mapping: (Think of having sub-bodies of a body, such as limbs, collide with each other by placing them on the same layer, and then wanting to only have the legs collide with the ground while the arms would not) This can be solved with a multidimensional layer setup, but I would probably end up just creating more and more layers to the point where the simplicity and efficiency of layer filtering would be gone. Are there any more complex ways to solve even more complex situations than this?

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >