Search Results

Search found 219 results on 9 pages for 'flying sheep'.

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

  • Is the "impossible object" possible in computer graphics?

    - by CPP_Person
    This may be a silly question but I want to know the answer to it. I saw this thing called the "impossible object", while they're many different images of this online, it's suppost to be impossible geometry. Here is an example: Now as far as logic goes, I know you don't have to obey it in games, such as a flying cow, or an impossible object. So that's out of the way, but what stands in my way is whether or not there is a way to draw this onto a 3D scene. Like is there a way to represent it as a 3D object? Thanks!

    Read the article

  • Installing fonts

    - by Lazar
    I have "white nights" trying to install Hebrew/Arabic fonts on my level 7 (API 2.1) aka Nexus emulator. I can't understand why Google guys will want to waist my skills do something helpful for the community using Hebrew/Arabic fonts. After rw mount/remount I can do it for level 3 devices, but for Nexus - nada! Why? What can be done? Real devices guys already broke this peace of hardware, but I am sitting and looking wide eyes open like a sheep. Please make me happy and give the chance to install the fonts. That's what must be done for some of us: We need system image saved on exit for tomorrow to continue the work Open emulator to work in peace cp command included with the SDK. Thanks for any help

    Read the article

  • Python 3.1.1 Problem With Tuples

    - by Protean
    This piece of code is supposed to go through a list and preform some formatting to the items, such as removing quotations, and then saving it to another list. class process: def rchr(string_i, asciivalue): string_o = () for i in range(len(string_i)): if ord(string_i[i]) != asciivalue: string_o += string_i[i] return string_o def flist(self, list_i): cache = () cache_list = [] for line in list_i: cache = line.split('\t') cacbe[0] = process.rchr(str(cache[0]), 34) cache_list.append(cache[0]) cache_list[index] = cache index += 1 cache_list.sort() return cache_list p = process() list1a = ['cow', 'dog', '"sheep"'] list1 = p.flist(list1a) print (country_list) However; it chokes at 'string_o += string_i[i]' and gives the following error: Traceback (most recent call last): File "/Projects/Python/safafa.py", line 23, in <module> list1 = p.flist(list1a) File "/Projects/Python/safafa.py", line 14, in flist cacbe[0] = process.rchr(str(cache[0]), 34) File "/Projects/Python/safafa.py", line 7, in rchr string_o += string_i[i] TypeError: can only concatenate tuple (not "str") to tuple

    Read the article

  • show a new view after x seconds?

    - by user301496
    hey all, i'm quite new to objective c and i have this problem. i'm animating an image an show this in a imageview. after 15 seconds i want to show another view, thought of a "flying in view from the bottom". any hints fpr me how i could manage that? thanx in advance marcus

    Read the article

  • Librarys for DD 5.1 sound

    - by krupert
    I would like to generate, play, record Dolby Digital 5.1 sounds. My goal is a program like "atmosphere" . A good source for sounds is freesound.org. I would like a been flying from left behind to front right, fading away.

    Read the article

  • Collision Detection for arbitrarily sized, positioned and rotated rectangles in XNA

    - by Stefan
    I'm working with xna in C# and in my game I will have a variety of space ships flying all over the place. They will each have an arbitrary rotation, size and position in space and I need a method to determine when they collide. Ideally the method would take two Rectangles, two doubles and two Vector2s for size, rotation and position respectively and return a boolean that indicates whether they have intersected or not.

    Read the article

  • C++: type Length from float

    - by anon
    This is kinda like my earlier question: http://stackoverflow.com/questions/2451175/c-vector3-type-wall Except, now, I want to do this to a builtin rather then a user created type. So I want a type "Length" that behaves just like float -- except I'm going to make it's constructor explicit, so I have to explicitly construct Length objects (rather than have random conversions flying around). Basically, I'm going into the type-a-lot camp.

    Read the article

  • b2Body moves without stopping

    - by SentineL
    I got a quite strange bug. It is difficult to explain it in two words, but i'll try to do this in short. My b2Body has restitution, friction, density, mass and collision group. I controlling my b2Body via setting linear velocity to it (called on every iteration): (void)moveToDirection:(CGPoint)direction onlyHorizontal:(BOOL)horizontal { b2Vec2 velocity = [controlledObject getBody]-GetLinearVelocity(); double horizontalSpeed = velocity.x + controlledObject.acceleration * direction.x; velocity.x = (float32) (abs((int) horizontalSpeed) < controlledObject.runSpeed ? horizontalSpeed : controlledObject.maxSpeed * direction.x); if (!horizontal) { velocity.y = velocity.y + controlledObject.runSpeed * direction.y; } [controlledObject getBody]->SetLinearVelocity(velocity); } My floor is static b2Body, it has as restitution, friction, density, mass and same collision group in some reason, I'm setting b2Body's friction of my Hero to zero when it is moving, and returning it to 1 when he stops. When I'm pushing run button, hero runs. when i'm releasing it, he stops. All of this works perfect. On jumping, I'm setting linear velocity to my Hero: (void)jump { b2Vec2 velocity = [controlledObject getBody]->GetLinearVelocity(); velocity.y = velocity.y + [[AppDel cfg] getHeroJumpVlelocity]; [controlledObject getBody]->SetLinearVelocity(velocity); } If I'll run, jump, and release run button, while he is in air, all will work fine. And here is my problem: If I'll run, jump, and continue running on landing (or when he goes from one static body to another: there is small fall, probably), Hero will start move, like he has no friction, but he has! I checked this via beakpoints: he has friction, but I can move left of right, and he will never stop, until i'll jump (or go from one static body to another), with unpressed running button. I allready tried: Set friction to body on every iteration double-check am I setting friction to right fixture. set Linear Damping to Hero: his move slows down on gugged moveing. A little more code: I have a sensor and body fixtures in my hero: (void) addBodyFixture { b2CircleShape dynamicBox; dynamicBox.m_radius = [[AppDel cfg] getHeroRadius]; b2FixtureDef bodyFixtureDef; bodyFixtureDef.shape = &dynamicBox; bodyFixtureDef.density = 1.0f; bodyFixtureDef.friction = [[AppDel cfg] getHeroFriction]; bodyFixtureDef.restitution = [[AppDel cfg] getHeroRestitution]; bodyFixtureDef.filter.categoryBits = 0x0001; bodyFixtureDef.filter.maskBits = 0x0001; bodyFixtureDef.filter.groupIndex = 0; bodyFixtureDef.userData = [NSNumber numberWithInt:FIXTURE_BODY]; [physicalBody addFixture:bodyFixtureDef]; } (void) addSensorFixture { b2CircleShape sensorBox; sensorBox.m_radius = [[AppDel cfg] getHeroRadius] * 0.95; sensorBox.m_p.Set(0, -[[AppDel cfg] getHeroRadius] / 10); b2FixtureDef sensor; sensor.shape = &sensorBox; sensor.filter.categoryBits = 0x0001; sensor.filter.maskBits = 0x0001; sensor.filter.groupIndex = 0; sensor.isSensor = YES; sensor.userData = [NSNumber numberWithInt:FIXTURE_SENSOR]; [physicalBody addFixture:sensor]; } Here I'm tracking is hero in air: void FixtureContactListener::BeginContact(b2Contact* contact) { // We need to copy out the data because the b2Contact passed in // is reused. Squirrel *squirrel = (Squirrel *)contact->GetFixtureB()->GetBody()->GetUserData(); if (squirrel) { [squirrel addContact]; } } void FixtureContactListener::EndContact(b2Contact* contact) { Squirrel *squirrel = (Squirrel *)contact->GetFixtureB()->GetBody()->GetUserData(); if (squirrel) { [squirrel removeContact]; } } here is Hero's logic on contacts: - (void) addContact { if (contactCount == 0) [self landing]; contactCount++; } - (void) removeContact { contactCount--; if (contactCount == 0) [self flying]; if (contactCount <0) contactCount = 0; } - (void)landing { inAir = NO; acceleration = [[AppDel cfg] getHeroRunAcceleration]; [sprite stopAllActions]; (running ? [sprite runAction:[self runAction]] : [sprite runAction:[self standAction]]); } - (void)flying { inAir = YES; acceleration = [[AppDel cfg] getHeroAirAcceleration]; [sprite stopAllActions]; [self flyAction]; } here is Hero's moving logic: - (void)stop { running = NO; if (!inAir) { [sprite stopAllActions]; [sprite runAction:[self standAction]]; } } - (void)left { [physicalBody setFriction:0]; if (!running && !inAir) { [sprite stopAllActions]; [sprite runAction:[self runAction]]; } running = YES; moveingDirection = NO; [bodyControls moveToDirection:CGPointMake(-1, 0) onlyHorizontal:YES]; } - (void)right { [physicalBody setFriction:0]; if (!running && !inAir) { [sprite stopAllActions]; [sprite runAction:[self runAction]]; } running = YES; moveingDirection = YES; [bodyControls moveToDirection:CGPointMake(1, 0) onlyHorizontal:YES]; } - (void)jump { if (!inAir) { [bodyControls jump]; } } and here is my update method (called on every iteration): - (void)update:(NSMutableDictionary *)buttons { if (!isDead) { [self updateWithButtonName:BUTTON_LEFT inButtons:buttons whenPressed:@selector(left) whenUnpressed:@selector(stop)]; [self updateWithButtonName:BUTTON_RIGHT inButtons:buttons whenPressed:@selector(right) whenUnpressed:@selector(stop)]; [self updateWithButtonName:BUTTON_UP inButtons:buttons whenPressed:@selector(jump) whenUnpressed:@selector(nothing)]; [self updateWithButtonName:BUTTON_DOWN inButtons:buttons whenPressed:@selector(nothing) whenUnpressed:@selector(nothing)]; [sprite setFlipX:(moveingDirection)]; } [self checkPosition]; if (!running) [physicalBody setFriction:[[AppDel cfg] getHeroFriction]]; else [physicalBody setFriction:0]; } - (void)updateWithButtonName:(NSString *)buttonName inButtons:(NSDictionary *)buttons whenPressed:(SEL)pressedSelector whenUnpressed:(SEL)unpressedSelector { NSNumber *buttonNumber = [buttons objectForKey:buttonName]; if (buttonNumber == nil) return; if ([buttonNumber boolValue]) [self performSelector:pressedSelector]; else [self performSelector:unpressedSelector]; } - (void)checkPosition { b2Body *body = [self getBody]; b2Vec2 position = body->GetPosition(); CGPoint inWorldPosition = [[AppDel cfg] worldMeterPointFromScreenPixel:CGPointMake(position.x * PTM_RATIO, position.y * PTM_RATIO)]; if (inWorldPosition.x < 0 || inWorldPosition.x > WORLD_WIDGH / PTM_RATIO || inWorldPosition.y <= 0) { [self kill]; } }

    Read the article

  • Running a scheduled task as SYSTEM with console window open

    - by raoulsson
    I am auto creating scheduled tasks with this line within a batch windows script: schtasks /Create /RU SYSTEM /RP SYSTEM /TN startup-task-%%i /TR %SPEEDWAY_DIR%\%TARGET_DIR%%%i\%STARTUPFILE% /SC HOURLY /MO 1 /ST 17:%%i1:00 I wanted to avoid using specific user credentials and thus decided to use SYSTEM. Now, when checking in the taskmanagers process list or, even better, directly with the C:\> schtasks command itself, all is working well, the tasks are running as intended. However in this particular case I would like to have an open console window where I can see the log flying by. I know I could use C:\> tail -f thelogfile.log if I installed e.g. cygwin (on all machines) or some proprietary tools like Baretail on Windows. But since I only switch to these machines in case of trouble, I would prefer to start the scheduled task in such a way that every user immediately sees the log. Any chance? Thanks!

    Read the article

  • Unable to connect to Adobe Connect

    - by ub3rst4r
    I am having troubles trying to connect my colleges Adobe Connect. I have done the test meeting connection and it will say "Unable to connect". I have tried connecting on 3 other computers and it works with flying colors. I am running Norton 360 on my computer and I also tried it on my other laptop thats also running Norton 360 and it works on that laptop. I also checked my hosts file and that is not the problem because I am able to connect to the server (on port 80) but not the Adobe Connect port (port 1935). The only thing in it is "127.0.0.1 localhost" Here are the details from the log that the test created: Player Version: WIN 11,3,300,271 App-Server returned: code:ok, servers=rtmp://connect.bowvalleycollege.ca:1935/_rtmp://localhost:8506/,rtmpt://connect.bowvalleycollege.ca:443/_rtmp://localhost:8506/ ERROR: FMS Server did not return correctly! Here is my specifications: Windows 7 SP1 x64 Norton 360 v6.3 (latest) It won't connect in Firefox v15, Chrome v19, or IE9 All of my computers are connected through the same router (D-Link DIR-625) Any ideas?

    Read the article

  • What's the point of Netgear's WNHDB3004 "3DHD WIRELESS HOME THEATER NETWORKING KIT"

    - by badp
    Here's a crude representation of what I've got at home: floor 2 INTERNETS ---- MODEM/ROUTER ---- MY COMPUTER | floor 1 WIFI REPEATER ---- stuff | floor 0 more stuff TELEVISION Now, as part of our sat tv subscription we can get an additional service if we connect our decoder (located by TELEVISION obviously) to the internet. What they suggest is buying a Netgear 3DHD WIRELESS HOME THEATER NETWORKING KIT holy shit isn't my bullshit-o-meter flying high right now from the general buzzwordyness of this thing. What does this thing actually do that our existing wireless-enabled routers don't do? What's the point of having a third wifi router in the same house, this time only for one television? If I do decide to plunge €99 for this, should I connect it to the wifi repeater (which does not provide AAA quality internet, at least for all gaming purposes) or to my modem/router (risking issues with low signal?).

    Read the article

  • Running a scheduled task as SYSTEM with console window open

    - by raoulsson
    I am auto creating scheduled tasks with this line within a batch windows script: schtasks /Create /RU SYSTEM /RP SYSTEM /TN startup-task-%%i /TR %SPEEDWAY_DIR%\%TARGET_DIR%%%i\%STARTUPFILE% /SC HOURLY /MO 1 /ST 17:%%i1:00 I wanted to avoid using specific user credentials and thus decided to use SYSTEM. Now, when checking in the taskmanagers process list or, even better, directly with the C:\> schtasks command itself, all is working well, the tasks are running as intended. However in this particular case I would like to have an open console window where I can see the log flying by. I know I could use C:\> tail -f thelogfile.log if I installed e.g. cygwin (on all machines) or some proprietary tools like Baretail on Windows. But since I only switch to these machines in case of trouble, I would prefer to start the scheduled task in such a way that every user immediately sees the log. Any chance? Thanks!

    Read the article

  • Microsoft Forefront Management Gateway 2010 - Which topology to choose for monitoring only server?

    - by MadBoy
    Hello, I've installed Forefront and wanted to use it as monitoring traffic solution until we decide to put it as a router. I've 2 nic's assigned to this virtual machine. One NIC has connected port which is "mirror port" of our WAN redirected on switch so it sees all the network traffic flying by. The other NIC is internet access. This server is located inside our lan network. What topology should i choose and which options I should look at to be able to see which traffic is used (SMTP, WWW etc) and who does what? We had cases of infected machines with spam and we want to be able to see that some machine is sending large amounts of mails. Is that possible ?

    Read the article

  • Silverlight Cream for March 13, 2010 -- #813

    - by Dave Campbell
    In this Issue: András Velvárt, Bobby Diaz, John Papa/Laurent Bugnion, Jesse Liberty, Christopher Bennage, Tim Greenfield, and Cameron Albert. Shoutouts: Svetla Stoycheva of SilverlightShow has an Interview with SilverlightShow Eco Contest Grand Prize Winner Daniel James Svetla Stoycheva of SilverlightShow also has an Interview with SilverlightShow Eco Contest Community Vote Winner Cigdem Patlak File this under #DoesHeEverSleep, Nokola has an EasyPainter Source Pack 1 Refresh And another filing in the same category by Nokola: EasyPainter Source Pack 2: Flickr, ComboCheckBox and more! In my last pre-#MIX10 'Cream post: From SilverlightCream.com: A Designer-friendly Approach to MVVM András Velvárt has an MVVM tutorial up on SilverlightShow from the Designer perspective of wiring up the View and ViewModel... good stuff my friend! Generate Strongly Typed Observable Events for the Reactive Extensions for .NET (Rx) In an effort to get more familiar with Rx, Bobby Diaz built a WhiteBoard app... there's a demo page plus the source... thanks Bobby! Silverlight TV 13: MVVM Light Toolkit My friend Laurent Bugnion is probably in the air flying to MIX10 right now, but at the MVP Summit last month, he recorded with John Papa and they produced an episode of Silverlight TV for Laurent's MVVM Light ... good stuff guys... see you tomorrow :) WCF Ria Services For Real Jesse Liberty has a great tutorial up on what it takes to get real data into your app ... you know... the stuff you have to get after reading a blog post that uses local stuff :) 1 Simple Step for Commanding in Silverlight Christopher Bennage is discussing Commanding and of course is using Caliburn for the example :) Use Silverlight Reactive Extensions (Rx) to build responsive UIs Tim Greenfield is beginning a two-parter on using Rx. In this first he has a comparison of with and without Rx... cool idea. General Purpose Sprite Class On the heels of Bill Reiss' Sprite posts, Cameron Albert has a General Purpose Sprite class post up using Bill's SilverSprite. Stay in the 'Light! Twitter SilverlightNews | Twitter WynApse | WynApse.com | Tagged Posts | SilverlightCream Join me @ SilverlightCream | Phoenix Silverlight User Group Technorati Tags: Silverlight    Silverlight 3    Silverlight 4    MIX10

    Read the article

  • Future Air Plane – A new world

    - by Rekha
    For the first time in my life, I wished I had more number of years to live. The world has evolved from the cave man life to the man who is almost The Creator. When I was about 12 years old, I was taken to Chennai Planetarium for my school excursion. That day we were made to lie down in a dark room and the ceiling was full of stars and planets. All those were just videos but the day still stands in my mind. Same kind of experience in real is waiting for our future generations.Even though the English movies have gone beyond imaginations, we still have chances to bring those imaginations to real. You must be wondering why all these hype. Recently Airbus unveiled a news on transparent Airplane in 2050. This Airplane will have a body transparent to view the sky from all sides of the airplane when we are flying high above the grounds. And it will have all possible technologies under one roof that would give immense pleasure for the passengers. The journey would be an unforgettable one for each one of us. Image and News Credit: Daily Telegraph This article titled,Future Air Plane – A new world, was originally published at Tech Dreams. Grab our rss feed or fan us on Facebook to get updates from us.

    Read the article

  • N64oid Brings N64 Emulation to Android Devices

    - by ETC
    Craving some Ocarina of Time adventures, Super Mario 64 antics, or some Star Fox 64 flying on your Android device? N64oid brings retro emulation of Nintendo’s popular N64 console to Android devices. N64oid is an N64 console emulator for Android devices. You’ll need a copy of the $5.99 emulator, ROMs (from the usual sources, unless you’ve got a ROM ripping setup in your basement and a stack of old cartridges), and a suitably speedy Android device. Older Android devices will find the playback choppy and subpar, but newer and speedier devices like the Nexus-One and Samsung Galaxy should have no problem handling the emulator. Like all emulators N64oid is a work in progress and emulating an entire closed-system console on a totally different set of hardware is never a perfect 1:1 emulation, but if you’re a die hard fan of classic N64 titles (check out this list of top ranked titles to inspire some nostalgia) N64oid is worth the price of a burger for sure. N64oid [Android Market via Download Squad] Latest Features How-To Geek ETC Learn To Adjust Contrast Like a Pro in Photoshop, GIMP, and Paint.NET Have You Ever Wondered How Your Operating System Got Its Name? Should You Delete Windows 7 Service Pack Backup Files to Save Space? What Can Super Mario Teach Us About Graphics Technology? Windows 7 Service Pack 1 is Released: But Should You Install It? How To Make Hundreds of Complex Photo Edits in Seconds With Photoshop Actions Super-Charge GIMP’s Image Editing Capabilities with G’MIC [Cross-Platform] Access and Manage Your Ubuntu One Account in Chrome and Iron Mouse Over YouTube Previews YouTube Videos in Chrome Watch a Machine Get Upgraded from MS-DOS to Windows 7 [Video] Bring the Whole Ubuntu Gang Home to Your Desktop with this Mascots Wallpaper Hack Apart a Highlighter to Create UV-Reactive Flowers [Science]

    Read the article

  • MIA

    - by Robert May
    So, I’ve been missing in action on this blog for quite some time.  I need to rectify that. Part of the reason I’ve been absent is because I haven’t be able to talk about what I’m working on.  A former client watches my blog rather closely, and although we accomplished many good things together, their culture is such that they really don’t like people to freely express their thoughts (you’ll note my blog posts stopped rather abruptly).  I learned some really important lessons about Agile in the last 3 years, and I think its worthwhile to talk about them.  Sometimes things worked really well, sometimes, they failed failed.  Sometimes that failure was me, sometimes it wasn’t. I understand Agile better now, and hopefully, what I have to say will guide others through this process and help others understand Agile better. One thing that I’ve learned is that MANY companies that say they are doing Agile are NOT really doing Agile.  To often, they pick the things they like and don’t follow the process long enough to know what rules they can break, and which ones they shouldn’t.  This is probably the primary reason why Agile fails. So, expect more posts, especially as I’m flying coast to coast. :)

    Read the article

  • Game Over function is not working Starling

    - by aNgeLyN omar
    I've been following a tutorial over the web but it somehow did not show something about creating a game over function. I am new to the Starling framework and Actionscript so I'm kind of still trying to find a way to make it work. Here's the complete snippet of the code. package screens { import flash.geom.Rectangle; import flash.utils.getTimer; import events.NavigationEvent; import objects.GameBackground; import objects.Hero; import objects.Item; import objects.Obstacle; import starling.display.Button; import starling.display.Image; import starling.display.Sprite; import starling.events.Event; import starling.events.Touch; import starling.events.TouchEvent; import starling.text.TextField; import starling.utils.deg2rad; public class InGame extends Sprite { private var screenInGame:InGame; private var screenWelcome:Welcome; private var startButton:Button; private var playAgain:Button; private var bg:GameBackground; private var hero:Hero; private var timePrevious:Number; private var timeCurrent:Number; private var elapsed:Number; private var gameState:String; private var playerSpeed:Number = 0; private var hitObstacle:Number = 0; private const MIN_SPEED:Number = 650; private var scoreDistance:int; private var obstacleGapCount:int; private var gameArea:Rectangle; private var touch:Touch; private var touchX:Number; private var touchY:Number; private var obstaclesToAnimate:Vector.<Obstacle>; private var itemsToAnimate:Vector.<Item>; private var scoreText:TextField; private var remainingLives:TextField; private var gameOverText:TextField; private var iconSmall:Image; static private var lives:Number = 2; public function InGame() { super(); this.addEventListener(starling.events.Event.ADDED_TO_STAGE, onAddedToStage); } private function onAddedToStage(event:Event):void { this.removeEventListener(Event.ADDED_TO_STAGE, onAddedToStage); drawGame(); scoreText = new TextField(300, 100, "Score: 0", "MyFontName", 35, 0xD9D919, true); remainingLives = new TextField(600, 100, "Lives: " + lives +" X ", "MyFontName", 35, 0xD9D919, true); iconSmall = new Image(Assets.getAtlas().getTexture("darnahead1")); iconSmall.x = 360; iconSmall.y = 40; this.addChild(iconSmall); this.addChild(scoreText); this.addChild(remainingLives); } private function drawGame():void { bg = new GameBackground(); this.addChild(bg); hero = new Hero(); hero.x = stage.stageHeight / 2; hero.y = stage.stageWidth / 2; this.addChild(hero); startButton = new Button(Assets.getAtlas().getTexture("startButton")); startButton.x = stage.stageWidth * 0.5 - startButton.width * 0.5; startButton.y = stage.stageHeight * 0.5 - startButton.height * 0.5; this.addChild(startButton); gameArea = new Rectangle(0, 100, stage.stageWidth, stage.stageHeight - 250); } public function disposeTemporarily():void { this.visible = false; } public function initialize():void { this.visible = true; this.addEventListener(Event.ENTER_FRAME, checkElapsed); hero.x = -stage.stageWidth; hero.y = stage.stageHeight * 0.5; gameState ="idle"; playerSpeed = 0; hitObstacle = 0; bg.speed = 0; scoreDistance = 0; obstacleGapCount = 0; obstaclesToAnimate = new Vector.<Obstacle>(); itemsToAnimate = new Vector.<Item>(); startButton.addEventListener(Event.TRIGGERED, onStartButtonClick); //var mainStage:InGame =InGame.current.nativeStage; //mainStage.dispatchEvent(new Event(Event.COMPLETE)); //playAgain.addEventListener(Event.TRIGGERED, onRetry); } private function onStartButtonClick(event:Event):void { startButton.visible = false; startButton.removeEventListener(Event.TRIGGERED, onStartButtonClick); launchHero(); } private function launchHero():void { this.addEventListener(TouchEvent.TOUCH, onTouch); this.addEventListener(Event.ENTER_FRAME, onGameTick); } private function onTouch(event:TouchEvent):void { touch = event.getTouch(stage); touchX = touch.globalX; touchY = touch.globalY; } private function onGameTick(event:Event):void { switch(gameState) { case "idle": if(hero.x < stage.stageWidth * 0.5 * 0.5) { hero.x += ((stage.stageWidth * 0.5 * 0.5 + 10) - hero.x) * 0.05; hero.y = stage.stageHeight * 0.5; playerSpeed += (MIN_SPEED - playerSpeed) * 0.05; bg.speed = playerSpeed * elapsed; } else { gameState = "flying"; } break; case "flying": if(hitObstacle <= 0) { hero.y -= (hero.y - touchY) * 0.1; if(-(hero.y - touchY) < 150 && -(hero.y - touchY) > -150) { hero.rotation = deg2rad(-(hero.y - touchY) * 0.2); } if(hero.y > gameArea.bottom - hero.height * 0.5) { hero.y = gameArea.bottom - hero.height * 0.5; hero.rotation = deg2rad(0); } if(hero.y < gameArea.top + hero.height * 0.5) { hero.y = gameArea.top + hero.height * 0.5; hero.rotation = deg2rad(0); } } else { hitObstacle-- cameraShake(); } playerSpeed -= (playerSpeed - MIN_SPEED) * 0.01; bg.speed = playerSpeed * elapsed; scoreDistance += (playerSpeed * elapsed) * 0.1; scoreText.text = "Score: " + scoreDistance; initObstacle(); animateObstacles(); createEggItems(); animateItems(); remainingLives.text = "Lives: "+lives + " X "; if(lives == 0) { gameState = "over"; } break; case "over": gameOver(); break; } } private function gameOver():void { gameOverText = new TextField(800, 400, "Hero WAS KILLED!!!", "MyFontName", 50, 0xD9D919, true); scoreText = new TextField(800, 600, "Score: "+scoreDistance, "MyFontName", 30, 0xFFFFFF, true); this.addChild(scoreText); this.addChild(gameOverText); playAgain = new Button(Assets.getAtlas().getTexture("button_tryAgain")); playAgain.x = stage.stageWidth * 0.5 - startButton.width * 0.5; playAgain.y = stage.stageHeight * 0.75 - startButton.height * 0.75; this.addChild(playAgain); playAgain.addEventListener(Event.TRIGGERED, onRetry); } private function onRetry(event:Event):void { playAgain.visible = false; gameOverText.visible = false; scoreText.visible = false; var btnClicked:Button = event.target as Button; if((btnClicked as Button) == playAgain) { this.dispatchEvent(new NavigationEvent(NavigationEvent.CHANGE_SCREEN, {id: "playnow"}, true)); } disposeTemporarily(); } private function animateItems():void { var itemToTrack:Item; for(var i:uint = 0; i < itemsToAnimate.length; i++) { itemToTrack = itemsToAnimate[i]; itemToTrack.x -= playerSpeed * elapsed; if(itemToTrack.bounds.intersects(hero.bounds)) { itemsToAnimate.splice(i, 1); this.removeChild(itemToTrack); } if(itemToTrack.x < -50) { itemsToAnimate.splice(i, 1); this.removeChild(itemToTrack); } } } private function createEggItems():void { if(Math.random() > 0.95){ var itemToTrack:Item = new Item(Math.ceil(Math.random() * 10)); itemToTrack.x = stage.stageWidth + 50; itemToTrack.y = int(Math.random() * (gameArea.bottom - gameArea.top)) + gameArea.top; this.addChild(itemToTrack); itemsToAnimate.push(itemToTrack); } } private function cameraShake():void { if(hitObstacle > 0) { this.x = Math.random() * hitObstacle; this.y = Math.random() * hitObstacle; } else if(x != 0) { this.x = 0; this.y = 0; lives--; } } private function initObstacle():void { if(obstacleGapCount < 1200) { obstacleGapCount += playerSpeed * elapsed; } else if(obstacleGapCount !=0) { obstacleGapCount = 0; createObstacle(Math.ceil(Math.random() * 5), Math.random() * 1000 + 1000); } } private function animateObstacles():void { var obstacleToTrack:Obstacle; for(var i:uint = 0; i<obstaclesToAnimate.length; i++) { obstacleToTrack = obstaclesToAnimate[i]; if(obstacleToTrack.alreadyHit == false && obstacleToTrack.bounds.intersects(hero.bounds)) { obstacleToTrack.alreadyHit = true; obstacleToTrack.rotation = deg2rad(70); hitObstacle = 30; playerSpeed *= 0.5; } if(obstacleToTrack.distance > 0) { obstacleToTrack.distance -= playerSpeed * elapsed; } else { if(obstacleToTrack.watchOut) { obstacleToTrack.watchOut = false; } obstacleToTrack.x -= (playerSpeed + obstacleToTrack.speed) * elapsed; } if(obstacleToTrack.x < -obstacleToTrack.width || gameState == "over") { obstaclesToAnimate.splice(i, 1); this.removeChild(obstacleToTrack); } } } private function checkElapsed(event:Event):void { timePrevious = timeCurrent; timeCurrent = getTimer(); elapsed = (timeCurrent - timePrevious) * 0.001; } private function createObstacle(type:Number, distance:Number):void{ var obstacle:Obstacle = new Obstacle(type, distance, true, 300); obstacle.x = stage.stageWidth; this.addChild(obstacle); if(type >= 4) { if(Math.random() > 0.5) { obstacle.y = gameArea.top; obstacle.position = "top" } else { obstacle.y = gameArea.bottom - obstacle.height; obstacle.position = "bottom"; } } else { obstacle.y = int(Math.random() * (gameArea.bottom - obstacle.height - gameArea.top)) + gameArea.top; obstacle.position = "middle"; } obstaclesToAnimate.push(obstacle); } } }

    Read the article

  • Camera field of view: 3D projections & trigonometry

    - by Thomas O
    Okay, here goes. I have a camera at (Xc, Yc, Zc.) The Xc and Yc coordinates are latitude/longitude, and the Zc coordinate is an altitude in metres. I have a point at (Xp, Yp, Zp) and a field of view on the camera (Th1, Th2) - where Th1 is horizontal FOV and Th2 is vertical FOV. Given this information, I'd like to: test if the point is visible (i.e. in the camera's FOV) project the point as the camera would see it I've figured out already that the camera's horizontal view at any given distance is tan(Th1) * distance, but I don't know how to test if the point is visible. Accuracy is not critical. I would prefer a simple solution over a complicated solution, if it works well enough. The computations will be performed by a small microcontroller, which isn't very fast at things like trig functions. P.S. this is not homework, I'm doing this for some game development. It will be integrated with the real world, hence the latitude/longitude/altitude. It involves flying real RC planes through virtual hoops (or chasing virtual targets), so I have to project the positions of these hoops on a display.

    Read the article

  • Similar domains using my business' content, and stealing SEO results

    - by Murciano
    I've been hired to create a website for a restaurant in my city, let's call it "Flying Dragon" Chinese restaurant. The restaurant has never had a website, though the business itself is about ten years old. However, if you Google the restaurant's name, the first site that comes up seems to be affiliated with the restaurant itself, even though it is not. This site - let's say, flyingdragonchinese.com - is also the one that Google has apparently selected, in its results, to be the official website of the restaurant - in essence, the first Google result is flyingdragonchinese.com, and directly beneath it, within the same entry, are the Google reviews and contact information. Upon visiting flyingdragonchinese.com (again, not the actual name), I see that the website has taken the menu content from the restaurant, in the same manner that Yelp does, but it also seems (to the untrained eye) to be the restaurant's official site. Basically, someone has created a fake website for the business (I am not sure why) using its actual menu and contact information, and is hogging the search results. The concept is similar to a "scraping site" except that the information seems to have been stolen manually. The main problem is that visitors to this site will have an inaccurate impression of the restaurant. I feel like the obvious solution is to register a new domain for my site, and simply beat out this competitor (or whatever it is) with smarter SEO and business verification with Google. However, the Conan-the-Barbarian-web-designer part of me wants to somehow bash this other site (deservedly?) into oblivion. But I don't know what I can really do, besides maybe issuing a cease-and-desist letter, or trying to contact the web host for the site, although there is no contact information available on this "fake" site for the site owner. Has anyone ever experienced something like this? Is there any solution?

    Read the article

  • Coarse Collision Detection in highly dynamic environment

    - by Millianz
    I'm currently working a 3D space game with A LOT of dynamic objects that are all moving (there is pretty much no static environment). I have the collision detection and resolution working just fine, but I am now trying to optimize the collision detection (which is currently O(N^2) -- linear search). I thought about multiple options, a bounding volume hierarchy, a Binary Spatial Partitioning tree, an Octree or a Grid. I however need some help with deciding what's best for my situation. A grid seems unfeasible simply due to the space requirements and cache coherence problems. Since everything is so dynamic however, it seems to be that trees aren't ideal either, since they would have to be completely rebuilt every frame. I must admit I never implemented a physics engine that required spatial partitioning, do I indeed need to rebuild the tree every frame (assuming that everything is constantly moving) or can I update the trees after integrating? Advice is much appreciated - to give some more background: You're flying a space ship in an asteroid field, and there are lots and lots of asteroids and some enemy ships, all of which shoot bullets. EDIT: I came across the "Sweep an Prune" algorithm, which seems like the right thing for my purposes. It appears like the right mixture of fast building of the data structures involved and detailed enough partitioning. This is the best resource I can find: http://www.codercorner.com/SAP.pdf If anyone has any suggestions whether or not I'm going in the right direction, please let me know.

    Read the article

  • SQLAuthority News – #SQLPASS 2012 Schedule – Where can You Find Me

    - by pinaldave
    Yesterday I wrote about my memory lane with SQLPASS. It has been a fantastic experience and I am very confident that this year the same excellent experience is going to be repeated. Before I start for #SQLPASS every year, I plan where I want to be and what I will be doing. As I travel from India to attend this event (22+ hours flying time and door to door travel time around 36 hours), it is very crucial that I plan things in advance. This year here is my quick note where I will be during the SQLPASS event. If you can stop with me, I would like to meet you, shake your hand and will archive memories as a photograph. Tuesday, November 6, 2012 6:30pm-8:00pm PASS Summit 2012 Welcome Reception Wednesday, November 7, 2012 12pm-1pm – Book Signing at Exhibit Hall Joes Pros booth#117 (FREE BOOK) 5:30pm-6:30pm – Idera Reception at Fox Sports Grill 7pm-8pm - Embarcadero Booth Book Signing (FREE BOOK) 8pm onwards – Exhibitor Reception Thursday, November 8, 2012 12pm-1pm - Embarcadero Booth Book Signing (FREE BOOK) 7pm-10pm - Community Appreciation Party Friday, November 9, 2012 12pm-1pm - Joes 2 Pros Book Signing at Exhibit Hall Joes Pros booth#117 11:30pm-1pm - Birds of a Feather Luncheon Rest of the Time! Exhibition Hall Joes 2 Pros Booth #117. Stop by for the goodies! Lots of people have already sent me email asking if we can meet for a cup of coffee to discuss SQL. Absolutely! I like cafe mocha with skim milk and whip cream and I do not get tired of it. Reference: Pinal Dave (http://blog.sqlauthority.com) Filed under: PostADay, SQL, SQL Authority, SQL PASS, SQL Query, SQL Server, SQL Tips and Tricks, T SQL, Technology

    Read the article

  • 50 Years After The Jetsons

    - by Jason Fitzpatrick
    The Jetsons, the future-oriented animated cartoon series from the 1960s, turned 50 this week. The Smithsonian takes a look at what the show meant, then and now. At the Smithsonian blog Paleofuture, Matt Novak looks back at the last 50 years and the impact that The Jetsons had. He writes: It’s important to remember that today’s political, social and business leaders were pretty much watching ”The Jetsons” on repeat during their most impressionable years. People are often shocked to learn that “The Jetsons” lasted just one season during its original run in 1962-63 and wasn’t revived until 1985. Essentially every kid in America (and many internationally) saw the series on constant repeat during Saturday morning cartoons throughout the 1960s, ’70s and ’80s. Everyone (including my own mom) seems to ask me, “How could it have been around for only 24 episodes? Did I really just watch those same episodes over and over again?” Yes, yes you did. But it’s just a cartoon, right? So what if today’s political and social elite saw ”The Jetsons” a lot? Thanks in large part to the Jetsons, there’s a sense of betrayal that is pervasive in American culture today about the future that never arrived. We’re all familiar with the rallying cries of the angry retrofuturist: Where’s my jetpack!?! Where’s my flying car!?! Where’s my robot maid?!? “The Jetsons” and everything they represented were seen by so many not as a possible future, but a promise of one. Hit up the link below for the full article–prepare to be surprised at just how few episodes of the show were ever animated and aired. 8 Deadly Commands You Should Never Run on Linux 14 Special Google Searches That Show Instant Answers How To Create a Customized Windows 7 Installation Disc With Integrated Updates

    Read the article

  • Looking for 2D Cross platform suggestions based on requirements specified

    - by MannyG
    I am an intermediate developer with minor experience on enterprise mobile applications for iphone, android and blackberry looking to build my first ever mobile game. I did a google search for some game dev forums and this popped up so I thought I would try posting here as I lack luck elsewhere. If you have ever heard of the game for the iphone and android platform entitled avatar fight then you will have an idea of the graphic capabilities I require. Basically the battles which are automated one sprite attacking another doing cool animations but all in 2d. My buddy and I have two motivations, one is to jump into mobile Dev as my experience is limited as is his so we would like some trending knowledge (html5 would be nice to learn) . The other is to make some money on the side, don't expect much but polishing the game and putting our all will hopefully reward us a bit. We have looked into corona engine, however a lot of people are saying it is limited in the graphics department, we are open to learning new languages like lua, c++, python etc. Others we have looked at include phonegap, rhomobile, unity, and the list goes on. I really have no idea what the pros and cons of these are but for a basic battle sequence and some mini games we want to chose the right one. Some more things that we will be doing include things like card games, side scrolling flying object based games, maybe fishing stuff. We want to start small with these minigames and work our way up to the idea we would like to implement in the future. We only want to work in 2D. So with these requirements please help me chose a platform to work on (cross platform is what we are ideally leaning towards). Please feel free to throw in some pieces of advice you may have for newbie game developers like myself too. Thank you for reading!

    Read the article

  • Java Road Trip: Code to Coast (#javaroadtrip)

    - by Justin Kestelyn
    Hey, have you heard? The Java Road Trip bus may be stopping at a city near you this summer, starting June 14. And your peeps at Oracle Technology Network have donated some goodies. What is the Java Road Trip? Basically, we have packed a rock-star bus with demos (Java FX, Oracle ADF, Java EE 6, JDK 7, GlassFish, Java ME) and are putting it on the road; it will make 20 stops across the U.S. in the next couple of months (and MAY may make a special appearance at JavaOne, if we can find a big enough parking space). In many cases these stops will coincide with Java or Oracle user group meet-ups and will always involve beer, food, and free stuff. Furthermore, engineers from HQ will be flying out at various times to rendezvous with these meet-ups and answer your questions. Also, because this tour will only reach a relatively small number of people, we're working hard to provide a virtual experience: there will be a blogger/videographer/photog/tweeter on board, reporting on its every move. You'll find all this content at java.com/roadtrip, and you can get real-time updates via @java. And this new update: If you're attending ODTUG Kaleidoscope in Washington, D.C., in late June, you'll get a chance to see the Java Bus in all its glory. And don't forget your t-shirt, cup, and screen cleaner, all provided by Oracle Technology Network.

    Read the article

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