Search Results

Search found 231 results on 10 pages for 'hero'.

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

  • 2d, Top-down map with different levels

    - by Ktash
    So, I'm creating a 2d, top down, sprite based (tiled) game, and right now I'm working on maps (well, a map editor at the moment, but it will be creating my maps, so basically the same thing). The scenario So, I'm thinking about efficiency and creating a map in pieces. In each piece, I plan on having 'layers'. Basically, I plan on rendering it down to a 'below hero' level, and an 'above hero' level, with the hero rendered in between obviously. There will likely also be a 'on level with hero' layer, but I'm not quite there yet. Not even worrying about events or interaction yet. Just looking to get a hero on the screen. Now for movement, I obviously need to know what tiles can be moved and in what direction. My plan at the moment is each tile getting 8 bits (4 'can enter in direction' bits, 4 'can leave in direction'). This will allow me to limit movement and even allow one way directional movement. The dilemma This works great for a lot of scenarios. It will allow me to store a map in essentially 3 layers, a string, and gives me flexibility going forward. However, I can't create maps that themselves have layers. A good example is a bridge where the user can go under or over the bridge without invalid moves being allowed. I can't create a platform and allow movement underneath. These are things I would like to be able to include in my game. My idea In theory, I could allow multiple hero layers and then allow multiple sets of 'below' and 'above' layers (or sandwich layers). But this complicates my system, and makes movement between maps potentially tricky (If the hero is on the third layer at the edge of a map, but that corresponds to the second layer on the other map, how can I allow or disallow movement). My question Is there a better way to manage multiple maps with multiple levels like this where a users level may be 'connected' on different levels on different maps? Or even... Am I doing this the hard way? Is there a more standard way to handle top-down 2d tiled maps that I am just not aware of? Things to note or that might be helpful This will be done in Javascript (transferred around in JSON) State will need to be transferred quickly, so a map-id and x/y/direction should be enough to get me a boolean 'can move' value Maps will not be standard sized (though they will be in a certain number of tiles) Making an editor tool so that I can have others help, so something that I can create in a tool would be helpful 'Teleportation' locations will likely need to exist to get into building maps and to and from different map sets (which will not necessarily be connected), but have not been created yet (lumping in with events at the moment).

    Read the article

  • can not access MovieClip properties in flashDevelop

    - by numerical25
    I know there is something I am doing wrong. In my controls I have keydown events that control my hero. As of right now, I am trying to rotate my hero but he refuses to turn . Below is my Hero Class, my control class, and gameobject class. pretty much all the classes associate with the controls class. package com.Objects { import com.Objects.GameObject; /** * ... * @author Anthony Gordon */ [Embed(source='../../../bin/Assets.swf', symbol='OuterRim')] public class Hero extends GameObject { public function Hero() { } } } Here is my Controls class. This is the class where I am trying to rotate my hero but he doesnt. The keydown event does work cause I trace it. package com.Objects { import com.Objects.Hero; import flash.events.*; import flash.display.MovieClip; /** * ... * @author Anthony Gordon */ public class Controls extends GameObject { private var aKeyPress:Array; public var ship:Hero; public function Controls(ship:Hero) { this.ship = ship; IsDisplay = false; aKeyPress = new Array(); engine.sr.addEventListener(KeyboardEvent.KEY_DOWN, keyDownListener); engine.sr.addEventListener(KeyboardEvent.KEY_UP,keyUpListener); } private function keyDownListener(e:KeyboardEvent):void { //trace("down e.keyCode=" + e.keyCode); aKeyPress[e.keyCode] = true; trace(e.keyCode); } private function keyUpListener(e:KeyboardEvent):void { //trace("up e.keyCode=" + e.keyCode); aKeyPress[e.keyCode]=false; } override public function UpdateObject():void { Update(); } private function Update():void { if (aKeyPress[37])//Key press left ship.rotation += 3,trace(ship.rotation ); ///DOESNT ROtate }//End Controls } } Here is GameObject Class package com.Objects { import com.Objects.Engine; import com.Objects.IGameObject; import flash.display.MovieClip; /** * ... * @author Anthony Gordon */ public class GameObject extends MovieClip implements IGameObject { private var isdisplay:Boolean = true; private var garbage:Boolean; public static var engine:Engine; public var layer:Number = 0; public function GameObject() { } public function UpdateObject():void { } public function GarbageCollection():void { } public function set Garbage(garb:Boolean):void { garbage = garb; } public function get Garbage():Boolean { return garbage } public function get IsDisplay():Boolean { return isdisplay; } public function set IsDisplay(display:Boolean):void { isdisplay = display; } public function set Layer(l:Number):void { layer = l; } public function get Layer():Number { return layer } } }

    Read the article

  • Annoying Bug in banner cycle

    - by Davemof
    I have created a rotating banner script for a new site I'm developing View banner here(it rotates every 10 seconds) Unfortunately to the transition seems to be a biut buggy, and the image will fade out, show the same image again and then fade in the new one. I think I have made a simple error somewhere, but can't figure out where it is. the code used to cycle the banners is: In document ready: if ($('.home').length > 0){ $('<img width="100%" />').attr('src', '/assets/img/backgrounds/home/hero'+homecount+'.jpg').load(function(){ $('.hero').append( $(this) ); $('.hero img').fadeIn('medium').delay(10000).fadeOut('slow', loopImages); setHeroHeight(); }); } Outside document ready: function loopImages(){ homecount = homecount+1; if (homecount > 5){ homecount = 1; } $('.hero img') .attr('src', '/assets/img/backgrounds/home/hero'+homecount+'.jpg') .load(function(){ $('.hero img').fadeIn('fast')}).delay(10000).fadeOut('slow', loopImages); } Any help would be greatly appreciated Thanks Dave

    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

  • MouseEvent.CLICK not working? (AS3)

    - by Jake
    ok so here's my code in AS3, I'd like to know why when i actually click on the picture, nothing happens. And if any of you have great tutorial of what to learn after classes/functions in AS3, let me know =D : package { import flash.display.Bitmap; import flash.display.Sprite; import flash.display.Shape; import flash.events.MouseEvent; public class Main extends Sprite { [Embed(source="../Pics/Picture.png")] private var HeroClass:Class; private var hero:Bitmap = new HeroClass(); public function Main():void { addChild(hero); hero.addEventListener(MouseEvent.CLICK, onClick); function onClick(e:MouseEvent):void { trace("hey"); hero.visible = false; } } } }

    Read the article

  • Simple way to decrease values without making a new attribute?

    - by Jam
    I'm making a program where you're firing a 'blaster', and I have 5 ammo. I'm blasting an alien who has 5 health. At the end I instantiate the player and make him blast 6 times to check that the program works correctly. But the way I've done it makes it so that the amount won't decrease. Is there an easy fix to this, or do I just have to make a new attribute for ammo and health? Here's what I have: class Player(object): """ A player in a shooter game. """ def blast(self, enemy, ammo=5): if ammo>=1: ammo-=1 print "You have blasted the alien." print "You have", ammo, "ammunition left." enemy.die(5) else: print "You are out of ammunition!" class Alien(object): """ An alien in a shooter game. """ def die(self, health=5): if health>=1: health-=1 print "The alien is wounded. He now has", health, "health left." elif health==0: health-=1 print "The alien gasps and says, 'Oh, this is it. This is the big one. \n" \ "Yes, it's getting dark now. Tell my 1.6 million larvae that I loved them... \n" \ "Good-bye, cruel universe.'" else: print "The alien's corpse sits up momentarily and says, 'No need to blast me, I'm dead already!" # main print "\t\tDeath of an Alien\n" hero = Player() invader = Alien() hero.blast(invader) hero.blast(invader) hero.blast(invader) hero.blast(invader) hero.blast(invader) hero.blast(invader) raw_input("\n\nPress the enter key to exit.")

    Read the article

  • HTC Hero Mouse Ball click not working on Custom ListView?

    - by UMMA
    dear friends, i have created custom list view using class EfficientAdapter extends BaseAdapter implements { private LayoutInflater mInflater; private Context context; public EfficientAdapter(Context context) { mInflater = LayoutInflater.from(context); this.context = context; } public View getView(final int position, View convertView, ViewGroup parent) { ViewHolder holder; convertView = mInflater.inflate(R.layout.adaptor_content, null); convertView.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { } }); } and other necessary methods... also } using touch screen when i click on list item OnClickListener of list item is called. but when i use Mouse Ball / Track Ball (Phone Hardware) to click on ListItem OnClickListener of list item is not called. can any one guide me is this Phone bug or My Fault? any help would be appriciated.

    Read the article

  • Android Hero denies XMLSocket or Socket connection? ....errors #2031, #2048

    - by claudi-ursica
    Hi, I am trying to adapt an existing flash web chat application for the Android mobile phone and I am having this really annoying issue. The server is a custom based solution and can send back both binary messages or XML. So I can use either XMLSocket class or the Socket class to get data from the server. Everything works fine when deployed and I connect from the desktop but when I try it from the android mobile I get the infamous errors #2031, followed by #2048. Now the crossdomain.xml file is rock solid and works well for desktop. When the connect socket method runs I see that the server replies with the crossdomain file but I get the error when running on the mobile. Has anyone bumped into this? Is there some limitation from the mobile phone part. I wasn't able to find anything relevant for this issue, in terms of the phone not allowing Socket or XMLSocket connections. The phone(s) Motorola and HTC run Android 2.1 and indicates the flash FL10,1,123,358 version of flash lite. The issue can be reproduced also on the HTC Desire. Any input on this would be highly appreciated... 10x, Claudiu

    Read the article

  • Force Close problem while Moving track ball on disabled EditText On HTC Hero Phone?

    - by UMMA
    dear friends, i have a small form with four EditText fields in which second EditText is disable for text Editing. now when i roll Android Phone ball to move from the top to bottom first time it selects disabled EditText and then third EditText and moves downward to foruth EditText. but when i try to move upward on Disabled EditText it displays me error Force Close after selecting it. it is only happening in phone not in Emulator. please guide how to resolve this issue? any help would be appriciated.

    Read the article

  • HTC Hero Mouse BOll click not working on Custom ListView?

    - by UMMA
    dear friends, i have created custom list view using class EfficientAdapter extends BaseAdapter implements { private LayoutInflater mInflater; private Context context; public EfficientAdapter(Context context) { mInflater = LayoutInflater.from(context); this.context = context; } public View getView(final int position, View convertView, ViewGroup parent) { ViewHolder holder; convertView = mInflater.inflate(R.layout.adaptor_content, null); convertView.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { } }); } and other necessary methods... also } using touch screen when i click on list item OnClickListener of list item is called. but when i use Mouse Boll / Track Boll (Phone Hardware) to click on ListItem OnClickListener of list item is not called. can any one guide me is this Phone bug or My Fault? any help would be appriciated.

    Read the article

  • ?????·????????????!?MAN. MACHINE. HERO. IRONMAN 2 ?????????????

    - by takashi.hitomi
    ?????????????????????????????????????????????????????IRONMAN 2?????????????? ??????????????????????????????????????????????????????? ????"That's American Movie!"??????????????????????????? ?????????????"????????"????????????????????????????????????(?)? ?????????????????????????????·???(?)?????????????????????!?????????????????? ??????????????·????????????????????????????????????????????????????????????????????????????????3D??????????????·??? 3D TV???????????????????????????????? ???????1??????????????????... ????????????????? ????????????? ???????? ?????????????????????? ??????????? ?????????????????????????????????????? ?????????????????????????????????????????? (????????????????????)? ?????IRONMAN??????????????????????????????????????????????????????????????????????????????????????????????????????? 2???????????????????????????????????????????????????"That's American Movie!"???????????????????????????????????????????????????????????????????????(?????????????????????)? ????????????????????????????????????????? ???????????????

    Read the article

  • C# text creation issue

    - by Mike
    This is whats going on. I have a huge text file that is suppose to be 1 line per entry. The issue is sometimes the line is broken with a new line. I edit this entire file and wherever the file doesn't begin with ("\"A) i need to append the current line to the previous line ( replacing \n with " "). Everything I come up with keeps appending the line to a new line. Any help is appricated... CODE: public void step1a() { string begins = ("\"A"); string betaFilePath = @"C:\ext.txt"; string[] lines = File.ReadAllLines(betaFilePath); foreach (string line in lines) { if (line.StartsWith(begins)) { File.AppendAllText(@"C:\xt2.txt",line); File.AppendAllText(@"C:\xt2.txt", "\n"); } else { string line2 = line.Replace(Environment.NewLine, " "); File.AppendAllText(@"C:\xt2.txt",line2); } } } Example: Orig: "\"A"Hero|apple|orange|for the fun of this "\"A"Hero|apple|mango|lots of fun always "\"A"Her|apple|fruit|no pain is the way "\"A"Hero|love|stackoverflowpeople|more fun Resulting: "\"A"Hero|apple|orange|for the fun of this "\"A"Hero|apple|mango|lots of fun always "\"A"Her|apple|fruit|no pain is the way "\"A"Hero|love|stackoverflowpeople|more fun

    Read the article

  • Ensure house map maze with lifts can be solved?

    - by Philipp Lenssen
    In my game we see the floors of a house from the side, and the hero can take lifts -- a lift either goes up (to the next lift upwards), or down (to the next lift downwards), depending on the arrow as shown, and there's always a pair of exactly two lifts connected. That's the only way the hero can move vertically, though he can freely move horizontally. The house map is a randomized 11x5 grid with different items, and unpassable walls to the far left, far right, and sometimes in one of the two middle positions: My question: How can I ensure the map is always randomized yet always solvable and that the hero, starting at the left side of the bottom floor, can always leave it via any upwards-pointing lift at the top floor? For what it's worth I'm using the Lua language for development. Thanks so much!

    Read the article

  • Multiple objects listening for the same key press

    - by xiaohouzi79
    I want to learn the best way to implement this: I have a hero and an enemy on the screen. Say the hero presses "k" to get out a knife, I want the enemy to react in a certain way. Now, if in my game loop I have a listener for the key press event and I identify a "k" was pressed, the quick and easy way would be to do: // If K pressed // hero.getOoutKnife() // enemy.getAngry() But what is commonly done in more complex games, where say I have 10 types of character on screen and they all need to react in a unique way when the letter "k" is pressed? I can think of a bunch of hacky ways to do this, but would love to know how it should be done properly. I am using C++, but I'm not looking for a code implementation, just some ideas on how it should be done the right way.

    Read the article

  • Is it Pythonic to have a class keep track of its instances?

    - by Lightbreeze
    Take the following code snippet class Missile: instances = [] def __init__(self): Missile.instances.append(self) Now take the code: class Hero(): ... def fire(self): Missile() When the hero fires, a missile needs to be created and appended to the main list. Thus the hero object needs to reference the list when it fires. Here are a few solutions, although I'm sure there are others: Make the list a global, Use a class variable (as above), or Have the hero object hold a reference to the list. I didn't post this on gamedev because my question is actually more general: Is the previous code considered okay? Given a situation like this, is there a more Pythonic solution?

    Read the article

  • Parent variable inheritance methods Unity3D/C#

    - by Timothy Williams
    I'm creating a system where there is a base "Hero" class and each hero inherits from that with their own stats and abilities. What I'm wondering is, how could I call a variable from one of the child scripts in the parent script (something like maxMP = MP) or call a function in a parent class that is specified in each child class (in the parent update is alarms() in the child classes alarms() is specified to do something.) Is this possible at all? Or not? Thanks.

    Read the article

  • Iterator

    Imagine that you are game developer. Your game is war stategy. Army has complicated structure: it consists with Hero and three Groups. When King gives decree to treat all soldiers (Hero is also soldier) you want to iterate through all soldiers and call treat() method on each soldier instance. How ca

    Read the article

  • Developer’s Life – Summary of Superhero Articles

    - by Pinal Dave
    Earlier this year, I wrote an article series where I talked about developer’s life and compared it with Superhero. I have got amazing response to this series and I have been receiving quite a lots of email suggesting that I should write more blog post about them. Currently I am not planning to write more blog post but I will soon continue another series. In this blog post, I have summarized the entire series. Let me know if you want me to write about any superhero. I will see what I can do about that hero. Developer’s Life – Every Developer is a Captain America Captain America was first created as a comic book character in the 1940’s as a way to boost morale during World War II.  Aimed at a children’s audience, his legacy faded away when the war ended.  However, he has recently has a major reboot to become a popular movie character that deals with modern issues. Developer’s Life – Every Developer is the Incredible Hulk The Incredible Hulk is possibly one of the scariest superheroes out there.  All superheroes are meant to be “out of this world” and awe-inspiring, but I think most people will agree with I say The Hulk takes this to the next level.  He is the result of an industrial accident, which is scary enough in it’s own right.  Plus, when mild-mannered Bruce Banner is angered, he goes completely out-of-control and transforms into a destructive monster that he cannot control and has no memories of. Developer’s Life – Every Developer is a Wonder Woman We have focused a lot lately on this “superhero series.”  I love fantasy books and movies, and I feel like there is a lot to be learned from them.  As I am writing this series, though, I have noticed that every super hero I write about is a man.  So today, I would like to talk about the major female super hero – Wonder Woman. Developer’s Life – Every Developer is a Harry Potter Harry Potter might not be a superhero in the traditional sense, but I believe he still has a lot to teach us and show us about life as a developer.  If you have been living under a rock for the last 17 years, you might not know that Harry Potter is the main character in an extremely popular series of books and movies documenting the education and tribulation of a young wizard (and his friends). Developer’s Life – Every Developer is Like Transformers Transformers may not be superheroes – they don’t wear capes, they don’t have amazing powers outside of their size and folding ability, they’re not even human (technically).  Part of their enduring popularity is that while we are enjoying over-the-top movies, we are learning about good leadership and strong personal skills. Developer’s Life – Every Developer is a Iron Man Iron Man is another superhero who is not naturally “super,” but relies on his brain (and money) to turn him into a fighting machine.  While traditional superheroes are still popular, a three-movie franchise and incorporation into the new Avengers series shows that Iron Man is popular enough on his own. Developer’s Life – Every Developer is a Sherlock Holmes I have been thinking a lot about how developers are like super heroes, and I have written two blog posts now comparing them to Spiderman and Superman.  I have a lot of love and respect for developers, and I hope that they are enjoying these articles, and others are learning a little bit about the profession.  There is another fictional character who, while not technically asuper hero, is very powerful, and I also think stands as a good example of a developer. That character is Sherlock Holmes.  Sherlock Holmes is a British detective, first made popular at the turn of the 19thcentury by author Sir Arthur Conan Doyle.  The original Sherlock Holmes was a brilliant detective who could solve the most mind-boggling crime through simple observations and deduction. Developer’s Life – Every Developer is a Chhota Bheem Chhota Bheem is a cartoon character that is extremely popular where I live.  He is my daughter’s favorite characters.  I like to say that children love Chhota Bheem more than their parents – it is lucky for us he is not real!  Children love Chhota Bheem because he is the absolute “good guy.”  He is smart, loyal, and strong.  He and his friends live in Dholakpur and fight off their many enemies – and always win – in every episode.  In each episode, they learn something about friendship, bravery, and being kind to others.  Chhota Bheem is a good role model for children, and I think that he is a good role model for developers are well. Developer’s Life – Every Developer is a Batman Batman is one of the darkest superheroes in the fantasy canon.  He does not come to his powers through any sort of magical coincidence or radioactive insect, but through a lot of psychological scarring caused by witnessing the death of his parents.  Despite his dark back story, he possesses a lot of admirable abilities that I feel bear comparison to developers. Developer’s Life – Every Developer is a Superman I enjoyed comparing developers to Spiderman so much, that I have decided to continue the trend and encourage some of my favorite people (developers) with another favorite superhero – Superman.  Superman is probably the most famous superhero – and one of the most inspiring. Developer’s Life – Every Developer is a Spiderman I have to admit, Spiderman is my favorite superhero.  The most recent movie recently was released in theaters, so it has been at the front of my mind for some time. Spiderman was my favorite superhero even before the latest movie came out, but of course I took my whole family to see the movie as soon as I could!  Every one of us loved it, including my daughter.  We all left the movie thinking how great it would be to be Spiderman.  So, with that in mind, I started thinking about how we are like Spiderman in our everyday lives, especially developers. I would like to know which Superhero is your favorite hero! Reference: Pinal Dave (http://blog.SQLAuthority.com)Filed under: PostADay, SQL, SQL Authority, SQL Query, SQL Server, SQL Tips and Tricks, T SQL Tagged: Developer, Superhero

    Read the article

  • javascript robot

    - by sarah
    hey guys! I need help making this robot game in javascript (notepad++) please HELP! I'm really confused by the functions <html> <head><title>Robot Invasion 2199</title></head> <body style="text-align:center" onload="newGame();"> <h2>Robot Invasion 2199</h2> <div style="text-align:center; background:white; margin-right: auto; margin-left:auto;"> <div style=""> <div style="width: auto; border:solid thin red; text-align:center; margin:10px auto 10px auto; padding:1ex 0ex;font-family: monospace" id="scene"></pre> </div> <div><span id="status"></span></div> <form style="text-align:center"> PUT THE CONTROL PANEL HERE!!! </form> </div> <script type="text/javascript"> // GENERAL SUGGESTIONS ABOUT WRITING THIS PROGRAM: // You should test your program before you've finished writing all of the // functions. The newGame, startLevel, and update functions should be your // first priority since they're all involved in displaying the initial state // of the game board. // // Next, work on putting together the control panel for the game so that you // can begin to interact with it. Your next goal should be to get the move // function working so that everything else can be testable. Note that all nine // of the movement buttons (including the pass button) should call the move // function when they are clicked, just with different parameters. // // All the remaining functions can be completed in pretty much any order, and // you'll see the game gradually improve as you write the functions. // // Just remember to keep your cool when writing this program. There are a // bunch of functions to write, but as long as you stay focused on the function // you're writing, each individual part is not that hard. // These variables specify the number of rows and columns in the game board. // Use these variables instead of hard coding the number of rows and columns // in your loops, etc. // i.e. Write: // for(i = 0; i < NUM_ROWS; i++) ... // not: // for(i = 0; i < 15; i++) ... var NUM_ROWS = 15; var NUM_COLS = 25; // Scene is arguably the most important variable in this whole program. It // should be set up as a two-dimensional array (with NUM_ROWS rows and // NUM_COLS columns). This represents the game board, with the scene[i][j] // representing what's in row i, column j. In particular, the entries should // be: // // "." for empty space // "R" for a robot // "S" for a scrap pile // "H" for the hero var scene; // These variables represent the row and column of the hero's location, // respectively. These are more of a conveniece so you don't have to search // for the "H" in the scene array when you need to know where the hero is. var heroRow; var heroCol; // These variables keep track of various aspects of the gameplay. // score is just the number of robots destroyed. // screwdrivers is the number of sonic screwdriver charges left. // fastTeleports is the number of fast teleports remaining. // level is the current level number. // Be sure to reset all of these when a new game starts, and update them at the // appropriate times. var score; var screwdrivers; var fastTeleports; var level; // This function should use a sonic screwdriver if there are still charges // left. The sonic screwdriver turns any robot that is in one of the eight // squares immediately adjacent to the hero into scrap. If there are no charges // left, then this function should instead pop up a dialog box with the message // "Out of sonic screwdrivers!". As with any function that alters the game's // state, this function should call the update function when it has finished. // // Your "Sonic Screwdriver" button should call this function directly. function screwdriver() { // WRITE THIS FUNCTION } // This function should move the hero to a randomly selected location if there // are still fast teleports left. This function MUST NOT move the hero on to // a square that is already occupied by a robot or a scrap pile, although it // can move the hero next to a robot. The number of fast teleports should also // be decreased by one. If there are no fast teleports left, this function // should just pop up a message box saying so. As with any function that alters // the game's state, this function should call the update function when it has // finished. // // HINT: Have a loop that keeps trying random spots until a valid one is found. // HINT: Use the validPosition function to tell if a spot is valid // // Your "Fast Teleport" button s

    Read the article

  • implementing twitter bootstrap carousel

    - by arboles
    I am having trouble implementing the bootstrap carousel. Can anyone look at the following html and js and give me instructions on how to implement the slide. The .js has not been edited and the carousel is installed on the body hero unit. Do I implement the carousel api? How do I define the carousel I am using within the .js file? Thanks. <div class="carousel"> <!-- Carousel items --> <div class="carousel-inner"> <!-- Main hero unit for a primary marketing message or call to action --> <div class="hero-unit"> <h1>Hello, world!</h1> <p>This is a template for a simple marketing or informational website. It includes a large callout called the hero unit and three supporting pieces of content. Use it as a starting point to create something more unique.</p> <p><a class="btn btn-primary btn-large">Learn more &raquo;</a></p> </div> </div> <!-- Carousel nav --> <a class="carousel-control left" href="#myCarousel" data-slide="prev">&lsaquo;</a> <a class="carousel-control right" href="#myCarousel" data-slide="next">&rsaquo;</a> </div>

    Read the article

  • How to do "map chunks", like terraria or minecraft maps?

    - by O'poil
    Due to performance issues, I have to cut my maps into chunks. I manage the maps in this way: listMap[x][y] = new Tile (x,y); I tried in vain to cut this list for several "chunk" to avoid loading all the map because the fps are not very high with large map. And yet, when I update or Draw I do it with a little tile range. Here is how I proceed: foreach (List<Tile> list in listMap) { foreach (Tile leTile in list) { if ((leTile.Position.X < screenWidth + hero.Pos.X) && (leTile.Position.X > hero.Pos.X - tileSize) && (leTile.Position.Y < screenHeight + hero.Pos.Y) && (leTile.Position.Y > hero.Pos.Y - tileSize) ) { leTile.Draw(spriteBatch, gameTime); } } } (and the same thing, for the update method). So I try to learn with games like minecraft or terraria, and any two manages maps much larger than mine, without the slightest drop of fps. And apparently, they load "chunks". What I would like to understand is how to cut my list in Chunk, and how to display depending on the position of my character. I try many things without success. Thank you in advance for putting me on the right track! Ps : Again, sorry for my English :'( Pps : I'm not an experimented developer ;)

    Read the article

  • Sorting related objects in the Django Admin form interface

    - by Carver
    I am looking to sort the related objects that show up when editing an object using the admin form. So for example, I would like to take the following object: class Person(models.Model): first_name = models.CharField( ... ) last_name = models.CharField( ... ) hero = models.ForeignKey( 'self', null=True, blank=True ) and edit the first name, last name and hero using the admin interface. I want to sort the objects as they show up in the drop down by last name, first name (ascending). How do I do that? Context I'm using Django v1.1. I started by looking for help in the django admin docs, but didn't find the solution As you can see in the example, the foreign key is pointing to itself, but I expect it would be the same as pointing to a different model object. Bonus points for being able to filter the related objects, too (eg~ only allow selecting a hero with the same first name)

    Read the article

  • checksum in raw sockets and pcap

    - by hero
    i am using pcap library to sniff some packets, change their tcp data , and then inject my packet on the network. my question is: if i changed in the tcp data, should i recalculate the length field in the tcp header? should i also change the checksum? i read in a page on how to create raw sockets that if you set the tcp_checksum to 0, the kernel will automatically calculate it and fill it, is this true for windows machines also?

    Read the article

  • Identifying Hard Drive as performance bottleneck for desktop machines

    - by Programming Hero
    I'm working in a development team where we all use laptops so we can work in multiple locations. These laptops are proving notoriously slow for development work, but at a glance they all look to have the specification for a much faster experience: CPU - Intel Core 2 Duo T7500 Memory - 2GB of RAM We all experience the biggest delays when the hard-drives are being accessed, particularly when swap-files are being thrashed. After doing a little bit of profile, a colleague discovered that our HDDs are seeing Read/Write speeds of about 10MB/sec. This seems abnormally low and we believe it the cause of the problem. Sensibly (though somewhat annoyingly) our business wont blow money on faster drives just to see if it fixes the problem; we need to illustrate this is definitely the problem and that buying some solid-state drives will make it go away. I need some way of showing how 90% of the system resources aren't being used over the course of a day, and that whenever there is utilization, it's all in HDD reads or writes. Are there any tools I could use to provide this information? Does it seem likely the problem is going to be fixed by a faster drive? Should I be looking for alternatives?

    Read the article

  • Fast distributed filesystem for a large amounts of data with metadata in database

    - by undefined hero
    My project uses several processing machines and one storage machine. Currently storage organized with a MSSQL filetable shared folder. Every file in storage have some metadata in database. Processing machines executes tasks for which they needed files from storage and their metadata. After completing task, processing machine puts resulting data back in storage. From there its taken by another processing machine, which also generates some file and put it back in storage. And etc. Everything was fine, but as number of processing machines increases, I found myself bottlenecked myself with storage machines hard drive performance. So I want processing machines to put files in distributed FS. to lift load from storage machines, from which they can take data from each other, not only storage machine. Can You suggest a particular distributed FS which meets my needs? Or there is another way to solve this problem, without it? Amounts of data in FS in one time are like several terabytes. (storage can handle this, but processors cannot). Data consistence is critical. Read write policy is: once file is written - its constant and may be only removed, but not modified. My current platform is Windows, but I'm ready to switch it, if there is a substantially more convenient solution on another one.

    Read the article

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