Prototype 2

Back Yard

Theme: backyard

The-Incredible-Machine-Z5CC
Requirement: everything is interactive

Due: October 1 at 4 PM

Filename: <Lastname>-Prot2-<title>-Gold.exe

Good luck and have fun.

-Dr. Christopher

Advertisements
This entry was posted in Uncategorized. Bookmark the permalink.

18 Responses to Prototype 2

  1. Tomer Braff says:

    Hey guys, Tomer here. I found some really good code for movement in all 8 directions;

    //Code to Determine Movement Direction
    key_hor = keyboard_check(ord(‘D’)) – keyboard_check(ord(‘A’));
    key_vert = keyboard_check(ord(‘S’)) – keyboard_check(ord(‘W’));
    key_speed = min(1,abs(key_hor)+abs(key_vert));
    key_dir = point_direction(0,0,key_hor,key_vert);

    x += lengthdir_x(playerSpeed*key_speed*1.8,key_dir);
    y += lengthdir_y(playerSpeed*key_speed*1.8,key_dir);

    Place this code in a Step event for your player object. This is controlled via WASD, but you can change the parts to change the controls.

    • Tomer Braff says:

      Also, to better control how fast the player is going, create a variable on a create event and set that to some number you’d like. Adjust it to figure out what speed you’d like.

    • Thanks 🙂 It didn’t work for me but I found the source and messed around with it a little to yield the following code, which should work for anyone who had trouble:

      key_hor = keyboard_check(ord(‘D’)) – keyboard_check(ord(‘A’));
      key_vert = keyboard_check(ord(‘S’)) – keyboard_check(ord(‘W’));
      key_speed = min(1,abs(key_hor)+abs(key_vert));
      key_dir = point_direction(0,0,key_hor,key_vert);

      hspeed = lengthdir_x(key_speed,key_dir)
      vspeed = lengthdir_y(key_speed,key_dir)

      To be safe, replace the quotation marks with new quotation marks once you’re in the editor, as the blog format seems to mess it up. Also, if you’ve got Gamemaker Standard or better, add the following line at the end to make the sprite face the appropriate direction:

      image_angle=direction

  2. John Barard (Dalton Irwin) says:

    Well, while we’re sharing our movement code, here’s one that I found. It’s similar to the others on here (using WASD and allowing movement in all directions, for instance), but it uses if statements to keep the player from moving past a certain speed (which can easily be changed to suit the occasion, of course):

    //down movement
    if keyboard_check(ord(“S”)){ vspeed+=1; }
    if vspeed > 5 { vspeed = 5; }

    //up movement
    if keyboard_check(ord(“W”)){ vspeed-=1; }
    if vspeed < -5 { vspeed = -5; }

    //left movement
    if keyboard_check(ord("A")){ hspeed-=1; }
    if hspeed 5 { hspeed = 5; }

    //no movement
    if keyboard_check(vk_nokey){
    hspeed = 0;
    vspeed = 0;
    }

    By the way, this movement does seem to work better than the convoluted movement mechanic that I had for last week’s game. Hope this helps, rather than hinders.

  3. Kevin Malvaez says:

    Kevin Malvaez

    https://www.dropbox.com/s/2b85oc6uu9qm2pl/Malvaez%20-Prot2-9%20Lives-Gold.exe?dl=0

    Game Title: Nine Lives

    Here is also my Game Maker 8.1 file if you guys want to open up my game and reserve engineer it

    https://www.dropbox.com/s/schyseh5t15ez56/Malvaez%20-Prot2-9%20Lives.gm81?dl=0

  4. Nathaniel Propp says:

    https://www.dropbox.com/s/ykedfh9p3egvdtk/Propp-Prot2-EstherTheMole2-Gold.exe?dl=0

    Nathaniel Propp

    Instruction
    (space) to dig
    ‘E’ to drop rocks.

  5. James Pappas says:

    Apologies for the lateness on this assignment. I attempted to finish it this past week, but I could not figure out how to get blocks pushable while still maintaining the camera style of the previous project. Therefore, this assignment is incomplete.

    https://www.dropbox.com/s/1mg7hjzsrgqbw7v/Pappas-Prot2-imaginationfield-gold.exe?dl=0

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s