How to make an a basic attack in my text based game

hey guys! i really need some genuine help on how to create an attack for my monsters and player. the attack should be basic: if the room contains a monster, then the monster attacks when the player goes inside the room. then the player can type a command to attack the monster. the attack should just deduct the hp of the monster. so the player can keep attacking till the monster is "dead"(this is where i remove the monster).
anyway i tried alot in creating the attack but i failed all the time, messing my code even more. please!!!!! help!!!
my monster class:
public class Monster
private int hp, stage;
private String name;
public Monster(String name, int stage)
this.name = name;
this.stage = stage;
if(stage == 1) {
hp = 1;
else if(stage == 2) {
hp = 2;
else if(stage == 3) {
hp = 2;
else if(stage == 4) {
hp = 3;
else if(stage == 5) {
hp = 4;
else if(stage == 6) {
hp = 6;
public int monsterStage()
return stage;
public String getName()
return name;
this is where i created the monsters in my main game class:
private Monster skeleton, sphinx, zombie, vampire, werewolf, undeadking;
setting the monster to a room:
skeleton = new Monster("skeleton1", 1);
skeleton = new Monster("skeleton2", 1);
sphinx = new Monster("sphinx1", 2);
sphinx = new Monster("sphinx2", 2);
sphinx = new Monster("sphinx3", 2);
zombie = new Monster("zombie", 3);
vampire = new Monster("vampire1", 4);
vampire = new Monster("vampire2", 4);
werewolf = new Monster("werewolf", 5);
undeadking = new Monster("undeadking", 6);
//setting the monster to a place
bridge.addMonster("skeleton1", skeleton);
castleDoor.addMonster("sphinx1", sphinx);
castleChest.addMonster("zombie", zombie);
dungeonDoor.addMonster("sphinx2", sphinx);
castleStair.addMonster("werewolf", werewolf);
dungeonBridge.addMonster("vampire2", vampire);
dungeonBook.addMonster("sphinx3", sphinx);
dungeonChest.addMonster("skeleton2", skeleton);
throneCenter.addMonster("undeadking", undeadking);
ps.: please help me! each room has one monster only and they are stored in hashmaps

Here is a start of a basic text based game--it doesn't level or regen characters nor give healing or have new weapons...
package ForumJunk;
import java.util.Random;
import java.util.Scanner;
public class ForumJunk{
  private final int widthX;
  private final int heightY;
  private int myX;
  private int myY;
  private int myLevel;
  private int baseHP;
  private int myHP;
  private int myTreasure;
  private String[] myWeapon = {"fist", "open hand", "dagger", "short sword", "long sword", "b-sword", "2H sword"};
  private int[] myWeaponMaxDamage = {2, 3, 4, 6, 10, 12, 16};
  private int monsterFillFactor = 40;
  private int[][] monsterLevel = {{1, 1, 1}, {2, 2, 2}, {3, 3, 3}};
  private String[][] monsterName = {{"Skeleton", "Orac", "Kobald"}, {"Zombi", "Wolf", "Giant Rat"}, {"Bandit", "Mummy", "Ghost"}};
  private int[] monsterMaxDamage = {2, 4, 6};
  private myRoom[][] room;
  private Random rand;
  public ForumJunk(){
    widthX  = 100;
    heightY = 100;
    myLevel = 1;
    rand = new Random();
    baseHP   = 16;
    myHP     = baseHP;
    for(int i=0; i<myLevel; i++) myHP = myHP + rand.nextInt(4) + 4;
    room = new myRoom[widthX][heightY];
    for(int i=0; i<widthX; i++)for(int j=0; j<heightY; j++)room[i][j]=new myRoom();
    myX = rand.nextInt(widthX);
    myY = rand.nextInt(heightY);
    myTreasure = 0;
    fillMonster();
  public void doAttack(){
    if(!(room[myX][myY].monster != null)){
      System.out.println("Oh, it must have been my shadow; there's no monsters here \n");
      return; //no monster
    if(rand.nextBoolean()){
     doHumanAttack();
     if(room[myX][myY].monster.hp > 0) doMonsterAttack();
    }else{
      doMonsterAttack();
      doHumanAttack();
  public void doHumanAttack(){
    int weaponIndex = 0;
    if(myLevel<myWeaponMaxDamage.length) weaponIndex = myLevel;else weaponIndex = myWeaponMaxDamage.length-1;
    System.out.println("Attacking with " + myWeapon[weaponIndex] + " ...");
    int damage = myLevel * rand.nextInt(myWeaponMaxDamage[myLevel]);
    room[myX][myY].monster.hp -= damage;
    if(damage>0) System.out.println("Hit for " + damage + " damage\n");
    else System.out.println("I missed!\n");
    if(room[myX][myY].monster.hp <= 0) System.out.println("The " + room[myX][myY].monster.name  + " is dead.");
  public void doMonsterAttack(){
    System.out.println("The " + room[myX][myY].monster.name  + " is attacking...");
    int damage = rand.nextInt(monsterMaxDamage[room[myX][myY].monster.level-1]);
    myHP -= damage;
    if(damage>0) System.out.println("I've been hit for " + damage + " damage\n");
    else System.out.println("It missed me!\n");
    if(myHP<=0){
      System.out.println("Oh no, I'm dead!!!!!");
      System.exit(0);
  public void doStatus(){
    System.out.println();
    System.out.println("  Status:");
    System.out.println("    Room: " + myX + ":" + myY);
    System.out.println("      HP: " + myHP);
    System.out.println("Treasure: " + myTreasure + " gp");
    System.out.println("   Level: " + myLevel);
    System.out.println();
  public void doTreasure(){
    if(!(room[myX][myY].monster != null)){
      System.out.println("What--do you expect it just to be laying around in every room? \n");
      return; //no monster
    if(room[myX][myY].monster.hp>0){
      System.out.println("If there is any treasure that " + room[myX][myY].monster.name + " is guarding it.\n");
      return; //no monster
    myTreasure += room[myX][myY].monster.treasure;
    System.out.println("I found " + room[myX][myY].monster.treasure + " gp\n");
    room[myX][myY].monster = null;
  public void fillMonster(){
    int fill = (widthX * heightY * monsterFillFactor) / 100;
    int x = 0;
    int y = 0;
    boolean gen = false;
    for(int i=0; i<fill; i++){
      gen = true;
      while(gen){
        x = rand.nextInt(widthX);
        y = rand.nextInt(heightY);
        if(!(room[x][y].monster != null)){
          room[x][y].monster = new Monster(rand.nextInt(3)+1);
          gen = false;
  class Monster{
    int level = 0;
    int hp   = 0;
    int treasure = 0;
    String name = "";
    Monster(int level){
      this.level = level;
      hp = 1;
      for(int i = 0; i<level; i++) {
        hp += rand.nextInt(6);
        treasure += rand.nextInt(100);
      name = monsterName[level-1][rand.nextInt(3)];
  class myRoom{
    Monster monster = null;
    //what ever else you want to put in here
  public static void main(String[] args){
    String myIN = "";
    Scanner scan = new Scanner(System.in);
    ForumJunk fj = new ForumJunk();
    System.out.print("I am in room: " + fj.myX + ", " + fj.myY + " I have " + fj.myHP + " hit points and " + fj.myTreasure + " treasure ");
    if(fj.room[fj.myX][fj.myY].monster!=null){
      System.out.println("There is a  " + fj.room[fj.myX][fj.myY].monster.name + " here!");
    System.out.println("\n");
    while(!(myIN=scan.next()).equals("exit")){
      if(myIN.equals("north")){
        fj.myY -=1;
        if(fj.myY<0) fj.myY=fj.heightY-1;
      }else if(myIN.equals("south")){
        fj.myY +=1;
        if(fj.myY==fj.heightY) fj.myY=0;
      }else if(myIN.equals("west")){
        fj.myX -=1;
        if(fj.myX<0) fj.myX=fj.widthX-1;
      }else if(myIN.equals("east")){
        fj.myX +=1;
        if(fj.myX==fj.widthX) fj.myX=0;
      }else if(myIN.equals("attack")){
        fj.doAttack();
      }else if(myIN.equals("weapon")){
        System.out.println("I'll be using my " + fj.myWeapon[fj.myLevel] + " to attack\n");
      }else if(myIN.equals("treasure")){
        fj.doTreasure();
      }else if(myIN.equals("status")){
        fj.doStatus();
    System.out.print("I am in room: " + fj.myX + ", " + fj.myY + " I have " + fj.myHP + " hit points and " + fj.myTreasure + " treasure ");
    if(fj.room[fj.myX][fj.myY].monster!=null){
      System.out.print("There is a ");
      if(fj.room[fj.myX][fj.myY].monster.hp<=0) System.out.print("dead ");
      System.out.println(fj.room[fj.myX][fj.myY].monster.name + " here!");
    System.out.println("\n");
  System.out.println("Bye!");
}

Similar Messages

  • HT2477 how to make a snap shot of a selected text

    Im trying make a snap shot of a selected text.

    To take the picture of a part of the screen
    Command (⌘)-Shift-4, and then drag the crosshair pointer to select the area. Continue to press the mouse button, release the keys, and then press Shift, Option, or the Space bar while you drag to resize the selection area. When you are ready to take a picture, release the mouse button.
    Pictures of the screen (screenshots) are saved as files on the desktop, but if you prefer to put a screenshot in the Clipboard, hold down the Control key while you press the other keys. You can then paste the picture into a document.
    http://support.apple.com/kb/PH11229
    http://www.wikihow.com/Take-a-Screenshot-in-Mac-OS-X

  • How to make a really basic alleyway for a beginner

      Hello,I am a student making a project related to games and I picked an alleyway.I've
    read through a couple of threads on here dealing with making a game of
    alleyway in LabView.I a still a newbie and I am asking for some
    guideance inorder to be able to make such a game.I ask you to please have some patience with me.
      I
    am ,as you figured it out ,EchoWolf's class mate. And I also like also
    to learn LabView not just coping and cheating for I would like to
    increase my knowledge in LabView and because the purpose of this assignment is to learn.
     I
    have seen with EchoWolf's post and I was impressed how I was able to
    make a ball bounce from different starting positions and different
    angles.
    As I want to keep this game basic, I don't think I'll worry about having different ball speeds so far.
    Alley
    way is a game when the ball hits the brick and it
    breaks(disappears),how can I do it do I need to vanish it using the
    property node.
    I am sorry, I was not taught enough and I only ask
    for guideance and patience for I am a quick learner and I am very good
    at Math and Physics and I have some experience in C++ although the
    syntax stinks.
    Due to my inexperience, this might thake a lot of time.I thank you
    for any and all help anyone may be able to provide. Thank you in
    advanced for your patience.May I never fail you.
    This is what I have found .XD
     I am having trouble posting this message.
    “Give a man a fish and he will eat for a day; teach a man to fish and he will eat for a lifetime”
    "to learn a lesson is a far better reward than to win a prize early in the GAME"
    Attachments:
    alleyway.llb ‏318 KB

    LOL,
    First, let's play nice and actually give the source of the code you attached. I have the gut feeling that it is overly complicated and could be done with 25% of the code.
    As a first step, I would enable "smooth updates" on the image indicator to prevent the annoying flickering
    Echo Wolf2 wrote:
    As I want to keep this game basic, I don't think I'll worry about having different ball speeds so far.
    Yes, you have to worry, because the speed e.g. needs to change sign when it hits an object. Of course you could solve it with complex data and keep the speed magnitude constant.
    Echo Wolf2 wrote:
    Alley way is a game when the ball hits the brick and it breaks(disappears),how can I do it do I need to vanish it using the property node.
    I don't think you understand the meaning of "property node". What exactly did you have in mind?
    Echo Wolf2 wrote:
    I am sorry, I was not taught enough and I only ask for guideance and patience for I am a quick learner and I am very good at Math and Physics and I have some experience in C++ although the syntax stinks.
    It's probably the wrong approach trying to reverse engineer existing complicated code, so what I would do is start with some simple code like your classmate, writing someting where the ball bounces off walls only. Then you can expand it and add bricks. At the end add a paddle for user control.
    Make a plan about good data structures. How is the arena represented in memory?
    Echo Wolf2 wrote:
    Due to my inexperience, this might thake a lot of time.I thank you for any and all help anyone may be able to provide. Thank you in advanced for your patience.May I never fail you.
    The only way to really gain experience is to write programs. It's been 6+ hours since you posted. How far did you get in the meantime? Show us what you are doing and please ask questions when you get stuck.
    We won't write assignments for you, but we are willing to nudge you in the right direction.
    LabVIEW Champion . Do more with less code and in less time .

  • How to make a really basic pong game for a beginner

    Hello.  I've read through a couple of threads on here dealing with making a game of pong in LabView, but in them the users had questions with far more complex aspects of the program than I want to deal with.  I am a beginner programmer in LabView with limited experience in Java and Visual Basic programming.  I was tasked with creating a game over winter break, and now that I finally have some time (this weekend that is), I decided that I'd make a really simple game of pong.  However, I have seriously overestimated the difficulty of this for a beginner who has very limited knowledge of Lab View.
    I ask you to please have some patience with me.
    I know what I want to do, and just need help inplementing it.
    Here is the idea for my design to keep it as simple as possible:
    -Create a field (I am not sure what to use for this, but from my reading it appears that some sort of a picture output is needed, but I cannot find that anywhere).
    -Set up some simple function that can output the dimensions of this field to use with collision tracking.
    -Create a ball that can be tracked by the program.
    -From my reading I understand that the simplest way to "bounce" the ball off the sides appears to simply reverse the X velocity of the ball when it strikes the vertical boundaries and the Y velocity when it strikes the horizontal boundaries.
    -Insert some sort of a "paddle" that the user can control with the left and right arrow keys.
    Now, as I have mentioned I am a beginner with approximately one month maximum knowledge of this software, spread over about a year.  I want to take things slow.  So for starters, would anyone be willing to walk me through creating a visual output for this and creating a ball that will bounce off all sides?
    If I can at least get that far for now, then I can move on (with help I hope!) of inserting an interactive interface for the "paddle."
    I have found some LabView code for a simple game like this, but it also includes a score keeping loop as well as an "automatic play" option, and I am attempting to wade through all that code to find the bones of it to help me with this, but due to my inexperience, this might thake a lot of time.
    I thank you for any and all help anyone may be able to provide.

    EchoWolf wrote:
    -Create a field (I am not sure what to use for this, but from my reading it appears that some sort of a picture output is needed, but I cannot find that anywhere).
     Wel, there is the picture indicator in the picture palette. In newer versions it's called "2D picture". The palettes have a search function. Using the palette search function is a basic LabVIEW skill that you should know. If you've seen the example for the other discussion, it uses a 2D boolean array indicator. The boolean array is only recommended for a monochrome very low resolution display.
    EchoWolf wrote: -Set up some simple function that can output the dimensions of this field to use with collision tracking.
    -Create a ball that can be tracked by the program.
    That seems backwards. Properly programmed, the code always knows the dimension and the ball position. The program generates, (not tracks!) the ball movement. Of course you need to do some range checking on the ball position to see when it collides with the walls.
    EchoWolf wrote:
    -From my reading I understand that the simplest way to "bounce" the ball off the sides appears to simply reverse the X velocity of the ball when it strikes the vertical boundaries and the Y velocity when it strikes the horizontal boundaries.
    Of course you could make it more realistic by keeping track of three ball parameters: x, y, spin.
    EchoWolf wrote:
    -Insert some sort of a "paddle" that the user can control with the left and right arrow keys.
    Pong is typically played with the up-down arrow keys.
    EchoWolf wrote:
    Now, as I have mentioned I am a beginner with approximately one month maximum knowledge of this software, spread over about a year.
    LabVIEW knowledge is not measured in time units. What did you do during that month? Did you attend some lectures, study tutorials, wrote some programs?
    EchoWolf wrote:
    So for starters, would anyone be willing to walk me through creating a visual output for this and creating a ball that will bounce off all sides?
    I have found some LabView code for a simple game like this, but it also includes a score keeping loop as well as an "automatic play" option, and I am attempting to wade through all that code to find the bones of it to help me with this, but due to my inexperience, this might thake a lot of time.
    Start with the posted example and delete all the controls and indicators that you don't want, then surgically remove all code with broken wires.
    Alternatively, start from scratch: Create your playing field. Easiest would be a 2D classic boolean array that is all false. Use initialize array to make it once. Now use a loop to show the ball as a function of time.
    Start with a random ball position. to display it, turn one of the array elements true before wiring to the array indicator using replace array subset.
    Keep a shift register with xy positions and xy velocities and update the positions as a function of the velocities with each iteration of the loop. Do range checking and reverse the velocieis when a edge is encountered.
    What LabVIEW version do you have?
    LabVIEW Champion . Do more with less code and in less time .

  • How to make the Open/Save dialogue download the text file instead of JSP

    I am currently coding on a JSP program, which searches the database and writes the resultset into a file on the server, and then allows the client to download this tab delimited text file onto their local machine. But I met a problem, when the default Open or Save dialogue appears, it shows that it's trying to download the running JSP file from my local host instead of the newly-created text file. Despite this, when I click OK to either Open or Save the file, a warning dialogue will appear saying: The explorer cann't download this file, it's unable to find this internet site or something like that. I get no error message from the server but I was always told that Javax.servlet.ServletException: getWriter() was already called. What does this mean?
    I guess maybe this is caused by the mix use of outputStreams in my program. I don't know if there is a way to directly read the resultset from the database and then send it through outputStream to the client. My solution is: first create a file on the server to hold the resultset, and then output this file to the client. I did all these in one JSP program: Create file on the server, search database, and then read file and output the contents to client. Is this correct? I attached my code, please feel free to correct any of my mistake? Thanks!
    //global.class is a class dealing with database connection
    <%@ page language="java" import="java.sql.*,java.util.*,java.math.*,java.io.*,ises.*,frmselection.*" %>
    <jsp:useBean id="global" scope="session" class="ises.Global" />
    />
    <!--start to process data-->
    <%
    //get query statement from the session
    String sQuery = "";
    if (session.getAttribute("sQuery")!=null && !(session.getAttribute("sQuery").toString()).equals(""))
    sQuery = session.getAttribute("sQuery").toString();
    String path = "c:/temp";
    String fileName = "temp.TXT";
    File file= null;
    FileOutputStream fo = null;
    PrintStream ps = null;
    try {
         file = new File(path,fileName);
         if(file.exists()) {
         file.delete();
         file.createNewFile();
         fo = new FileOutputStream(file);
         ps = new PrintStream(fo);
    }catch(IOException exp){
         System.out.println("IO Exception: " +exp.toString() );
    java.sql.ResultSet recResults     = null;
    java.sql.Statement STrecResults = null;
    STrecResults = global.getConnection().createStatement();
    recResults = STrecResults.executeQuery(sQuery);
    ResultSetMetaData meta = recResults.getMetaData();
    int columns = meta.getColumnCount();
    String [] tempColumnName = new String[columns];
    String [] ColumnName =null;
    int DisColumns = 0;
    int unDisCol = 0;
    String sLine = "";
    if(recResults.next()) {     //if_1
    for(int n=0;n<columns;n++) {
    String temp = meta.getColumnName(n+1);
    if(!temp.equals("PROJECTID")&&!temp.equals("BUILDINGID")&&!temp.equals("HAZMATPROFILEID")) {
    sLine = sLine + "'" + temp + "'" + " ";
    tempColumnName[DisColumns] = temp;
    DisColumns ++;
    ColumnName = new String[DisColumns];
    }else {
    unDisCol ++;
    }//end for
    for(int i=0;i<(columns-unDisCol);i++) {
    ColumnName[i] = tempColumnName;
    ps.println(sLine);
    do{
    sLine = "";
    for(int n=0;n<(columns-unDisCol);n++) {
    String tempColName = recResults.getString(ColumnName[n]);
    if(tempColName==null) {
    sLine = sLine + "" + " ";
    } else {
         sLine = sLine + "'"+tempColName+"'" + " ";
    ps.println(sLine);
    }while(recResults.next());
    }     //end if_1
    recResults.close();
    recResults = null;
    STrecResults.close();
    STrecResults = null;
    %>
    <!--end of processing data-->
    <!--start of download.jsp-->
    <%
    //set the content type to text
    response.setContentType ("plain/text");
    //set the header and also the Name by which user will be prompted to save
    response.setHeader ("Content-Disposition", "attachment;filename=temp.TXT");
    //Open an input stream to the file and post the file contents thru the servlet output stream to the client
    InputStream in = new FileInputStream(file);
    ServletOutputStream outs = response.getOutputStream();
    int bit = 256;
    try {
         while ((bit) >= 0) {
         bit = in.read();
    outs.write(bit);
    } catch (IOException ioe) {
    ioe.printStackTrace(System.out);
    outs.flush();
    outs.close();
    in.close();     
    %>
    <!--end of download -->

    Thanks. I believe something wrong with this statement
    in my program:
    You are correct there is something wrong with this statement. Seeing how you are doing this in a jsp, not really what they're made for but thats another topic, the output stream has already been called. When a jsp gets compiled it creates a few implicit objects, one of them being the outputstream out, and it does this by calling the response.getWriter(). getWriter or getOutputStream can only be called once, other wise you will get the exception you are experiencing. This is for both methods as well, seeing how the jsp compiles and calls getWriter means that you cannot call getOutputStream. Calling one makes the other throw the exception if called as well. As far as the filename problem in the browser goes I'm guessing that it's in IE. I've had some problems before when I had to send files to the browser through a servlet and remember having to set an inline attribute of some sort in the content-dis header inorder to get IE to see the real filename. The best way to solve this is to get the orielly file package and use that. It is very easy to use and understand and does all of this for you already. Plus it's free. Cant beat that.
    ServletOutputStream outs =
    response.getOutputStream();
    because I put a lot of printout statement within my
    code, and the program stops to print out exactly
    before the above statement. And then I get the
    following message, which repeats several times:
    ServletExec: caught exception -
    javax.servlet.ServletException: getWriter() was
    already called.

  • How to make it vibrate when you get a text

    Can't figure out to make my Droid 2 Global vibrate instead of making a sound when I get a text.  Can't seem to find that option in settings.  I'm a newbie so if you can help it is much appreciated.

    Open up your messaging app and hit menu, then settings.  Find the notification settings and there should be vibrate options in there for never, always, or only on silent. You can also set your notification sound to silent.

  • How to make a vertical lift or elevator in a platform game

    I am creating a side scrolling platform game using the book "Flash Game University" by Gary Rosenzweig.
    My protagonist has an instance of "hero".
    My current issue is trying to create a lift or elevator to carry the player up or down. The lift is not covered in the book. My thoughts were that the lift constantly moved up and down at a pace determined by a timer. I cannot get my lift to move. I have created a movie clip called "lift" and made it exported for action script. I can make it act similar to a floor movie clip so that I can stand on it, but I cannot get the lift to move on the y axis.
    I tried creating a new function called lift() and using a for loop to count between 0 and 100 using a variable "i" and then make my lift move up 1 unit for each loopcycle. It didn't work.
    lift.y -= lift.y - 1;
    Does anyone have a better solution?
    Thanks,
    Alex

    Rob,
    This worked. Here is my current code ...
    var topIndex:Number = 20;
                        var bottomIndex:Number = 160;
                        var stepDistance:Number = 10;
                        var movingUp:Boolean = true;
    public function createLift()
                                            box = new Object();
                                            box.mc = gamelevel.box;
    public function moveMyLift():void
                                            // lift 01
                                            if (movingUp && box.mc.y > topIndex)
                                                      box.mc.y -= stepDistance;
                                            else
                                                      movingUp = false;
                                              if (!movingUp && box.mc.y < bottomIndex)
                                                      box.mc.y += stepDistance;
                                            else
                                                      movingUp = true;
                                            if (hero.mc.hitTestObject(box.mc))
                                                      hero.mc.y = box.mc.y;
    My lift works correctly. It moves up and down correctly and when I jump on it I stay moving on it. There are only 3 things that don't make sense.
    1. When I am on the elevator I cannot jump. If I am not on the elevator I can jump normally.
    2. When I touch any portion of the elevator, my character automatically repositions itself to stand on the elevator. It seems normal, but not something that should happen in my scenario. I only want to "climb" on the elevator if I touch the "top" of the elevator.
    3. If I add a second elevator, even with its own function, the timing of the elevator math appears to synch instead of work independently. Why? The two elevators synch their movement and timing. Also the first elevator stutters as the synching of the two elevators match thier movement and then moves in unison with the second elevator. Why are they not operating separately?
    Here is the code for the first and second elevator:
    private var box:Object;
    private var box02:Object;
    var topIndex:Number = 20;
    var bottomIndex:Number = 160;
    var stepDistance:Number = 10;
    var movingUp:Boolean = true;
    var topIndexLift02:Number = 1;
                        var bottomIndexLift02:Number = 100;
                        var stepDistanceLift02:Number = 4;
    public function createLift()
                                            box = new Object();
                                            box.mc = gamelevel.box;
                                            box02 = new Object();
                                            box02.mc = gamelevel.box02;
    public function moveMyLift():void
                                            // lift 01
                                            if (movingUp && box.mc.y > topIndex)
                                                      box.mc.y -= stepDistance;
                                            else
                                                      movingUp = false;
                                              if (!movingUp && box.mc.y < bottomIndex)
                                                      box.mc.y += stepDistance;
                                            else
                                                      movingUp = true;
                                            if (hero.mc.hitTestObject(box.mc))
                                                      hero.mc.y = box.mc.y;
                                  public function moveMyLift02():void
                                            // lift02
                                            if (movingUp && box02.mc.y > topIndexLift02)
                                                      box02.mc.y -= stepDistanceLift02;
                                            else
                                                      movingUp = false;
                                              if (!movingUp && box02.mc.y < bottomIndexLift02)
                                                      box02.mc.y += stepDistanceLift02;
                                            else
                                                      movingUp = true;
                                            if (hero.mc.hitTestObject(box02.mc))
                                                      hero.mc.y = box02.mc.y;
    public function gameLoop(event:Event)
                                            // get time difference
                                            if (lastTime == 0) lastTime = getTimer();
                                            var timeDiff:int = getTimer() - lastTime;
                                            lastTime += timeDiff;
                                            // only perform tasks if in play mode
                                            if (gameMode == "play")
                                                      moveCharacter(hero,timeDiff);
                                                      moveEnemies(timeDiff);
                                                      checkCollisions();
                                                      scrollWithHero();
                                                      createLift();
                                                      moveMyLift();
      moveMyLift02();
    Thank you,
    Alex
    Message was edited by: ajdove

  • Outlook 2010 - how to make "global address list" display larger?

    Does anyone know how to make the "global address list" box and text appear larger in Outlook 2010? 
    Thanks

    What do you mean? Can you please explain in detail?
    Blog |
    Get Your Exchange Powershell Tip of the Day from here

  • How to make the basic graphics frame VerticalJustification as bottom align?

    Hi:
    In indesigne CS3 script, how to make the basic graphics frame
    VerticalJustification as bottom align?
    Thanks in advance.

    Vertical justification applies to text frames, not to graphic frames.
    Peter

  • How to make the Printer deskjet 3940 compatible with Windows 7, home basic, 32 bits?

    I have HP Deskjet 3940 Printer. I recently purchased a Lenovo desktop( C320, 57-302429) which has Windows 7,home basic,32 bits operating system. The said printer does not work with the above computer. Please guide how to make this printer compatible with the above operating system.
    This question was solved.
    View Solution.

    1. Click the Start button, click Control Panel and double click Devices and Printers.
    2. Click Add a Printer.
    3. Select Add a local printer.
    4. Choose an existing USBx Local port, click Next.
    5. Click the Windows Update button.
    6. After the update finishes, search for the 3940 driver.
    7. click Next,Next,Next,Next,Finish
    Please mark the post that solves your issue as "Accept as Solution".
    If my answer was helpful click the “Thumbs Up" on the left to say “Thanks”!
    I am not a HP employee.

  • How to make an icon image using Photoshop

    I found out how to do this recently so I decided that I wanted to make a tut for those who don't know how to make an icon image. This icon image is for the libraries tab on your computer. Under the libararies tab there is Music, Pictures, Documents, and Photos
    First you will need the ICO (Icon image format) Format extension for photoshop which can be downloaded here:
    http://www.telegraphics.com.au/svn/icoformat/trunk/dist/README.html
    The download link and tutorial on how to install it is all in the link above.
    Once you have that all set you can now launch photoshop to create your icon image. Once you have launched it, create a new document with the size as in the image below.
    [IMG]http://i1297.photobucket.com/albums/ag25/dusty951512/256x256_zpsbf3dcf8e.png~original[/IMG]
    Create the image you want. I used a simple one by using the custom shape tool by pressing "U" on your keyboard and with the
    basic blending options.
    [IMG]http://i1297.photobucket.com/albums/ag25/dusty951512/IconImage_zpsd788c709.png~original[/IMG]
    The reason why the image is pixelated is because it is an icon image. Since the image is only 256x256 pixels when you zoom in on it that will get you the pixely result. The reason why I zoomed  in is so you can see it. But don't worry this is no the end result. Just continue reading and you will see.
    So once you have created the icon go ahead and press
    file>save as>(under format choose the ICO)>and choose the name that you want to name it. And save it in your C: drive. You will see why to save it in your C: drive in a sec.
    [IMG]http://i1297.photobucket.com/albums/ag25/dusty951512/SampleicoPic_zpsd252bfba.png~original[/IMG]
    So now that you have created the icon and saved it now you can create the new library.
    [IMG]http://i1297.photobucket.com/albums/ag25/dusty951512/NewLibrary_zps8ca703b2.png~original[/IMG]
    Name the library whatever you want I named it "Sample" for tutorial purposes. Notice how it gives you a default boring icon image for your library.
    [IMG]http://i1297.photobucket.com/albums/ag25/dusty951512/Sample1_zpsb5472840.png~original[/IMG]
    So now once you have created and named your library now it is time to get the icon image into place.
    Go to computer/c: Drive/users/YOU/ And now once you have reached this area you will need to access a hidden folder named "appdata" to do so press "Alt" then a menu bar will show. Click
    tools>folder options>and view. Find the option to view hidden folders then press apply then ok. Now we shall continue so AppData>Roaming>Microsoft>Windows>Libraries
    Now you should see all the libraries including the one you just created.
    [IMG]http://i1297.photobucket.com/albums/ag25/dusty951512/showhiddenfolder_zpsad4a3c94.png~orig inal[/IMG]
    [IMG]http://i1297.photobucket.com/albums/ag25/dusty951512/Libraries_zpsf6243bc0.png~original[/IMG]
    Once you have reached your destination then open a new text document with notepad and drag the library you just created in notepad. The result should look like this:
    [IMG]http://i1297.photobucket.com/albums/ag25/dusty951512/Notepad_zps251a86f0.png~original[/IMG]
    once you have reached this point click at the end of the second to last line down then press enter and enter in this information
    <iconReference>c:\"NAME OF ICO FILE YOU CREATED IN PS".ico</iconReference>
    Example:
    [IMG]http://i1297.photobucket.com/albums/ag25/dusty951512/iconreference_zps1c1a3eca.png~origina l[/IMG]
    Once you have entered that information go to file>save and the icon image should appear on the library you created.
    [IMG]http://i1297.photobucket.com/albums/ag25/dusty951512/Finished_zps267f893a.png~original[/IMG]
    Now you are officially finished. Go and spread the news and joy. Bye for now
    -Dusty951512

    It is Windows only because all those screen shots are exclusively Windows, the file structure and paths do not resemble those of the Mac in the least.  As a Mac user, there's nothing I could take from your tutorial.  Sorry, 
    No drives named with letters like C: on the Mac, for instance.  No backward slashes either, ever.  No such paths either.  No "Notepad" on the Mac, we use TextEdit; but such a text editor is not remotely needed on the Mac to make and/or edit icons.  Etc.
    Those folders are not even called "Libraries" on the Mac…  Nothing resembling your tutorial at all.
    The icons in the Finder's Sidebar are not customizable at all in recent version of OS X.
    =  =  =
    You can edit any post of yours only until someone replies to it.  At this time your post is not editable by you any longer.

  • How to make a Previous/Next Menu

    Hi there.  This is my first time posting in the Adobe forums so please be patient if I don't do things correctly.
    I currently have the Adobe Web Design CS5 package and all the programs that come with it, but my question is specifically about Dreamweaver.  My computer is a Macbook with the latest operating system as far as I know.
    I've been trying to create a next/previous menu for parts of my own personal website.  It's http://www.aidenart.com . If you click on the link to the Concept Art page you should see a bunch of image thumbnails that act as links.  Click on any one of those images and you're suppose to see the full image from the thumbnail in a whole new page.  On the pages with the full images I would like to include, at the bottom, a jump menu so that a visitor can pick any of the pages that they might want to see (I already know how to do this part), but I would also like to include buttons which allow the visitor to visit the next image in the list and also the previous one in the list.  You know, a previous and next menu.  I've seen other websites using those kinds of buttons so I know it's possible somehow.
    By looking at the source code of some websites and doing a bit of research on my own, I think this can be done using javascript of some kind.  Maybe by using an "onClick" behaviour or something.  I looked at a few different web help sites, including W3 Schools, and I still haven't found any clear cut explanations on how to make a previous/next menu.  If someone could just show me the basic code for making a simple one that actual works then I could probably work from that.
    I would prefer it if I didn't have to bother with the dreamweaver extenstions section because most things listed in the exchange are something you have to pay for.  And for those of you who think I should just make individual links on each page, please keep in mind that I'll want to add more pages in the future.  Most likely a lot of pages.  I also want to be able to make previous/next menus for the comics section of my website for when I have more comic pages available, so I really need to know how to do this.
    I hope that was enough information for you guys.  I can try to provide code if you guys want although I'm not sure how that would help solve my current problem.

    Only way to do pagination effectively requires either a database or XML files containing your data.  Neither way is really for a beginner based on my experience with both.  And based on the size of your library right now, pagination isn't what you really need.
    If it is going to be an image gallery you could look into the php Gallery script if you have a mySQL database ( http://gallery.menalto.com/ ).  But for simple solutions.
    For even smaller solutions you can look to JQuery solutions.  They require minimal amounts of coding, mostly just file inclusions.
    http://galleria.aino.se/
    http://fancybox.net/
    http://www.twospy.com/galleriffic/#1
    It's just about finding one that meets your needs and gives you the ability to customize as you see fit.

  • How to make the product-info-textfields tidy?

    Hi there,
    I am solving one problem, but it results to several questions (set in bold):
    I am about to create a product catalog, based on design createdy by someone else. There are product cells on the page. Each cell contains image & info, as usual. This is one example of the cell:
    Have a look how the bottom textfields are build:
    It seems to me as one huge mess. The file was prepared by hyper-professional-looking-studio. They used separated textfields for each chunk of information. I expected something more elegant — one or two textfields with precise paragraph spacing and of course with paragraph rules. I would like to ask you: Is this approach considered as industry standard? What if client will ask for increasing the fontsize?…
    Do you thing, that it could be caused by some automate typeseting third party program or script like this one? S Publishing
    I tried to make it more tidy. So I decided to use as little textfields as possible. But I am clueless now. I want to recast all these tree textfields…
    …into one. So I put all the text into one textfield. Each kind of info as a separate paragraph. But I can't force the last paragraph to get upwards:
    I tried to increase the number of columns from 1 to 2, I was playing with the Text Frame Options, but no chance to manage it.
    So let me please ask another question: could be this paragraph forced to move puwards?
    And last one(s):
    If you see the product-cell: Which is, in your opinion, the minimal amount of textfields to fit all this text? I assume, that the „M“ and  S—XXL have to land in separate textfield. Or could all the text be in one textfield?

    If I wasn't using a catalog plug-in...
    I would make a page layout with separate text frames (with placeholder text), the size labels and an empty image frame for the product, and select everything and drag the layout into the library panel. I would do that for the basic variations. Then when I added a page, drag the type of library item onto the page and change the text, add the image and move to the next page.
    Mike
    Edit to add. You can move the one block of text up using baseline shift. But that much shift makes it difficult to select/edit the text. The screen shot shows a massive amount (65 pts if I recall). The black is actually the selected text that appears above due to baseline shift. In short, your flying blind on editing text unless you use the story editor.

  • How to make a 2nd player in this racing game.

    I'm using this tutorial to learn how to make games in Flash for a class, but it doesn't say how to make a 2nd player.
    If somebody can show me the code to make alternative controls (W,S,A,D) for a 2nd car that'd be fantastic!
    Thanks a lot,
    Dd
    http://www.emanueleferonato.com/2007/05/15/create-a-flash-racing-game-tutorial/

    if (_root["car"+who].code == "player") {           
    if (Key.isDown(Key.DOWN)) {
                   this["speed"+who] -= _root.backSpeed;
              //steer left - well, we could simply add or subtract a fixed angle (in degrees) to/from the car's rotation, but that's not good enough. In order to simulate a natural movement, steering must depend on speed, otherwise you will be able to rotate your car even if it's almost stopped and it will look like a propeller
              if (Key.isDown(Key.LEFT) && this["speed"+who]>0.3) {
                   _root["car"+who]._rotation -= _root.rotationStep*(this["speed"+who]/_root.maxSpeed);
              //steer right - you already know what happens here
              if (Key.isDown(Key.RIGHT) && this["speed"+who]>0.3) {
                   _root["car"+who]._rotation += _root.rotationStep*(this["speed"+who]/_root.maxSpeed);
    You basically have to make a second conditional clause that starts:
    if (_root["car"+who].code == "player2") {           
    if (Key.isDown(/*Insert KeyCodeValue of the Key you want to use*/)) {....
    The AS2 keycodes can be found here:
    http://www.adobe.com/livedocs/flash/9.0/main/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Parts&file=00001136.html

  • How to make VIP flag in transaction code fpp2 as non editable

    Hi everyone,
    Please guide me about:
    How to make VIP flag in T Code FPP2 as non editable only for some particular users?
    Is there any authorization object exists for this flag in FPP2 transaction?
    Actually there are many users who have authorization of transaction fpp2. But we want only some particular users should have authorization of making changes to this flag.
    Please guide with your valuable replies.
    Thanks and Regards

    Hi...MP Vashishth
    try to creat an Authorization Management ...  in customizing...
    Cross-Application Components --> SAP Business Partner --> Business Partner --> Basic Settings --> Authorization Management
    Creat an Grup..and others steps...!
    and when finish clic on Generate and Assin Authorization !!!
    I Hope it Help !
    regards
    Andre Frugulhetti
    Edited by: Andre Frugulhetti on Sep 22, 2009 9:38 PM
    Edited by: Andre Frugulhetti on Sep 22, 2009 9:39 PM

Maybe you are looking for

  • The interface you are trying to use is related to a logical schema that no

    "The interface you are trying to use is related to a logical schema that no longer exists" I'm facing this error when importing a project on Designer connect to a new work repository. I have an TEST Data Integrator environment and now I need to move

  • How to clear Purchage return (T.code. F-41)

    Hi My dear friends... when i post purchase return document using F-41,  always showing pending traction means it showing open item.. how to clear that purchage return.. when i post purchage invoice, outgoing payment  also it showing open item.. how t

  • Maximum File SIze Final Cut Pro 10.0.7

    Does anyone know what the Maximum Number of Events/Clips/File Size/etc that final cut Pro can work with handle efficienly

  • Volume too low on iphone handset!

    It seems that the volume level on my phone ear speaker has diminished with time. I can't even begin to hear the other party when I am driving. My ringtone doesn't seem to be as loud either. Please, no suggestions about removing the protective plastic

  • Video on iPhone 3G

    does anyone think that apple will put video recording onto the iPhone ???