Daily Archives

Articles indexed Monday May 26 2014

Page 13/15 | < Previous Page | 9 10 11 12 13 14 15  | Next Page >

  • How should I determine if a user is logged in graphically while lightdm is running?

    - by Jack
    I want to know if someone is logged into a local X-session. In the past I looked at the output of ck-list-sessions. The output looked something like this: Session12: unix-user = '[redacted]' realname = '[redacted]' seat = 'Seat1' session-type = '' active = TRUE x11-display = ':0' x11-display-device = '/dev/tty8' display-device = '' remote-host-name = '' is-local = TRUE on-since = '2012-10-22T18:17:55.553236Z' login-session-id = '4294967295' If no one was logged in, there was no output. I checked if someone was logged in with ck_result" string => execresult("/usr/bin/ck-list-sessions | /bin/grep x11 | /usr/bin/cut --delimiter=\\' -f 2 | /usr/bin/wc -w This no longer works, because lightdm greeter looks like a logged in user Session12: unix-user = '[redacted]' realname = 'Light Display Manager' seat = 'Seat1' session-type = 'LoginWindow' active = TRUE x11-display = ':0' x11-display-device = '/dev/tty8' display-device = '' remote-host-name = '' is-local = TRUE on-since = '2012-10-22T22:17:55.553236Z' login-session-id = '4294967295' I guess I could check session-type, but I don't know how to do that and check x11-display in one-liner. I then need to write my own script, but at that point I thought I would check if anyone else has already done the work or if there is a way to get ConsoleKit to tell me what I want (or if I should be using a different tool)?

    Read the article

  • 'tools.jar' is not in IDEA classpath

    - by Patrick
    I am a new user of Linux, it has been recommended to me by my friend. He told me to install software called IntelliJ Idea IDE. Well I have been following the tutorial. But now when I try to open "idea.sh", an error message pops-up: 'tools.jar' is not in IDEA classpath. Please ensure JAVA_HOME points to JDK rather than JRE. Please remember that I'm new to Ubuntu and I'm planning for a nice long stay once I get myself into it :) Also I do not know if I am running a correct Java6 JDK. When I do java -version, this is what I get: java version "1.6.0_23" OpenJDK Runtime Environment (IcedTea6 1.11pre) (6b23~pre10-0ubuntu5) OpenJDK 64-Bit Server VM (build 20.0-b11, mixed mode) Thank You for reading this and I hope I will get a nice response.

    Read the article

  • How to recover data from NTFS partition that was made into a Swap partition?

    - by Raghav Mehta
    I have extremely important stuff on my windows partition which during the ubuntu 10.10 installation,when it said that I should create something called swap space, I selected it to be a swap space (without even knowing what it actually meant) The Grub2 doesn't show up so I don't get a choice to boot Ubuntu or Windows. I don't get my windows partition as a removable device in Ubuntu either. When I go to disk utility and select the sda2 (i.e.. my windows partition) and click edit partition and select HPFS/NTFS for the type and tick bootable and click OK the small processing sign keep on rotating on the bottom right of the sda2 in the chart and after about 10 to 15 minutes it gives an unknown error and thus, I am still unable to use my windows. I am even worse than a beginner who doesn't know a thing about Ubuntu so please be patient and help me out.

    Read the article

  • Is it possible to boot Ubuntu using the Windows bootloader?

    - by badp
    As noted by many people, Windows 8's UEFI requirements might will won't get in the way of installing Linux (or whatever), as the replacement bootloader will also need to be signed somehow. Some systems All systems will let you disable the signature requirement, but the feature might be hidden to disable or you might not be willing to give up on the benefits of a secure bootloader. Is it necessary to replace the bootloader in the first place? To keep ourselves to software that's gone golden, how can I install Ubuntu 11.04 using Windows 7's own bootloader?

    Read the article

  • Schema.org for Product Reviews

    - by Lynda
    I have a product reviews on a site and I am adding schema.org markup to the reviews. Here is the code I am using: <div class="blockquote-wrap"> <blockquote itemprop="review" itemscope itemtype="http://schema.org/Review"><span itemprop="reviewBody">Text of the review itself.</span> <cite><span itemprop="author">Author Name</span>, Location of Author</cite> </blockquote> </div> This is all the reviews are. When I test the page using Google's Structured Data Testing Tool I receive this error: Error: Incomplete microdata with schema.org. My question is what data is missing that is required? I don't see which data is required on the Schema.org page for reviews.

    Read the article

  • 301 redirecting a blog's RSS feed URL?

    - by Marc Charbonneau
    I moved my personal blog from Wordpress to Ghost this weekend, which changes the RSS feed URL from /feed/ to /rss/. By default Ghost returns a 301 redirect for /feed/, which I've verified by checking the response header and looking at the logs: In Feedly though, new posts aren't being picked up (at least after 24 hours. I'm not sure if they might have a waiting period before updating the URL). What's the correct thing to do in this situation? Do I need to keep /feed/ alive instead of returning a 301? If so, is there a rewrite rule that would let me do this in nginx instead of having to modify the Ghost source code?

    Read the article

  • Webmaster Tools word count

    - by Henrik Erlandsson
    Is there a way to somehow verify that the googlebot finds the headings and the content, for example by word count? I'm asking this because I tried a program called Screaming Frog, which fails to even fetch the first h1 on a validated page - for about 1/3 of all the pages(!) - and got insecure. Even though the site looks hunky dory in Webmaster Tools, I'd like to know what a googlebot-like content crawler finds on my page and in what order. Any tips on such tools is appreciated. This is not about keyword count.

    Read the article

  • Site is working with http:// not with http://www

    - by Forza
    My site is working if i type it as domain.com. But If I type it as www.domain.com I get an error 404 page. The domain is registered with Google Apps for Business and the hosting is done with another company. I have some A records that are pointing the site to this server. However, as it appears the A records are only working halfway. What do I have to do to make it working for both http:// and http://www ?

    Read the article

  • How to know an article is copy from other site? [on hold]

    - by cj333
    We have a site. our main servers is for blogs and freedom write. Our custom can submit their article in our site. But for ptotect the copywrite, we do not allow custom just do easy copy and parse a whole article from other site. At least they should write something by themselves. And how to check if the article is a completed copy from other site? google webmasters? google search api? or other better way? Because we always received DMCA notice by google, so I am tring to stopping the articles before they were posted. Thanks.

    Read the article

  • Getting expired domain name - most effective route?

    - by kcdwayne
    There is a domain name I have been wanting for years that was used as a parked page (read: cybersquatted) that has entered into WHOIS's redemptionPeriod stage. The domain has been expired for 61 days now - after contacting the Registar, they informed me that it would stay in redemption for 75 days. After which, it would either be sold to resellers, or sent back to the public registry. (I have since sent a followup message requesting the reseller they use.) My question is: What is the best way to proceed? I know there is at least one competitor that would love to have this name, but I'm unsure if they even know it's expiring. I did not tell the Registar the domain in question, as they seem geared towards cybersquatting, and I do not trust them. Domain Front Running sucks. Should I use a backorder service? Should I just take my chances and try to grab it after75 days? I checked an auctionhouse by manually browsing their expired domains - it wasn't there.

    Read the article

  • No description for any page on the website is available in Google despite robots.txt allowing crawling

    - by Abhijit
    I seem to have the weirdest issue with Search Engine Optimization, and I asked the IT folks at my university, I asked people on Joomla forums and I am trying to sort this issue out using Google Webmaster Tools for more than 2 months to little avail. I want to know if I have some blatantly wrong configuration somewhere that is causing search engines to be unable to index this site. I noticed a similar issue with another website I searched for online (ECEGSA - The University of British Columbia at gsa.ece.ubc.ca), making me believe this might be a concern that people might be looking an answer for. Here are the details: The website in question is: http://gsa.ece.umd.edu/. It runs using Joomla 2.5.x (latest). The site was up since around mid December of 2013, and I noticed right from the get go that the site was not being indexed correctly on Google. Specifically I see the following message when I search for the website on Google: A description for this result is not available because of this site's robots.txt – learn more. The thing is in December till around March I used the default Joomla robots.txt file which is: User-agent: * Disallow: /administrator/ Disallow: /cache/ Disallow: /cli/ Disallow: /components/ Disallow: /images/ Disallow: /includes/ Disallow: /installation/ Disallow: /language/ Disallow: /libraries/ Disallow: /logs/ Disallow: /media/ Disallow: /modules/ Disallow: /plugins/ Disallow: /templates/ Disallow: /tmp/ Nothing there should stop Google from searching my website. And even more confusingly, when I go to Google Webmaster tools, under "Blocked URLs" tab, when I try many of the links on the site, they are all shown up as "Allowed". I then tried adding a sitemap, putting it in the robots.txt file. That did not help. Same exact search result, same behavior in the "Blocked URLs" tab on the webmaster tools. Now additionally, the "sitemaps" tab says for several links an error saying "URL is robotted out". I tried those exact links in the "Blocked URLs" and they are allowed! I then tried deleting the robots.txt file. No use. Same exact problem. Here is an example screenshot from Google's Webmaster Tools: At this point I cannot give a rational explanation to why this is happening and neither can anyone in the IT department here. No one on Joomla forums can seem to understand what is going on. Based on what I explained, does it seem that I have somehow set a setting in the robots.txt or in .htaccess or somewhere else, incorrectly?

    Read the article

  • Need to add 30K new pages to a 10K page website - troubles ahead? (SEO)

    - by Jurga
    We have a situation with a website where we plan to add a huge amount of new pages. The domain is over 10 years old, approximately 10 thousand indexed pages, and the planned addition is approx. 30K new pages. Any idea how we should go about it? Must we schedule a gradual data release? Have you heard of any industry standards as to how many new pages per day / week / month should be added in order to appear natural and not get in trouble with Google? I.e. should we plan a bi-weekly addition of 5K?

    Read the article

  • Hosting several HTTP servers on single domain name

    - by Nakilon
    Several people have got a single domain name server.company.com server, where they are now supposed to host their infrastructure or temporal projects, written in different ways even in different programming languages. How do they divide the domain? Split into subdomains: john.server.company.com, kate.server.company.com, etc. This would need a lot of admins' assistance, time, etc. -- there would be no way for John and Kate to do it themselves. Split into url namespaces: server.company.com/john/, server.company.com/kate/, etc. Pro: They now can make a single welcome page at root with any additional info (if they need?) Con: Each server would need to know their namespace string constant, and hrefs like / whould need patching. Split into ports: server.company.com:8080, server.company.com:8081, etc. and make a single :80 welcome page. Pro: They still can make a single welcome page at :80 Con: ??? I would like to know more pros and cons for 2 and 3 solution.

    Read the article

  • Can the .htaccess file slow down a website to a crawl? If so, are there better ways to solve these problems with different rewrite rules and such?

    - by Parimal
    here is my htaccess file...... RewriteCond %{REQUEST_URI} ^/patients/billing/FAQ_billing\.html$ [OR] RewriteCond %{REQUEST_URI} ^/patients/billing/getintouch\.html$ RewriteRule ^patients/billing/(.*)\.html$ $1.php [L,NC] RewriteCond %{REQUEST_URI} ^/patients/findadoctor/a\.html$ [OR] RewriteCond %{REQUEST_URI} ^/patients/findadoctor/b\.html$ [OR] RewriteCond %{REQUEST_URI} ^/patients/findadoctor/c\.html$ [OR] RewriteCond %{REQUEST_URI} ^/patients/findadoctor/d\.html$ [OR] RewriteCond %{REQUEST_URI} ^/patients/findadoctor/e\.html$ [OR] RewriteCond %{REQUEST_URI} ^/patients/findadoctor/f\.html$ [OR] RewriteCond %{REQUEST_URI} ^/patients/findadoctor/g\.html$ [OR] RewriteCond %{REQUEST_URI} ^/patients/findadoctor/h\.html$ [OR] RewriteCond %{REQUEST_URI} ^/patients/findadoctor/i\.html$ [OR] RewriteCond %{REQUEST_URI} ^/patients/findadoctor/j\.html$ [OR] RewriteCond %{REQUEST_URI} ^/patients/findadoctor/k\.html$ [OR] RewriteCond %{REQUEST_URI} ^/patients/findadoctor/l\.html$ [OR] RewriteCond %{REQUEST_URI} ^/patients/findadoctor/m\.html$ [OR] RewriteCond %{REQUEST_URI} ^/patients/findadoctor/n\.html$ [OR] RewriteCond %{REQUEST_URI} ^/patients/findadoctor/o\.html$ [OR] RewriteCond %{REQUEST_URI} ^/patients/findadoctor/p\.html$ [OR] RewriteCond %{REQUEST_URI} ^/patients/findadoctor/q\.html$ [OR] RewriteCond %{REQUEST_URI} ^/patients/findadoctor/r\.html$ [OR] RewriteCond %{REQUEST_URI} ^/patients/findadoctor/s\.html$ [OR] RewriteCond %{REQUEST_URI} ^/patients/findadoctor/t\.html$ [OR] RewriteCond %{REQUEST_URI} ^/patients/findadoctor/u\.html$ [OR] RewriteCond %{REQUEST_URI} ^/patients/findadoctor/v\.html$ [OR] RewriteCond %{REQUEST_URI} ^/patients/findadoctor/w\.html$ [OR] RewriteCond %{REQUEST_URI} ^/patients/findadoctor/x\.html$ [OR] RewriteCond %{REQUEST_URI} ^/patients/findadoctor/y\.html$ [OR] RewriteCond %{REQUEST_URI} ^/patients/findadoctor/z\.html$ RewriteRule ^patients/findadoctor/(.*)\.html$ findadoctor.php?id=$1 [L,NC] like that there is lots of rules around 250 line please help me...

    Read the article

  • Java Slick2d Animation not working

    - by user3558075
    Hello everyone I am trying to make a simple 2d game using java and the slick2d library. this is my first time doing it and i need some help. right now I am trying to make the Animations for the character, so that when you go right he turns right and when you go left he turns left... but I keep getting an error when im drawing the character, ive try'd re-downloading slick but that didnt work. when i get rid of the player.draw(x,y); line of code it dosen't crash but the character isnt there. heres my code, can anyone help? package enteties; import input.Keyinput; import org.newdawn.slick.Animation; import org.newdawn.slick.GameContainer; import org.newdawn.slick.Graphics; import org.newdawn.slick.Image; import org.newdawn.slick.Input; import org.newdawn.slick.SlickException; import org.newdawn.slick.state.BasicGameState; import org.newdawn.slick.state.StateBasedGame; import playerinfo.Playerinfo; public class Player extends BasicGameState{ Playerinfo pi = new Playerinfo(); Keyinput ki = new Keyinput(); Animation player,up,down,left,right; public void init(GameContainer gc, StateBasedGame sbg) throws SlickException { Image[] goingUp = {new Image("res/buckysBack.png") , new Image("res/charBack.png")}; Image[] goingDown = {new Image("res/buckysFront.png") , new Image("res/charFront.png")}; Image[] goingLeft = {new Image("res/buckysLeft.png") , new Image("res/charLeft.png")}; Image[] goingRight = {new Image("res/buckysRight.png") , new Image("res/charRight.png")}; int[] duration = {200,200}; Animation up = new Animation(goingUp,duration,false); Animation down = new Animation(goingDown,duration,false); Animation left = new Animation(goingLeft,duration,false); Animation right = new Animation(goingRight,duration,false); player = up; } public void render(GameContainer gc, StateBasedGame sbg, Graphics g) throws SlickException { //error happens here, when i remove this line it dosent crash player.draw(720,450); } public void update(GameContainer gc, StateBasedGame sbg, int delta) throws SlickException { } public int getID() { return 0; } }

    Read the article

  • How to optimize a box2d simulation in action game?

    - by nathan
    I'm working on an action game and i use box2d for physics. The game use a tiled map. I have different types of body: Static ones used for tiles Dynamic ones for player and enemies Actually i tested my game with ~150 bodies and i have a 60fps constantly on my computer but not on my mobile (android). The FPS drop as the number of body increase. After having profiled the android application, i saw that the World.step took around 8ms in CPU time to execute. Here are few things to note: Not all the world is visible on screen, i use a scrolling system Enemies are constantly moving toward the player so there is alaways to force applied to their body Enemies need to collide between each others Enemies collide with tiles I also now that i can active/desactive or sleep/awake bodies. Considering the fact that only a part of the enemies are possibly displayed on screen, is there any optimizations i can do to reduce the execution time of box2d simulation? I found a guy trying an optimization based on distance of enemies from the player (link). But i seems like he just desactives far bodies (in my case, i could desactive bodies that are not visible). But my enemies need to move even when they are not visible on screen, and applying forces will not workd on inactive bodies. Should i play with sleeping bodies here? Also, enemies are composed by two fixtures and are constantly colliding with each others and with tiles but i really never need to get notified about that. Is there anything i can do to optimize this kind of scenario? Finally, am i wrong to try to run simulation at 60FPS on mobile and should i try to make it run at 30FPS?

    Read the article

  • Unity falling body pendulum behaviour

    - by user3447980
    I wonder if someone could provide some guidance. Im attempting to create a pendulum like behaviour in 2D space in Unity without using a hinge joint. Essentially I want to affect a falling body to act as though it were restrained at the radius of a point, and to be subject to gravity and friction etc. Ive tried many modifications of this code, and have come up with some cool 'strange-attractor' like behaviour but i cannot for the life of me create a realistic pendulum like action. This is what I have so far: startingposition = transform.position; //Get start position newposition = startingposition + velocity; //add old velocity newposition.y -= gravity * Time.deltaTime; //add gravity newposition = pivot + Vector2.ClampMagnitude(newposition-pivot,radius); //clamp body at radius??? velocity = newposition-startingposition; //Get new velocity transform.Translate (velocity * Time.deltaTime, Space.World); //apply to transform So im working out the new position based on the old velocity + gravity, then constraining it to a distance from a point, which is the element in the code i cannot get correct. Is this a logical way to go about it?

    Read the article

  • Slick and Timers?

    - by user3491043
    I'm making a game where I need events to happen in a precise amount of time. Explanation : I want that event A happens at 12000ms, and event B happens every 10000ms. So "if"s should looks like this. //event A if(Ticks == 12000) //do things //even B if(Ticks % 10000 == 0) //do stuff But now how can I have this "Ticks" value ? I tried to declare an int and then increasing it in the update method, I tried 2 ways of increasing it : Ticks++; It doesn't works because the update method is not always called every microseconds. Ticks += delta; It's kinda good but the delta is not always equals to 1, so I can miss the precise values I need in the if statements So if you know how can I do events in a precise amount of time please tell me how can I do this

    Read the article

  • Avoid overwriting all the methods in the child class

    - by Heckel
    The context I am making a game in C++ using SFML. I have a class that controls what is displayed on the screen (manager on the image below). It has a list of all the things to draw like images, text, etc. To be able to store them in one list I created a Drawable class from which all the other drawable class inherit. The image below represents how I would organize each class. Drawable has a virtual method Draw that will be called by the manager. Image and Text overwrite this method. My problem is that I would like Image::draw method to work for Circle, Polygon, etc. since sf::CircleShape and sf::ConvexShape inherit from sf::Shape. I thought of two ways to do that. My first idea would be for Image to have a pointer on sf::Shape, and the subclasses would make it point onto their sf::CircleShape or sf::ConvexShape classes (Like on the image below). In the Polygon constructor I would write something like ptr_shape = &polygon_shape; This doesn't look very elegant because I have two variables that are, in fact, just one. My second idea is to store the sf::CircleShape and sf::ConvexShape inside the ptr_shape like ptr_shape = new sf::ConvexShape(...); and to use a function that is only in ConvexShape I would cast it like so ((sf::ConvexShape*)ptr_shape)->convex_method(); But that doesn't look very elegant either. I am not even sure I am allowed to do that. My question I added details about the whole thing because I thought that maybe my whole architecture was wrong. I would like to know how I could design my program to be safe without overwriting all the Image methods. I apologize if this question has already been asked; I have no idea what to google.

    Read the article

  • No idea of how to simulate car crashes

    - by user2332868
    I have a simple car game with all the basic collision detection and movement in Unity with C#. But when I was building the "engine" for the game I didn't include a detail I later decided to include. I want the possibility so that cars can get damaged and so that the model can change. For example the car looked like it was new and after a crash it looks like a wreck. Please help me by pointing to some resources or by telling me approximate ways of implementing this new feature. Thanks!

    Read the article

  • Java single Array best choice for accessing pixels for manipulation?

    - by Petrol
    I am just watching this tutorial https://www.youtube.com/watch?v=HwUnMy_pR6A and the guy (who seems to be pretty competent) is using a single array to store and access the pixels of his to-be-rendered image. I was wondering if this really is the best way to do this. The alternative of Multi-Array does have one pointer more, but Arrays do have an O(1) for accessing each index and calculating the index in a single array seems to take one addition and one multiplication operation per pixel. And if Multi-Arrays really are bad, can't you use something with Hashing to avoid those addition and multiplication operations? EDIT: here is his code... public class Screen { private int width, height; public int[] pixels; public Screen(int width, int height) { this.width = width; this.height = height; // creating array the size of one index/int for every pixel // single array has better performance than multi-array pixels = new int[width * height]; } public void render() { for (int y = 0; y < height; y++) { for (int x = 0; x < width; x++) { pixels[x + y * width] = 0xff00ff; } } } }

    Read the article

  • How many people should be involved in a game startup? [on hold]

    - by Elemecca
    I want to start an indie game company, and I understand that you need a designer, an engineer, and an artist at the very least. I also know that professional game companies like Bethesda http://bgs.bethsoft.com/ have around 40 people. I want to have a good start, and many of you have been in the industry for a good while. What is a good number of employees to start with for an independent game company? Reasons?

    Read the article

  • Zelda-style top-down RPG. How to store tile and collision data?

    - by Delerat
    I'm looking to build a Zelda: LTTP style top-down RPG. I've read a lot on the subject and am currently going back and forth on a few solutions. I'm using C#, MonoGame, and Tiled. For my tile maps, these are the choices I can see in front of me: Store each tile as its own array. Each one having 3-4 layers, texture/animation, depth, flags, and maybe collision(depending on how I do it). I've read warning about memory issues going this route, and my biggest map will probably be 160x120 tiles. My average map however will be about 40x30. The number of tiles might cut in half if I decide to double my tile size, which is currently 16x16. This is the most appealing approach for me, as I feel like I would know how to save maps, make changes, and separate it into chunks for collision checks. Store the static parts of my tile map in multiple arrays acting as the different layers. Then I would just use entities for anything that wasn't static. All of the other tile data such as collisions, depth, etc., would be stored in their own layers as well I guess? This way just seems messy to me though. Regardless of which one I choose, I'm also unsure how to plan all of that other tile data. I could write a bunch of code that would know which integer represents what tile and it's data, but if I changed a tileset in Tiled and exported it again, all of those integers could potentially change and I'd have to adjust a whole bunch of code. My other issue is about how I could do collision. I want to at least support angled collision that slides you around the corners of objects like LTTP does, if not more oddball shapes as well. So do I: Store collision as a flag for binary collision. Could I get this to support angles? Would it be fine to store collision as an integer and have each number represent a certain angle of collision? Store a list of rectangles or other shapes and do collision that way? Sorry for the large two-part(three-part?) question. I felt like these needed to be asked together as I believe each choice influences the other.

    Read the article

  • Problem with boundary collision

    - by James Century
    The problem: When the player hits the left boundary he stops (this is exactly what I want), when he hits the right boundary. He continues until his rectangle's left boundary meets with the right boundary. Outcome: https://www.youtube.com/watch?v=yuJfIWZ_LL0&feature=youtu.be My Code public class Player extends GameObject{ BufferedImageLoader loader; Texture tex = Game.getInstance(); BufferedImage image; Animation playerWalkLeft; private HealthBarManager healthBar; private String username; private int width; private ManaBarManager manaBar; public Player(float x, float y, ObjectID ID) { super(x, y, ID, null); loader = new BufferedImageLoader(); playerWalkLeft = new Animation(5,tex.player[10],tex.player[11],tex.player[12],tex.player[13],tex.player[14],tex.player[15],tex.player[17],tex.player[18]); } public void tick(LinkedList<GameObject> object) { setX(getX()+velX); setY(getY()+velY); playerWalkLeft.runAnimation(); } public void render(Graphics g) { g.setColor(Color.BLACK); FontMetrics fm = g.getFontMetrics(g.getFont()); if(username != null) width = fm.stringWidth(username); if(username != null){ g.drawString(username,(int) x-width/2+15,(int) y); } if(velX != 0){ playerWalkLeft.drawAnimation(g, (int)x, (int)y); }else{ g.drawImage(tex.player[16], (int)x, (int)y, null); } g.setColor(Color.PINK); g.drawRect((int)x,(int)y,33,48); g.drawRect(0,0,(int)Game.getWalkableBounds().getWidth(), (int)Game.getWalkableBounds().getHeight()); } @SuppressWarnings("unused") private Image getCurrentImage() { return image; } public float getX() { return x; } public float getY() { return y; } public void setX(float x) { Rectangle gameBoundry = Game.getWalkableBounds(); if(x >= gameBoundry.getMinX() && x <= gameBoundry.getMaxX()){ this.x = x; } } public void setY(float y) { //IGNORE THE SetY please. this.y = y; } public float getVelX() { return velX; } public void setHealthBar(HealthBarManager healthBar){ this.healthBar = healthBar; } public HealthBarManager getHealthBar(){ return healthBar; } public float getVelY() { return velY; } public void setVelX(float velX) { this.velX = velX; } public void setVelY(float velY) { this.velY = velY; } public ObjectID getID() { return ID; } public void setUsername(String playerName) { this.username = playerName; } public String getUsername(){ return this.username; } public void setManaBar(ManaBarManager manaBar) { this.manaBar = manaBar; } public ManaBarManager getManaBar(){ return manaBar; } public int getLevel(){ return 1; } public boolean isPlayerInsideBoundry(float x, float y){ Rectangle boundry = Game.getWalkableBounds(); if(boundry.contains(x,y)){ return true; } return false; } } What I've tried: - Using a method that checks if the game boundary contains player boundary rectangle. This gave me the same result as what the check statement in my setX did.

    Read the article

  • How do I get mouse x / y of the world plane in Unity?

    - by Discipol
    I am trying to make a tiled landscape. The terrain itself is not made from tiles but the world has a grid which I define. I would like to place boxes/rectangles which snap to this grid, at runtime, but in order for me to do that I must get a projection from the user screen to the real-world coordinates. I have tried various examples using the Ray class but nothing worked. It compiles and outputs a constant value no matter where I put the mouse. I have tried to add some tiles and try to detect them but no luck. I also tried with one plane as big as my world but still no luck. I am using C# but even a JS version would be helpful. This technique involves calculating which tile the mouse is under by the x and y positions. Perhaps detecting which tile itself is being pointed to would be a simpler task, at which point I can just retrieve its i/j properties. Update: I got it working thanks to some answers, but the ball freaks out towards the far end of the plane. Why is this? https://www.dropbox.com/sh/9pqnl30lm6uwm6h/AACc2JcbW16z6PuHFLLfCAX6a

    Read the article

< Previous Page | 9 10 11 12 13 14 15  | Next Page >