Daily Archives

Articles indexed Wednesday November 21 2012

Page 16/17 | < Previous Page | 12 13 14 15 16 17  | Next Page >

  • MP4 files show up but won't stream to xbox 360

    - by Greg
    I set up a basic media server to stream to my 360 using uShare. Here are the instructions I used: http://linuxexpresso.wordpress.com/2011/01/02/howto-ubuntu-upnp-server-to-xbox-360/. I can stream avi files fine but I cannot stream mp4s. When I go to videos on the xbox, I can see all of the videos and folders but when I click play for an mp4 nothing happens. On my ubuntu desktop I can click on the mp4 file and it plays fine. And if I take that file, stick it on a thumb drive and plug it directly into the xbox the mp4 will play off the thumb drive. I'm lost for why it won't work through ushare. Any ideas?

    Read the article

  • Dual monitor not working completely in 12.10 after upgrade

    - by Mark Baldridge
    At 12.04, dual monitors worked perfectly. After upgrading to 12.10, the primary monitor works, the second monitor only partly works. I am sure there is some difference between the releases that I have missed setting properly. System settings - Displays show both correctly as Acer 22" monitors at 1680x1050 (16:10). An icon on monitor 2 is present, but elongated; almost an artifact, since other icons on the primary screen are absent, but this one icon is there on th second monitor. Selecting the icons on both screens exist. Painting is weird on monitor 2. Launcher exists and works on both screens, but even with sticky edges off, the cursor stops at the left edge of monitor 2. Clicking on text editor on screen 2 launcer will launch gedit there. If I drag it, it leaves a trail of after images like repaint is failing. If I drive the cursor on the launcher, the help tags like "LibreOffice Writer" appear, but stay on screen unless I drag the active gedit window over them. Then part of the help bubbles are overwritten, leaving behind after images of the gedit window on screen. What is really fascinating is that the System settings - Displays is now ignoring monitor selection, after allowing it earlier. Just before this, the help popup which said "Select a monitor to change its properties; drag to rearrange its placement" actually let me do that. Maybe a trick of where I grab the edge of the monitor in the Displays setting. I just found a working handle. When I drag monitor 1 to the right of monitor 2, "Apply" and confirm, both monitors work normally (although the right monitor lets the cursor slide off the right edge onto the left edge of monitor 1 - which sounds correct). Painting of windows does not leave an after image. However, success is only temporary. The setting survives the reboot, but painting on the left monitor, now monitor 2, now replicates the issues from before. The after image of the gedit window and the small window for "Are you sure you want to close all programs and restart the computer?" are still on monitor 2 (on the left now), even though they are not real windows, nor do they have processes behind them. Curiously, in Displays, the "green" monitor on the left in the display window is matched by the right monitor color in the monitor upper left corner. Probably makes sense as the one on the right is now monitor 1. If I repeat the "drag the left monitor to the right of the right monitor on the "Displays" window, things are oriented properly, with no display artifacts as I drag windows around either screen. Also the description bubbles that pop up are overwritten on both screens, so none of those artifacts either. This goodness does not survive a reboot, however. Have not tried logging out and back in. All of this after positing that the motherboard VGA and HDMI ports could have been the issue. So, I installed an e-GeForce 7600 GT Dual DVI (I know the web thinks it is not DVI, but VGA, but the connectors are DVI). No change to the weird behavior. The good parts continue to work, the weirdness also works, and swapping monitor positions seems to cure the issue. So, is there a setting I have missed? Given "swapping" monitor 1 and 2 on the System Settings... - Displays makes it work, just not across boot, I suspect so.

    Read the article

  • What package (helper app) does recoll need to index images?

    - by hobs
    The File->Show_missing_helpers menu item in the recoll GUI mentions the following missing helper (among others): Perl::Image::ExifTool (image/gif image/jpeg image/png image/tiff image/x-xcf) Per the recoll user manual I installed the perl image exif tool (and library): sudo aptitude install libimage-exif-perl libimage-exiftool-perl but recoll still lists the missing helper and fails to index images. uname -a: Linux AlSSD 3.2.0-30-generic #48-Ubuntu SMP Fri Aug 24 16:52:48 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux

    Read the article

  • Can you install ubuntu on xp and then uninstall xp? how?

    - by Eli
    I have a problem with my pc, you can read about it here if you like http://yhoo.it/qIQyMw anyway, I might go for ubuntu, the thing is I'm in Lebanon and here few, very few people use linux, most of them never heard about ubuntu lol, therefore you'll be really lucky if you can buy an ubuntu cd or even if you find someone can find someone capable of installing it. So when they fix my pc, they might install xp coz they don't have a linux operating system, and i hate win 7 and vista so I'll have to download ubuntu and install it by myself, I don't want to dual boot coz i don't have a super computer lol, i have used ubuntu on my vps, never on desktop before so i would like to know if you can download ubuntu, install it, on a xp pro, then remove xp pro? is there any tutorial? thank you

    Read the article

  • Maximal screen resolution for external monitor breaks desktop

    - by Robiston
    Whenever I'm plugging in my external monitor into my notebook and changing the screen resolution to the maximum state, the desktop will get broken in a way: A third of the whole desktop space is not visible at all. I can see the whole panel as well as the Unity side bar to the left, but the desktop space with all the windows in it is not completely visible. It's blanked out. In case of opening the Unity menu bar, I can type something in it. As soon as close the menu bar, the upper part stays visible and hangs: Any ideas about that issue?

    Read the article

  • Stop Screenlets from minimizing

    - by Capt.Nemo
    I've setup my screenlets exactly the way that I want them, but I don't have a quick access to any of them. The screenlet config offers me the following : keep above,below, sticky, locky, widget. Out of these only treat as Widget seems to be of any use here. I just looked at this in detail and thought it was what I was looking for. It might have been a workaround for the issue (instead of minimizing I would just press F9. But this means that the widget hides itself from the normal desktop, which is not what I want. What I want is that on pressing Ctrl+Alt+D or Super+D, I should see the desktop with my screenlets there. I don't want them to minimize with the rest of the windows. As a final struggle, I've thought of a solution using compiz to declare the screenlet windows as non-minimizing, but surely there must be a better way than that. (Instructions for this would be helpful as well - I'm not sure what to enter in the rule matches)

    Read the article

  • GUI keyword confusion

    - by richzilla
    Ive been using linux for some time, and ive never quite got my head around the various keywords attached to the GUI. I think i understand the difference between the likes of KDE and Gnome - They are collections of applications and other software that make up a given gui environment. However a quick read through any vaguely technical linux websites will reveal terms like: Murrine Clearlooks GTK Beryl Metacity Window manager Which if im honest, i have no real idea what they mean and how they all relate to each other. Can anybody clarify?

    Read the article

  • OpenJs mysql not reading database [migrated]

    - by Benedikt Wutzi
    I try to access a mysql table using OpenJs Grid. I already doublechecked if the database "partsdb" and the table "parts" exists and it can be accessed from the commandline. Currently I'm using the must basic example: members.php: <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>Members Page</title> <script> $(function() { $(".parts").grid(); }); </script> </head> <body> <div id="container"> <h1>Members Page</h1> <table action="ajax.php"> <tr> <th col="id">Id</th> <th col="name">Name</th> </tr> </table> <a href='<?php echo base_url()."main/logout" ?>'>Logout</a> </div> and ajax.php <?php mysql_connect("localhost","****","*****"); mysql_select_db("partsdb"); require_once("grid.php"); $grid = new Grid("parts"); ?> When I run php directly on ajax.php I get an error telling me: " Unknown column 'parts.' in 'field list' " and the table shows only the headers. What am I doing wrong?

    Read the article

  • Mail Hosting That Will Allow Outbound Bulk Mail?

    - by user249493
    No, I'm not a spammer! I do volunteer work for a non-profit social services agency. They send out daily email with several hundred recipients on each message. Their web hosting company has been flagging the email as spam due to the volume. So I'm looking for an email hosting provider that won't do that. (I can separate out the web hosting function; we just need mail hosting right now.) They can't use something like MailChimp, Constant Contact, or Vertical Response because some of the mail is just inbound emails they aggregate and send out, and they don't want the overhead of "rebuilding" it in a "newsletter" service. I think that Google Apps for Business might be a good solution, but the pricing is just too high for this under-funded non-profit. I've applied for the non-profit discount but haven't heard back yet. Is there mail hosting service that might fit their needs? Thanks in advance.

    Read the article

  • # id - urls with id first display full page, then move to #id

    - by guisasso
    I've noticed this in the new version of chrome, and ie9 and 10. Some urls in a photo gallery have a #id tag as they are supposed to display a full view of a picture. Basically, a div in a lower position on the page has that #id that i call via a.com/1.html#id. This has never been an issue until lately, when i noticed a bit of a lag. The issue: The website loads normally, then the view moves to the #id as supposed, but with some lag sometimes, perhaps because of the high resolution of the picture, which is somewhat noticeable. Anyway to avoid this, or make it so the page would move to the correct #id even before fully loaded?

    Read the article

  • Stop a rotating object at a specified angle?

    - by Krummelz
    I'm working in JavaScript with HTML5 and the canvas. I have an object which is rotating at a certain speed, and I need the object's rotation to slow down gradually and the front of the object to stop at a specified angle. (I'm using radians, not degrees.) I have a variable to keep track of the angle which the object is facing, as it rotates. How would I go about getting the object to come to rest, facing the direction I want it to?

    Read the article

  • Help to organize game cycle in Java

    - by ASIO22
    I'm pretty new here (as though to a game development). So here's my question. I'm trying to organize a really simple game cycle in my public static main() as follows: Scanner sc = new Scanner(System.in); //Running the game cycle boolean flag=true; while (flag) { int action; System.out.println("Type your action please:"); System.out.println("0: Exit app"); try { action = sc.nextInt(); switch (action) { case 0: flag=false; break; case 1: break; } } catch (InputMismatchException ex) { System.out.println(ex.getClass() + "\n" + "Please type a correct input\n"); //action = sc.nextInt(); continue; } What's wrong with this cycle: I want to catch an exception when user types text instead of number, show a message, warning user, and the continue game cycle, read user input etc. But instead of that, when users types wrong data, it goes into a eternal cycle without even prompting user. What I did wrong?

    Read the article

  • Entity Type specific updates in entity component system

    - by Nathan
    I am currently familiarizing myself with the entity component paradigm. For an example, take a collision system, that detects if entities collide and if they do let them explode. So the collision system has to test collision based on the position component and then set the state of those entities to exploding. But what if the "effect" (setting the state to exploding) is different for different entities? For example, a ship fades out while for an asteroid a particle system must be created. Since entities and components are only data, this must happen in some system. The collision system could do it, but then it must switch over the entity type, which in my opinion is a cumbersome and difficult to extend solution. So how do I trigger "entity type dependend" updates on an entity?

    Read the article

  • Events Driven Library XNA C#

    - by SchautDollar
    Language: C# w/ XNA Framework Relevant and Hopefully Helpful Background Info: I am making a library using the XNA framework for games I make with XNA. The Library has a folder(Namespace) dedication to the GUI. The GUI Controls inherit a base class hooked with the appropriate Interfaces. After a control is made, the programmer can hook the control with a "Frame" or "Module" that will tell the controls when to update and draw with an event. To make a "Frame" or "Module", you would inherit a class with the details coded in. (Kind of how win forms does it.) My reason for doing this is to simplify the process of creating menus with intractable controls. The only way I could think of for making the events for all the controls to function without being class specific would be to typecast a control to an object and typecast it back. (As I have read, this can be terribly inefficient.) Problem: Unfortunately, after I have implemented interfaces into the base classes and changed public delegate void ClickedHandler(BaseControl cntrl); to public delegate void ClickedHandler(Object cntrl, EventArgs e); my game has decreased in performance. This performance could be how I am firing the events, as what happens is the one menu will start fine, but then slowly but surely will freeze up. Every other frame works just fine, I just think it has something to do with the events and... that is why I am asking about them. Question: Is there a better more industry way of dealing with GUI Libraries other then using and implementing Events? Goal: To create a reusable feature rich XNA Control Library implementing performance enhancing standards and so on. Thank-you very much for taking your time to read this. I also hope this will help others possibly facing what I am facing right now.

    Read the article

  • 2D Selective Gaussian Blur

    - by Joshua Thomas
    I am attempting to use Gaussian blur on a 2D platform game, selectively blurring specific types of platforms with different amounts. I am currently just messing around with simple test code, trying to get it to work correctly. What I need to eventually do is create three separate render targets, leave one normal, blur one slightly, and blur the last heavily, then recombine on the screen. Where I am now is I have successfully drawn into a new render target and performed the gaussian blur on it, but when I draw it back to the screen everything is purple aside from the platforms I drew to the target. This is my .fx file: #define RADIUS 7 #define KERNEL_SIZE (RADIUS * 2 + 1) //----------------------------------------------------------------------------- // Globals. //----------------------------------------------------------------------------- float weights[KERNEL_SIZE]; float2 offsets[KERNEL_SIZE]; //----------------------------------------------------------------------------- // Textures. //----------------------------------------------------------------------------- texture colorMapTexture; sampler2D colorMap = sampler_state { Texture = <colorMapTexture>; MipFilter = Linear; MinFilter = Linear; MagFilter = Linear; }; //----------------------------------------------------------------------------- // Pixel Shaders. //----------------------------------------------------------------------------- float4 PS_GaussianBlur(float2 texCoord : TEXCOORD) : COLOR0 { float4 color = float4(0.0f, 0.0f, 0.0f, 0.0f); for (int i = 0; i < KERNEL_SIZE; ++i) color += tex2D(colorMap, texCoord + offsets[i]) * weights[i]; return color; } //----------------------------------------------------------------------------- // Techniques. //----------------------------------------------------------------------------- technique GaussianBlur { pass { PixelShader = compile ps_2_0 PS_GaussianBlur(); } } This is the code I'm using for the gaussian blur: public Texture2D PerformGaussianBlur(Texture2D srcTexture, RenderTarget2D renderTarget1, RenderTarget2D renderTarget2, SpriteBatch spriteBatch) { if (effect == null) throw new InvalidOperationException("GaussianBlur.fx effect not loaded."); Texture2D outputTexture = null; Rectangle srcRect = new Rectangle(0, 0, srcTexture.Width, srcTexture.Height); Rectangle destRect1 = new Rectangle(0, 0, renderTarget1.Width, renderTarget1.Height); Rectangle destRect2 = new Rectangle(0, 0, renderTarget2.Width, renderTarget2.Height); // Perform horizontal Gaussian blur. game.GraphicsDevice.SetRenderTarget(renderTarget1); effect.CurrentTechnique = effect.Techniques["GaussianBlur"]; effect.Parameters["weights"].SetValue(kernel); effect.Parameters["colorMapTexture"].SetValue(srcTexture); effect.Parameters["offsets"].SetValue(offsetsHoriz); spriteBatch.Begin(0, BlendState.Opaque, null, null, null, effect); spriteBatch.Draw(srcTexture, destRect1, Color.White); spriteBatch.End(); // Perform vertical Gaussian blur. game.GraphicsDevice.SetRenderTarget(renderTarget2); outputTexture = (Texture2D)renderTarget1; effect.Parameters["colorMapTexture"].SetValue(outputTexture); effect.Parameters["offsets"].SetValue(offsetsVert); spriteBatch.Begin(0, BlendState.Opaque, null, null, null, effect); spriteBatch.Draw(outputTexture, destRect2, Color.White); spriteBatch.End(); // Return the Gaussian blurred texture. game.GraphicsDevice.SetRenderTarget(null); outputTexture = (Texture2D)renderTarget2; return outputTexture; } And this is the draw method affected: public void Draw(SpriteBatch spriteBatch) { device.SetRenderTarget(maxBlur); spriteBatch.Begin(); foreach (Brick brick in blueBricks) brick.Draw(spriteBatch); spriteBatch.End(); blue = gBlur.PerformGaussianBlur((Texture2D) maxBlur, helperTarget, maxBlur, spriteBatch); spriteBatch.Begin(); device.SetRenderTarget(null); foreach (Brick brick in redBricks) brick.Draw(spriteBatch); foreach (Brick brick in greenBricks) brick.Draw(spriteBatch); spriteBatch.Draw(blue, new Rectangle(0, 0, blue.Width, blue.Height), Color.White); foreach (Brick brick in purpleBricks) brick.Draw(spriteBatch); spriteBatch.End(); } I'm sorry about the massive brick of text and images(or not....new user, I tried, it said no), but I wanted to get my problem across clearly as I have been searching for an answer to this for quite a while now. As a side note, I have seen the bloom sample. Very well commented, but overly complicated since it deals in 3D; I was unable to take what I needed to learn form it. Thanks for any and all help.

    Read the article

  • Physics Engine [Collision Response, 2-dimensional] experts, help!! My stack is unstable!

    - by Register Sole
    Previously, I struggle with the sequential impulse-based method I developed. Thanks to jedediah referring me to this paper, I managed to rebuild the codes and implement the simultaneous impulse based method with Projected-Gauss-Seidel (PGS) iterative solver as described by Erin Catto (mentioned in the reference of the paper as [Catt05]). So here's how it currently is: The simulation handles 2-dimensional rotating convex polygons. Detection is using separating-axis test, with a SKIN, meaning closest points between two polygons is detected and determined if their distance is less than SKIN. To resolve collision, simultaneous impulse-based method is used. It is solved using iterative solver (PGS-solver) as in Erin Catto's paper. Error-correction is implemented using Baumgarte's stabilization (you can refer to either paper for this) using J V = beta/dt*overlap, J is the Jacobian for the constraints, V the matrix containing the velocities of the bodies, beta an error-correction parameter that is better be < 1, dt the time-step taken by the engine, and overlap, the overlap between the bodies (true overlap, so SKIN is ignored). However, it is still less stable than I expected :s I tried to stack hexagons (or squares, doesn't really matter), and even with only 4 to 5 of them, they hardly stand still! Also note that I am not looking for a sleeping scheme. But I would settle if you have any explicit scheme to handle resting contacts. That said, I would be more than happy if you have a way of treating it generally (as continuous collision, instead of explicitly as a special state). Ideas I have: I would try adding a damping term (proportional to velocity) to the Baumgarte. Is this a good idea in general? If not I would not want to waste my time trying to tune the parameter hoping it magically works. Ideas I have tried: Using simultaneous position based error correction as described in the paper in section 5.3.2, turned out to be worse than the current scheme. If you want to know the parameters I used: Hexagons, side 50 (pixels) gravity 2400 (pixels/sec^2) time-step 1/60 (sec) beta 0.1 restitution 0 to 0.2 coeff. of friction 0.2 PGS iteration 10 initial separation 10 (pixels) mass 1 (unit is irrelevant for now, i modified velocity directly<-impulse method) inertia 1/1000 Thanks in advance! I really appreciate any help from you guys!! :)

    Read the article

  • Software rendering 3d triangles in the proper order

    - by at.
    I'm implementing a basic 3d rendering engine in software (for education purposes, please don't mention to use an API). When I project a triangle from 3d to 2d coordinates, I draw the triangle. However, it's in a random order and so whatever gets drawn last draws on top of all other triangles (which might be in front of triangles it shouldn't be in front of)... Intuitively, seems I need to draw the triangles in the correct order. So I can calculate all their distances to the camera and sort by that. The objects furthest away get drawn last. Is this the proper way to render triangles? If I'm sorting all the objects, this is n*log(n) now. Is this the most efficient way to do this?

    Read the article

  • C# 2D Camera Max Zoom

    - by Craig
    I have a simple ship sprite moving around the screen along with a 2D Camera. I have zooming in and out working, however when I zoom out it goes past the world bounds and has the cornflower blue background showing. How do I sort it that I can only zoom out as far as showing the entire world (which is a picture of OZ) and thats it? I dont want any of the cornflower blue showing. Cheers! namespace GamesCoursework_1 { /// <summary> /// This is the main type for your game /// </summary> public class Game1 : Microsoft.Xna.Framework.Game { GraphicsDeviceManager graphics; SpriteBatch spriteBatch; // player variables Texture2D Ship; Vector2 Ship_Position; float Ship_Rotation = 0.0f; Vector2 Ship_Origin; Vector2 Ship_Velocity; const float tangentialVelocity = 4f; float friction = 0.05f; static Point CameraViewport = new Point(800, 800); Camera2d cam = new Camera2d((int)CameraViewport.X, (int)CameraViewport.Y); //Size of world static Point worldSize = new Point(1600, 1600); // Screen variables static Point worldCenter = new Point(worldSize.X / 2, worldSize.Y / 2); Rectangle playerBounds = new Rectangle(CameraViewport.X / 2, CameraViewport.Y / 2, worldSize.X - CameraViewport.X, worldSize.Y - CameraViewport.Y); Rectangle worldBounds = new Rectangle(0, 0, worldSize.X, worldSize.Y); Texture2D background; public Game1() { graphics = new GraphicsDeviceManager(this); graphics.PreferredBackBufferWidth = CameraViewport.X; graphics.PreferredBackBufferHeight = CameraViewport.Y; 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); // TODO: use this.Content to load your game content here Ship = Content.Load<Texture2D>("Ship"); Ship_Origin.X = Ship.Width / 2; Ship_Origin.Y = Ship.Height / 2; background = Content.Load<Texture2D>("aus"); Ship_Position = new Vector2(worldCenter.X, worldCenter.Y); cam.Pos = Ship_Position; cam.Zoom = 1f; } /// <summary> /// UnloadContent will be called once per game and is the place to unload /// all content. /// </summary> protected override void UnloadContent() { // TODO: Unload any non ContentManager content here } /// <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) { // Allows the game to exit if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed) this.Exit(); // TODO: Add your update logic here Ship_Position = Ship_Velocity + Ship_Position; keyPressed(); base.Update(gameTime); } /// <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); // TODO: Add your drawing code here spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, null, null, null,null, cam.get_transformation(GraphicsDevice)); spriteBatch.Draw(background, Vector2.Zero, Color.White); spriteBatch.Draw(Ship, Ship_Position, Ship.Bounds, Color.White, Ship_Rotation, Ship_Origin, 1.0f, SpriteEffects.None, 0f); spriteBatch.End(); base.Draw(gameTime); } private void Ship_Move(Vector2 move) { Ship_Position += move; } private void keyPressed() { KeyboardState keyState; // Move right keyState = Keyboard.GetState(); if (keyState.IsKeyDown(Keys.Right)) { Ship_Rotation = Ship_Rotation + 0.1f; } if (keyState.IsKeyDown(Keys.Left)) { Ship_Rotation = Ship_Rotation - 0.1f; } if (keyState.IsKeyDown(Keys.Up)) { Ship_Velocity.X = (float)Math.Cos(Ship_Rotation) * tangentialVelocity; Ship_Velocity.Y = (float)Math.Sin(Ship_Rotation) * tangentialVelocity; if ((int)Ship_Position.Y < playerBounds.Bottom && (int)Ship_Position.Y > playerBounds.Top) cam._pos.Y = Ship_Position.Y; if ((int)Ship_Position.X > playerBounds.Left && (int)Ship_Position.X < playerBounds.Right) cam._pos.X = Ship_Position.X; Ship_Position += new Vector2(tangentialVelocity, 0); if (!worldBounds.Contains(new Point((int)Ship_Position.X, (int)Ship_Position.Y))) Ship_Position -= new Vector2(tangentialVelocity * 2, 0.0f); Ship_Position += new Vector2(-tangentialVelocity, 0.0f); if (!worldBounds.Contains(new Point((int)Ship_Position.X, (int)Ship_Position.Y))) Ship_Position -= new Vector2(-tangentialVelocity * 2, 0.0f); Ship_Position += new Vector2(0.0f, -tangentialVelocity); if (!worldBounds.Contains(new Point((int)Ship_Position.X, (int)Ship_Position.Y))) Ship_Position -= new Vector2(0.0f, -tangentialVelocity * 2); Ship_Position += new Vector2(0.0f, tangentialVelocity); if (!worldBounds.Contains(new Point((int)Ship_Position.X, (int)Ship_Position.Y))) Ship_Position -= new Vector2(0.0f, 2 * tangentialVelocity); } else if(Ship_Velocity != Vector2.Zero) { float i = Ship_Velocity.X; float j = Ship_Velocity.Y; Ship_Velocity.X = i -= friction * i; Ship_Velocity.Y = j -= friction * j; if ((int)Ship_Position.Y < playerBounds.Bottom && (int)Ship_Position.Y > playerBounds.Top) cam._pos.Y = Ship_Position.Y; if ((int)Ship_Position.X > playerBounds.Left && (int)Ship_Position.X < playerBounds.Right) cam._pos.X = Ship_Position.X; Ship_Position += new Vector2(tangentialVelocity, 0); if (!worldBounds.Contains(new Point((int)Ship_Position.X, (int)Ship_Position.Y))) Ship_Position -= new Vector2(tangentialVelocity * 2, 0.0f); Ship_Position += new Vector2(-tangentialVelocity, 0.0f); if (!worldBounds.Contains(new Point((int)Ship_Position.X, (int)Ship_Position.Y))) Ship_Position -= new Vector2(-tangentialVelocity * 2, 0.0f); Ship_Position += new Vector2(0.0f, -tangentialVelocity); if (!worldBounds.Contains(new Point((int)Ship_Position.X, (int)Ship_Position.Y))) Ship_Position -= new Vector2(0.0f, -tangentialVelocity * 2); Ship_Position += new Vector2(0.0f, tangentialVelocity); if (!worldBounds.Contains(new Point((int)Ship_Position.X, (int)Ship_Position.Y))) Ship_Position -= new Vector2(0.0f, 2 * tangentialVelocity); } if (keyState.IsKeyDown(Keys.Q)) { if (cam.Zoom < 2f) cam.Zoom += 0.05f; } if (keyState.IsKeyDown(Keys.A)) { if (cam.Zoom > 0.3f) cam.Zoom -= 0.05f; } } } }

    Read the article

  • Getting into game/game engine programming

    - by Darkslash
    So I am interested in learning game programming, but I really have an interest in the lower level engineering in games. I have openGL experience, and I am really interested in learning more about implementing AI, Physics, etc. I have a computer science degree, so I really like getting into technical stuff. Many times when I ask about this sort of thing, I get a lot of "Use an engine", "Use Unity3d", "Why waste your time writing code that already exists", etc etc. My idea was to use simpler libraries such as SFML or XNA so that I could learn how to implement the more complex systems. The thing is, although I do want to write games, I want to learn things that using something like Unity simply doesnt teach you. My goal is not to make a current generation quality 3D game to sell, I just want to make some cool smaller games and learn all I can about the programming side of game development. Is this something that people just do not do anymore? It seems like everywhere I turn people are using Unity or UDK or GameMaker. I fully understand why you would use a tool like these, but I cant see how they would suit my purposes. So where does someone like myself turn? Am I trying to learn something that people just do not bother doing anymore? Is the innovation in this area gone and just all about gameplay now? Im sorry if this question seems silly, but I am genuinely interested in knowing more about this and meeting more people who are interested in this sort of thing.

    Read the article

  • What's a good way to programmatically manage a cloneable entity?

    - by bobobobo
    Say you have missiles or rockets that a player can fire. What's a good way to programmatically manage the cloning of a base rocket, for example? I can think of 2 ways to do it: Player has a currently selected weapon (which is an int) When player shoots, the selectedWeapon member is looked at, and the correct instance of rocket is created (with some base parameters) Or Player has a currently selected weapon (which is a pointer, to a "base instance" of the rocket object) When player shoots, the base instance rocket is cloned, transformed, and shot into the game world

    Read the article

  • Simpler alternative to AngelScript

    - by Vee
    I want to give players the ability to create and share bullet patterns for a shoot'em up. The pattern scripts should have all the common programming stuff like loops, if/else, variables, and so on. But in the end, I just want them to call a "spawn bullet at X, Y with Z angle and A speed" in the C++ game. To spawn a circle of bullets, the user should only have to write a script with a for loop that goes from 0 to 360 and calls the spawn bullet function on every iteration. I tried integrating AngelScript, but I am getting nowhere - it looks way to complex for a simple task like this one. Is there an easy to integrate library that can solve my problem? Thanks.

    Read the article

  • I need help with 2D collision response (of stacking rotating polygons, with friction and gravity, for a game)

    - by Register Sole
    Hi I am looking for suggestions on how to write a collision response for game programming purpose (so not a scientific simulation). I am dealing with 2D polygons that are rotating, and I want them to be able to stack. I also want friction and gravity. I have a detection mechanism that returns the separating axis, how long the polygons are overlapping, and up to 2 points of contact. For the response, I am currently using an impulse-based response, which main idea is: find the separating axis, length of overlap, and the point of contact (if there are two, pick a random point between to simulate averaged force. i believe there are better ways than this) separate the object (modifying their positions, taking into account of their masses. i do not separate them completely though, to keep track that they are colliding to reduce jitter) calculate normal force based on the coefficient of restitution as if there is no friction. calculate friction, as if there is no normal force. I also assume that the direction of the friction is the same throughout the collision. apply the two forces (which result in a rather inaccurate result, since each force is calculated as if the other is not present. for non-rotating bodies though, this method is exact) I am aware that this method requires the coefficient of friction to be sufficiently small due to the assumption that the direction of friction stays the same in a collision. Also, the result is visually satisfying if gravity is not present. However, when there is gravity, objects on ground jitter and drift (even with zero coefficient of restitution)! It also happens for stacking objects. Larger coefficient of restitution and gravity increase the jittering. I hope you can help me with this. Some things i would like to know more about is how to handle collision with two point of contacts (how to end up having an object sitting still on the ground?), how to reduce, and prevent if possible, jitter and drift (do people use the most accurate method possible, or is there a trick to overcome this?), and how to handle multiple objects collision (for example, in the case of stacking objects, how do I check collisions between all of them and keep them all stable at every frame so they don't jitter?). A total reformulation of my algorithm is also welcomed, as long as it works. Another thing to note is that I am not making a Physics game, so I only need a visually satisfying response (though a realistic response is preferable, if it is not performance-heavy). But surely jittering and drifting objects on flat ground are not at all acceptable. In addition, I am a Physics student, so feel free to talk about impulse and whatever needed. Finally, I'm sorry for the long post. I tried to be as concise as I can. Thank you for reading it! EDIT It seems what I didn't manage to come up all this time is to separate resting contact as a class of its own and how to solve them. Currently reading the paper suggested by Jedediah. More suggestions on the topic are welcome :) CASE CLOSED After reading various papers referenced in the paper, successfully implemented simultaneous impulse method (referring to the original paper by Erin Catto, [Catt05]). Thanks maaaan!! The paper is wonderful. The current system is visibly much better than the previous. Still haven't separated resting contact as a class of its own though, which brings me to my next question. Love you all! Haha (sorry, I'm just so happy thanks to you).

    Read the article

  • What is the easiest and shortest way to draw a 2d line in c/c++?

    - by Mike
    I am fairly new to c/c++ but I do have experiance with directx and opengl with java and c#. My goal is to create a 2d game in c with under 2 pages of code. Most of what I have seen requires 3 pages of code to just get a window running. I would like to know the shortest code to get a window running where I can draw lines. I believe this can be done in less lines with opengl versus directx. Is there maybe an api or framework i can use to shorten it more? Also, it would be nice if the solution were cross platform compatible.

    Read the article

< Previous Page | 12 13 14 15 16 17  | Next Page >