Daily Archives

Articles indexed Wednesday July 3 2013

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

  • Ubuntu 13.04 running really slow and Hanging

    - by CAM
    Up till recently I have been running 13.04 on my laptop very happily. This morning however, I turned on my laptop to find it running really slow. Takes 5 min to load a program and even then the program freezes and I have had 3 system hangs this morning already. The Unity Desktop appears to run ok but programs do not. Things I have tried so far: Checking for Propitiatory graphics drivers - none shown available (I have bumblebee running already). Using the recovery boot options from Grub to repair broken packages. Recent changes - Updated computer, Installed some indicator applets which have worked fine for me before. System Specs: Asus U36s, Intel Core i5-2450M 2.5GHz, 4GB RAM, Nvidia Geforce 610M-1GB, Dual boot Win7 & Ubuntu 13.04 I'm a bit of a noob with Ubuntu but am happy enough running stuff in terminal if you will advise me on what to run. I'm just a bit stuck on what do to fix this without a reinstall. Thanks a lot for your help.

    Read the article

  • Ubuntu 12.04LTS mountall: Disconnected from Plymouth

    - by user169954
    I have ubuntu 12.04LTS 64bit running on an i5 dual core 8G RAM. On startup I get the message mountall: Disconnected from Plymouth [OK] And the system looks stuck. However, if I go to tty1, then I can login and startx and everything seems to be fine except for being a bit sluggish. I can verify that my nfs mounts are ok, and that my swap is ok. Every time I reboot the system there is a _gdm_gdm_crash file in my /var/crash, which makes me think my problem is rooted in gdm, X configs and/or nvidia drivers. A bit of background in case it's relevant: 3 hours ago my desktop crashed. Following various 'tips' on the web I made a complete mess of my X server and X configuration files, and at one point I even had to recreate my swap partition. Anyway, after much struggle I managed to get to the state I mentioned above: I have a working system provided I always login through tty1. What is this Plymouth anyway? Would it make a difference if I used gnome-wm instead of gdm or lightdm? (I mean to the startup, not to me :-) What bit of config do I change to tell startx to use gnome-wm not gdm or ligthdm? Thank you in advance

    Read the article

  • Forward TCP Connections with Iptables

    - by opc0de
    I receive connections to my server from several ip addresses I want to route these connections just like rinetd does but based on the ip the connection is coming from to connect to a specified host. Just like this: IP 10.10.12.1 => CONNECTS TO MY SERVER => MY SERVER REDIRECTS IT TO 82.12.12.1 IP 10.10.12.2 => CONNECTS TO MY SERVER => MY SERVER REDIRECTS IT TO 81.121.12.10 etc Is it possible or do I need to write my own daemon to achieve this functionality ?

    Read the article

  • Nginx will not start

    - by user2426362
    I'm trying to run service nginx restart but I get this error: root@user /etc/nginx/sites-enabled # service nginx restart Restarting nginx: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use) nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use) nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use) nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use) nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use) nginx: [emerg] still could not bind() nginx. How can I fix this problem? I'm also running apache.

    Read the article

  • Wifi Direct P2P-go and P2P-client support in ubuntu

    - by giri
    I am trying to get wifi direct working on a laptop with ubuntu 12.04 When I type the command 'iw list' it doesn't show P2P-client or P2P-go under 'supported interface modes.From http://wireless.kernel.org/en/users/Documentation/iw/replace-iwconfig I found that 'iwconfig' was replaced with 'iw'.Does it mean that my hardware doesn't have support for wifi-direct or is it just the software(drivers) issue? If is it just sofware issue please help me to find the right drivers which support wifi-direct. Here is the info about my ethernet controller from the output of 'lspci' 02:00.0 Ethernet controller: Atheros Communication Inc. AR242x / AR542x Wreless Network Adapter (PCI-Express) (rev 01) 06:00.0 Ethernet controller: Marvell Technology Group Ltd. 88E8055 PCI-E Gigabit Ethernet Controller (rev 13)

    Read the article

  • disk space error, cant use internet

    - by James
    after trying to install drivers using sudo apt-get update && sudo apt-get upgrade, im faced with a message saying no space left on device, i ran disk usage analyzer as root and there was three folders namely, main volume, home folder, and my 116gb hard drive (which is practically empty) yet both other folders are full, which is stopping me installing drivers because of space, how do i get ubuntu to use this space on my hard drive? its causing problems because i cant gain access to the internet as i cant download drivers when i havnt got enough space, this happens every time i try it

    Read the article

  • Package dependencies cannot be resloved?

    - by Hayden Win
    i was in the ubuntu software center, and when i try to install something like OpenJDK, i get an error saying: Package dependencies cannot be resolved This error could be caused by required additional software packages which are missing or not installable. Furthermore there could be a conflict between software packages which are not allowed to be installed at the same time. When i click on "Details" it shows this: The following packages have unmet dependencies: openjdk-6-jre: Depends: openjdk-6-jre-headless (>= 6b24-1.11.1-4ubuntu2) but 6b24-1.11.1-4ubuntu2 is to be installed Depends: libjpeg8 (>= 8c) but 8c-2ubuntu7 is to be installed Depends: libpulse0 (>= 1:0.99.1) but 1:1.1-0ubuntu15.2 is to be installed How do i fix this, and what's caused this problem in the first place?

    Read the article

  • How to work for Ubuntu? [duplicate]

    - by vijay
    This question already has an answer here: How can I contribute to Ubuntu? 4 answers I am very much impressed by Ubuntu. I want to work for it but I know only C language. Can somebody guide me on how to work for Ubuntu. thanks for your reply I don't want to learn any other programming languages. programatically i want to contribute.

    Read the article

  • How to install Citrix receiver xubuntu 13.04 64-bit

    - by Bård S
    Anyone have a walkthrough on installing Citrix receiver on Xubuntu 13.04 64-bit? Update $ sudo apt-get install libmotif4 nspluginwrapper ... snip ... Setting up libmotif4:amd64 (2.3.3-7ubuntu1) ... Setting up nspluginviewer (1.4.4-0ubuntu5) ... Setting up nspluginwrapper (1.4.4-0ubuntu5) ... plugin dirs: nspluginwrapper: no appropriate viewer found for /usr/lib/flashplugin-installer/libflashplayer.so Auto-update plugins from /usr/lib/mozilla/plugins Looking for plugins in /usr/lib/mozilla/plugins Segmentation fault (core dumped) Processing triggers for libc-bin ... ldconfig deferred processing now taking place sudo dpkg --install Downloads/icaclient_12.1.0_amd64.deb Selecting previously unselected package icaclient. (Reading database ... 155808 files and directories currently installed.) Unpacking icaclient (from .../icaclient_12.1.0_amd64.deb) ... dpkg: dependency problems prevent configuration of icaclient: icaclient depends on libc6-i386 (>= 2.7-1); however: Package libc6-i386 is not installed. icaclient depends on ia32-libs; however: Package ia32-libs is not installed. icaclient depends on lib32z1; however: Package lib32z1 is not installed. icaclient depends on lib32asound2; however: Package lib32asound2 is not installed. dpkg: error processing icaclient (--install): dependency problems - leaving unconfigured Errors were encountered while processing: icaclient

    Read the article

  • How to import a pdf in libreoffice? under ubuntu, all pages are blank

    - by Daniele
    I have some .pdf generated by a scanner, that I want to import in LibreOffice and do some small editing. The PDF has only one object per page, a page-size image. If I open it in LibreOffice under Ubuntu 12.10, it imports "successfully" but all pages are blank. I have the libreoffice-pdfimport package installed. That is true with both LibreOffice 3.6 (part of Ubuntu 12.10) and with 4.0.2, from libreoffice ppa. The same .pdf files open perfectly fine on both LibreOffice for Windows and LibreOffice for Mac (yes, I have three computers with all three OSes), but on Ubuntu 12.10, all pages are blank, so I can only conclude this is an issue with Ubuntu packaging, or something really weird prevents it from working under linux. How can I import these kinds of .pdf into LibreOffice for editing?

    Read the article

  • Unable to start VMWare Workstation after upgrade to 13.04

    - by pst007x
    After upgrading to 13.04 I am unable to start VMWorkstation. I get the following message: Before you can run VMware, several modules must be compiled and loaded into the running kernel. Kernel Headers 3.8.0-19-generic Kernel headers for version 3.8.0-19-generic were not found. If you have installed them in a non-default path you can specify the path below. Does anyone have any idea what to do next? Ubuntu 13.04 64bit If I direct the path to: /usr/src/linux-headers-3.8.0-19-generic I get the following message: C header files matching your running kernel were not found. Thanks Additional: As suggested I run this in terminal: cd /lib/modules/$(uname -r)/build/include/linux sudo ln -s ../generated/utsrelease.h sudo ln -s ../generated/autoconf.h sudo ln -s ../generated/uapi/linux/version.h However, now I get the following: Before you can run VMware, several modules must be compiled and loaded into the kernel CANCEL / INSTALL I INSTALL, the window closes and nothing happens.... Any ideas? ADDITIONAL: I installed this: sudo apt-get install open-vm-tools open-vm-tools-dev open-vm-dkms open-vm-toolbox open-vm-tools-dev And it all launched... Many thanks for the suggestions and help... This is what I love about Ubuntu... it has a great helpful community... ! Note: Also found this which may help others too: HERE ADDITIONAL ERROR: Could not open /dev/vmmon: Is a directory. Please make sure that the kernel module `vmmon' is loaded. Failed to initialize monitor device. Monitor settings all greyed out RESOLUTION: Re-installation of Nvidia Drivers

    Read the article

  • Why old (301) links stay on Google when breaking site down to multiple domains

    - by Sampo Sarrala
    Some background: We did have single site and single domain (let's call it mainsite.com) with product information, however things have changed since and product database has grown fast. So we decided to move some major products/manufacturers under their own domains (let's call one of them subsite.com) while still using our main database/codebase. What we've done: Added subsite.com domain for product 1 by Great Products Co. Some new nice looking front pages, info pages, etc. Detail pages that will use information from original db. Redirected product/group links from mainsite.com using 301 redirect. Verified that redirects works as expected. Waited some time for Google reindexing (over 30 days, I've heard it should be more than enough). Results: If I search our moved products from Google then it will found them and list them but with old links to our main page like mainsite.com/group/product1 but it should show link to new site subsite.com/product1. Links from Goole redirects as they should, as said redirects are verified [301]. Main question: Any reasons why Google would not follow 301 redirects and update links so that they will point to our new mfg/product site subsite.com?

    Read the article

  • Putting (WordPress) tags in <footer> tag, good for SEO or not?

    - by BlackEagle
    I am using tags for my posts on my WordPress site. The content of my post is set in <article> tags, which is fine and now, I want to put the author link and tags in a <footer> tag, but I don't know if this is good for SEO reasons. I know that Googlebots are putting less weight if they see links in a footer, but will this effect my tag pages? Is there any harm? I would love to read a good explanation on this.

    Read the article

  • sku code as description in Google Analytics

    - by dreagan
    In the Google Analytics ecommerce tracing script you must provide for every item and SKU code. I have this code for every product I'm selling and up until now I have always provided it in the _addItem method. But when reviewing that data in the ecommerce module of Google Analytics, I have no real, no readable data about my SKU sales. I know what product has been sold, due to the product name I provide. But when clicking through to the SKU-level, I know nothing more, since all I can see there are SKU codes. Is it possible and wise to replace the SKU code with the following template? "product-name colour-name size-name" This way, it should still be a unique field, but more readable afterwards.

    Read the article

  • Configure clean URLs using Laravel using a rewrite rule to index.php

    - by yannis hristofakis
    Recently I've started learning Laravel , I have none experience with framework before. I'm encountering the following problem .I'm trying to configure the .htaccess file so I can have clean URLs but the only thing I get are 404 Not Found error pages. I have created a virtual host - you can see below the configuration file - and changed the .htaccesss file on the public directory. /etc/apache2/sites-available <VirtualHost *:80> ServerAdmin [email protected] ServerName laravel.lar DocumentRoot "/home/giannis/Desktop/laravel/public" <Directory "/home/giannis/Desktop/laravel/public"> Options Indexes FollowSymLinks MultiViews AllowOverride All </Directory> <Directory /var/www/> Options Indexes FollowSymLinks MultiViews AllowOverride None Order allow,deny allow from all </Directory> ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/ <Directory "/usr/lib/cgi-bin"> AllowOverride None Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch Order allow,deny Allow from all </Directory> ErrorLog ${APACHE_LOG_DIR}/error.log # Possible values include: debug, info, notice, warn, error, crit, # alert, emerg. LogLevel warn CustomLog ${APACHE_LOG_DIR}/access.log combined Alias /doc/ "/usr/share/doc/" <Directory "/usr/share/doc/"> Options Indexes MultiViews FollowSymLinks AllowOverride None Order deny,allow Deny from all Allow from 127.0.0.0/255.0.0.0 ::1/128 </Directory> </VirtualHost> .htaccesss file: laravel/public # Apache configuration file # http://httpd.apache.org/docs/current/mod/quickreference.html # Note: ".htaccess" files are an overhead for each request. This logic should # be placed in your Apache config whenever possible. # http://httpd.apache.org/docs/current/howto/htaccess.html # Turning on the rewrite engine is necessary for the following rules and # features. "+FollowSymLinks" must be enabled for this to work symbolically. <IfModule mod_rewrite.c> Options +FollowSymLinks RewriteEngine On </IfModule> # For all files not found in the file system, reroute the request to the # "index.php" front controller, keeping the query string intact <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php?/$1 [L] </IfModule> In order to test it, I have created a view named about and made the proper routing. If I link to http://laravel.lar/index.php/about/ I'm routing to the about page instead if I link to http://laravel.lar/about/ I get a 404 Not Found error. I'm using a Debian based system.

    Read the article

  • Kickstarter "last minute cold feet"

    - by mm24
    today I scheduled the publication of a video on kickstarter requesting approximately 5.000 $ in order to complete the iPhone shooter game I started 1 year ago after quitting my job. I invested more than 20.000$ in the game so far (for artwork, music, legal and accountant expenses) and I am now getting cold feet about my decision of publishing the video. The game is "nearly finished", in other words: the game mechanics are working but I still have some bugs to fix. Once I will have finished this (I hope will take me 1 or 2 weeks) I plan to start working on the actual level balancing (e.g. deciding the order of appearence of enemies for each level and balancing the number of hitpoints and strenght of bullets that the enemies have). Reasons for not publishing the video are: fear that the concept can be copied easily: the game is a shooter game set in a different environment (its a pretty cool one, believe me :)) and I am worried that someone might copy* the idea (I know, its the usual "I am worried story.."). A shooter game is one of the easiest game to implement and hence there will be hundreds game developer able to copy it by just adapting their existing code and changing graphics (not as straightforward). It took me one year to develop this because I was inexperienced plus there are approximately 6/7 months of work from the illustrator and there are 8 unique music tracks composed. The soundtrack of the video is the soundtrack of the game wich is not yet published and has not been deposited to a music society. I did create legally valid timestamps for the tracks and I am considering uploading the album on iTunes before publishing the video so I can have a certain publication date. But overall I am a bit scared and worried because I have never done this before and even the simple act of publishing an album requires me to read a long contract from the "aggregator company") which, even if I do have contracts with the musicians do worry me as I am not a U.S. resident and I am not familiar with the U.S. law system Reasons for publishing the video are: I almost run out of money (but this is not a real reason as I should have enough for one more month of development time) ...I kind of need extra money as, even if I do have money for 1 month of development I do not have money for marketing and for other expenses (e.g. accountant) It will create a fan base I could get some useful feedback from a wider range of beta testers It might create some pre-release buzz in case some blogger or game magazine likes the concept Anyone has had similar experiences? Is there a real risk that someone will copy the concept and implement it in a couple of months? Will the Kickstarter campaing be a good pre-release exposure for the gmae? Any refrences of similar projects/situations? Is it realistic that someone like ROVIO will copy the idea straight away?

    Read the article

  • Engine Rendering pipeline : Making shaders generic

    - by fakhir
    I am trying to make a 2D game engine using OpenGL ES 2.0 (iOS for now). I've written Application layer in Objective C and a separate self contained RendererGLES20 in C++. No GL specific call is made outside the renderer. It is working perfectly. But I have some design issues when using shaders. Each shader has its own unique attributes and uniforms that need to be set just before the main draw call (glDrawArrays in this case). For instance, in order to draw some geometry I would do: void RendererGLES20::render(Model * model) { // Set a bunch of uniforms glUniformMatrix4fv(.......); // Enable specific attributes, can be many glEnableVertexAttribArray(......); // Set a bunch of vertex attribute pointers: glVertexAttribPointer(positionSlot, 2, GL_FLOAT, GL_FALSE, stride, m->pCoords); // Now actually Draw the geometry glDrawArrays(GL_TRIANGLES, 0, m->vertexCount); // After drawing, disable any vertex attributes: glDisableVertexAttribArray(.......); } As you can see this code is extremely rigid. If I were to use another shader, say ripple effect, i would be needing to pass extra uniforms, vertex attribs etc. In other words I would have to change the RendererGLES20 render source code just to incorporate the new shader. Is there any way to make the shader object totally generic? Like What if I just want to change the shader object and not worry about game source re-compiling? Any way to make the renderer agnostic of uniforms and attributes etc?. Even though we need to pass data to uniforms, what is the best place to do that? Model class? Is the model class aware of shader specific uniforms and attributes? Following shows Actor class: class Actor : public ISceneNode { ModelController * model; AIController * AI; }; Model controller class: class ModelController { class IShader * shader; int textureId; vec4 tint; float alpha; struct Vertex * vertexArray; }; Shader class just contains the shader object, compiling and linking sub-routines etc. In Game Logic class I am actually rendering the object: void GameLogic::update(float dt) { IRenderer * renderer = g_application->GetRenderer(); Actor * a = GetActor(id); renderer->render(a->model); } Please note that even though Actor extends ISceneNode, I haven't started implementing SceneGraph yet. I will do that as soon as I resolve this issue. Any ideas how to improve this? Related design patterns etc? Thank you for reading the question.

    Read the article

  • Bullet physics debug drawing not working

    - by Krishnabhadra
    Background I am following on from this question, which isn't answered yet. Basically I have a cube and a UVSphere in my scene, with UVSphere on the top of the cube without touching the cube. Both exported from blender. When I run the app The UVSphere does circle around the cube for 3 or 4 times and jump out of the scene. What I actually expect was the sphere to fall on top of the cube. What this question about From the comment to the linked question, I got to know about bullet debug drawing, which helps in debugging by drawing outline of physics bodies which are normally invisible. I did some research on that and came up with the code given below. From whatever I have read, below code should work, but it doesn't. My Code My bullet initialization code. -(void) initializeScene { /*Setup physics world*/ _physicsWorld = [[CC3PhysicsWorld alloc] init]; [_physicsWorld setGravity:0 y:-9.8 z:0]; /*Setting up debug draw*/ MyDebugDraw *draw = new MyDebugDraw; draw->setDebugMode(draw->getDebugMode() | btIDebugDraw::DBG_DrawWireframe ); _physicsWorld._discreteDynamicsWorld->setDebugDrawer(draw); /*Setup camera and lamb*/ ………….. //This simpleCube.pod contains the cube [self addContentFromPODFile: @"simpleCube.pod"]; //This file contains sphere [self addContentFromPODFile: @"SimpleSphere.pod"]; [self createGLBuffers]; CC3MeshNode* cubeNode = (CC3MeshNode*)[self getNodeNamed:@"Cube"]; CC3MeshNode* sphereNode = (CC3MeshNode*)[self getNodeNamed:@"Sphere"]; // both cubeNode and sphereNode are not nil from this point float *cVertexData = (float*)((CC3VertexArrayMesh*)cubeNode.mesh) .vertexLocations.vertices; int cVertexCount = ((CC3VertexArrayMesh*)cubeNode.mesh) .vertexLocations.vertexCount; btTriangleMesh* cTriangleMesh = new btTriangleMesh(); int offset = 0; for (int i = 0; i < (cVertexCount / 3); i++) { unsigned int index1 = offset; unsigned int index2 = offset+6; unsigned int index3 = offset+12; cTriangleMesh->addTriangle( btVector3(cVertexData[index1], cVertexData[index1+1], cVertexData[index1+2]), btVector3(cVertexData[index2], cVertexData[index2+1], cVertexData[index2+2]), btVector3(cVertexData[index3], cVertexData[index3+1], cVertexData[index3+2])); offset += 18; } [self releaseRedundantData]; /*Create a triangle mesh from the vertices*/ btBvhTriangleMeshShape* cTriMeshShape = new btBvhTriangleMeshShape(cTriangleMesh,true); btCollisionShape *sphereShape = new btSphereShape(1); gTriMeshObject = [_physicsWorld createPhysicsObjectTrimesh:cubeNode shape:cTriMeshShape mass:0 restitution:1.0 position:cubeNode.location]; sphereObject = [_physicsWorld createPhysicsObject:sphereNode shape:sphereShape mass:1 restitution:0.1 position:sphereNode.location]; sphereObject.rigidBody->setDamping(0.1,0.8); /*Enable debug drawing*/ _physicsWorld._discreteDynamicsWorld->debugDrawWorld(); } And My btIDebugDraw implementation (MyDebugDraw.h) //MyDebugDraw.h class MyDebugDraw: public btIDebugDraw{ int m_debugMode; public: virtual void drawLine(const btVector3& from,const btVector3& to ,const btVector3& color); virtual void drawContactPoint(const btVector3& PointOnB ,const btVector3& normalOnB,btScalar distance ,int lifeTime,const btVector3& color); virtual void reportErrorWarning(const char* warningString); virtual void draw3dText(const btVector3& location ,const char* textString); virtual void setDebugMode(int debugMode); virtual int getDebugMode() const; }; void MyDebugDraw::drawLine(const btVector3& from,const btVector3& to ,const btVector3& color){ LogInfo(@"Works!!"); glPushMatrix(); glColor4f(color.getX(), color.getY(), color.getZ(), 1.0); const GLfloat line[] = { from.getX()*1, from.getY()*1, from.getZ()*1, //point A to.getX()*1, to.getY()*1,to.getZ()*1 //point B }; glVertexPointer( 3, GL_FLOAT, 0, &line ); glPointSize( 5.0f ); glDrawArrays( GL_POINTS, 0, 2 ); glDrawArrays( GL_LINES, 0, 2 ); glPopMatrix(); } void MyDebugDraw::drawContactPoint(const btVector3 &PointOnB ,const btVector3 &normalOnB, btScalar distance ,int lifeTime, const btVector3 &color){ } void MyDebugDraw::reportErrorWarning(const char *warningString){ } void MyDebugDraw::draw3dText(const btVector3 &location , const char *textString){ } void MyDebugDraw::setDebugMode(int debugMode){ } int MyDebugDraw::getDebugMode() const{ return DBG_DrawWireframe; } My Problem The drawLine method is getting called. I can see the cube and sphere in place. Sphere again does some circling around the cube before jumping off. No debug lines are getting drawn.

    Read the article

  • Undefined fireball movement behavior

    - by optimisez
    Demonstration video I try to do after the player shoot 10 times of fireball, then delete all the fireball objects and recreate a 10 new set of fireball objects. I did it but there is a weird bug happens that sometimes the fireball will come out from top and move to the right after shooting a few times. All the 10 fireballs should follow the player all the time and all the fireball should come out from player even after a new set of fireballs is recreated. Any ideas to fix it? Variables typedef struct gameObject{ float X; float Y; int length; int height; bool action; }; // Fireball #define FIREBALL_NUM 10 LPDIRECT3DTEXTURE9 fireball = NULL; RECT fireballRect; gameObject *fireballDest = new gameObject[FIREBALL_NUM]; int iFireBallAnimation; int fireballCount = 0; Set up Fireball void setUpFireBall() { // Initialize destination rectangle, rectangle height and length for (int i = 0; i < FIREBALL_NUM; i++) { fireballDest[i].X = 0; fireballDest[i].Y = 0; fireballDest[i].length = fireballRect.right - fireballRect.left; fireballDest[i].height = fireballRect.bottom - fireballRect.top; } iFireBallAnimation = fireballRect.right - fireballRect.left; // Initialize boolean for (int i = 0; i < FIREBALL_NUM; i++) { fireballDest[i].action = false; } } Initialize fireball void initFireball() { hr = D3DXCreateTextureFromFileEx(d3dDevice, "fireball.png", 512, 512, D3DX_DEFAULT, NULL, D3DFMT_A8R8G8B8, D3DPOOL_MANAGED, D3DX_DEFAULT, D3DX_DEFAULT, D3DCOLOR_XRGB(255, 255, 0), NULL, NULL, &fireball); // Initialize source rectangle fireballRect.left = 0; fireballRect.top = 256; fireballRect.right = 64; fireballRect.bottom = 320; setUpFireBall(); } Update fireball void update() { updateAnimation(); updateAI(); updatePhysics(); updateGameState(); } void updatePhysics() { motion(); collison(); } void motion() { playerMove(); playerJump(); playerGravity(); shootFireball(); fireballFollowPlayer(); } void shootFireball() { if (keyArr['Z']) fireballDest[fireballCount].action = true; if (fireballDest[fireballCount].action) { fireballDest[fireballCount].X += 10; if (fireballDest[fireballCount].X > 800) fireballCount++; } } void fireballFollowPlayer() { for (int i = 0; i < FIREBALL_NUM; i++) { if (fireballDest[i].action == false) { fireballDest[i].X = playerDest.X - 30; fireballDest[i].Y = playerDest.Y - 14; } } } void updateGameState() { // When no more fireball left, rearm fireball if (fireballCount == FIREBALL_NUM) { delete[] fireballDest; fireballDest = new gameObject[10]; fireballCount = 0; setUpFireBall(); } } Render fireball void renderFireball() { for (int i = 0; i < FIREBALL_NUM; i++) { if (fireballDest[i].action) sprite->Draw(fireball, &fireballRect, NULL, &D3DXVECTOR3(fireballDest[i].X, fireballDest[i].Y, 0), D3DCOLOR_XRGB(255,255, 255)); } }

    Read the article

  • Edge Detection on Screen

    - by user2056745
    I have a edge collision problem with a simple game that i am developing. Its about throwing a coin across the screen. I am using the code below to detect edge collisions so i can make the coin bounce from the edges of the screen. Everything works as i want except one case. When the coin hits left edge and goes to right edge the system doesnt detect the collision. The rest cases are working perfectly, like hitting the right edge first and then the left edge. Can someone suggest a solution for it? public void onMove(float dx, float dy) { coinX += dx; coinY += dy; if (coinX > rightBorder) { coinX = ((rightBorder - coinX) / 3) + rightBorder; } if (coinX < leftBorder) { coinX = -(coinX) / 3; } if (coinY > bottomBorder) { coinY = ((bottomBorder - coinY) / 3) + bottomBorder; } invalidate(); }

    Read the article

  • Compiling SDL under Windows with sdl-config

    - by DarrenVortex
    I have downloaded NXEngine (The Open Source version of Cave Story). I have a make file in the directory, which I execute using msys. However, the make file uses sdl-config: g++ -g -O2 -c main.cpp -D DEBUG `sdl-config --cflags` -Wreturn-type -Wformat -Wno-multichar -o main.o /bin/sh: sdl-config: command not found And apparently sdl-config does not exist under windows since there's no sdl installation. There's also no documentation on the official sourceforge website about this! What do I do?

    Read the article

  • When "W" is held, the character moves forward, but when "W" and "A" is held, movement completely stops

    - by Vlad1k
    I am making a 2D game, and when I hold the key "w", the player goes forward, but when I hold both "w" and "a", the movement stops completely, when I want it to go forward, while shifting to the left. Here is my script: var speed = 4; function Update() { // Make the character walk forward if "w" is being held if(Input.GetKey("w")) { rigidbody.velocity = transform.forward * speed; } // Stop the movement if "w" is not being held if(Input.GetKeyUp("w")) { rigidbody.velocity = transform.forward * 0; } // Make the character walk forward if "s" is being held if(Input.GetKey("s")) { rigidbody.velocity = transform.forward * -speed; } // Stop the movement if "s" is not being held if(Input.GetKeyUp("s")) { rigidbody.velocity = transform.forward * 0; } // Make the character walk left if "a" is being held if(Input.GetKey("a")) { rigidbody.velocity = transform.right * -speed; } // Stop the movement if "a" is not being held if(Input.GetKeyUp("a")) { rigidbody.velocity = transform.right * 0; } //Make the character walk right if "d" is being held if(Input.GetKey("d")) { rigidbody.velocity = transform.right * speed; } // Stop the movement if "d" is not being held if(Input.GetKeyUp("d")) { rigidbody.velocity = transform.right * 0; } } PLEASE MAKE THE CODE BETTER! I AM NEW! EDIT: Here is a video to show my problem. http://www.screenr.com/3oxH Here is the newest code: var speed = 4f; function Update() { if(Input.GetKey("w")) { rigidbody.velocity = transform.forward * speed; } else if(Input.GetKey("s")) { rigidbody.velocity = transform.forward * -speed; } else if(Input.GetKey("a")) { rigidbody.velocity = transform.right * -speed; } else if(Input.GetKey("d")) { rigidbody.velocity = transform.right * speed; } if(Input.GetKeyUp("w")) { rigidbody.velocity = transform.forward * 0; } if(Input.GetKeyUp("s")) { rigidbody.velocity = transform.forward * 0; } if(Input.GetKeyUp("a")) { rigidbody.velocity = transform.right * 0; } if(Input.GetKey("d")) { rigidbody.velocity = transform.right * speed; } if(Input.GetKeyUp("d")) { rigidbody.velocity = transform.right * 0; } }

    Read the article

  • Is it important for reflection-based serialization maintain consistent field ordering?

    - by Matchlighter
    I just finished writing a packet builder that dynamically loads data into a data stream for eventual network transmission. Each builder operates by finding fields in a given class (and its superclasses) that are marked with a @data annotation. When I finishing my implementation, I remembered that getFields() does not return results in any specific order. Should reflection-based methods for serializing arbitrary data (like my packets) attempt to preserve a specific field ordering (such as alphabetical), and if so, how?

    Read the article

  • Dealing with "jumping" sprites: badly centered?

    - by GigaBass
    Thing is, I've used darkFunction Editor as a way to get all the spriteCoordinates off a spriteSheet for each individual sprite, and parse the .xml it generates inside my game. It all works fine, except when the sprites are all similarly sized, but when a sprite changes from a small sprite into a big one, such as here: When from walking from some direction, to attacking, it starts "jumping", appearing glitchy, because it's not staying in the same correct position, only doing so for the right attacking sprite, due to the drawing being made from the lower left part of the rectangle. I think someone experienced will immediately recognize the problem I mean, if not, when I return home soon, I will shoot a little youtube video demonstrating the issue! So the question is: what possible solutions are there? I've thought that some sort of individual frame "offset" system might be the answer, or perhaps splitting, in this case, the sprite in 2: the sword, and the character itself, and draw sword according to character's facing, but that might be overly complex. Another speculation would be that there might be some sort of method in LibGdx, the library I'm using, that allows me to change the drawing center (which I looked for and didn't find), so I could choose from where the drawing starts.

    Read the article

  • Pixel Shader - apply a mask (XNA)

    - by Michal Bozydar Pawlowski
    I'd like to apply a simple few masks to few images. The first mask I'd like to implement is mask like: XXXOOO I mean, that on the right everything is masked (to black), and on the left everything is stayed without changes. The second mask I'd like to implement is glow mask. I mean something like this: O O***O O**X**O O***O O What I mean, is a circle mask, which in the center everything is saved without changes, and going outside the circle everything is starting to be black The last mask is irregular mask. For example like this: OOO* O**X**O OO**OO**O OO*X*O O*O O Where: O - to black * - to gray X - without changes I've read, how to apply distortion pixel shader in XNA: msdn Could you explain me how to apply mute mask on an image? (mask will be grayscale)

    Read the article

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