battlerez – BattleRez Tech https://www.battlereztech.com Yes, I'll totally make that VR game for you! Mon, 05 Dec 2016 17:58:18 +0000 en-US hourly 1 https://wordpress.org/?v=6.5.3 https://www.battlereztech.com/wp-content/uploads/2016/11/cropped-Pixels-Back-32x32.png battlerez – BattleRez Tech https://www.battlereztech.com 32 32 Math + Art with Blender https://www.battlereztech.com/math-art-with-blender/ Mon, 05 Dec 2016 17:52:23 +0000 http://www.battlereztech.com/?p=212 Continue reading Math + Art with Blender]]> potsherdmake

PUBLISHED HERE!

Blender is an amazing FREE software that allows for 3D modeling objects and then seamlessly exporting them to Unity to use within a game environment. 3D modeling is a complex mixture of math and art that takes years to master. A very unique story is how Pixar was made with a mathematical equation. This equation is the reason Pixar animations are so smooth and round. Click here if you are interested in the Pixar story. I am in the learning stages and I am very lucky to have an internship that requires these skills so that I may continue learning 3D modeling as well as game design. In a normal game development environment, there would be a team 3D modeling and a team programming the game. However, I am in charge of it all, which makes the going slow, though incredibly fun. This week was a very blender extensive week while I worked to design a pot sherd so that I may “litter” the ground around the pueblo with them. Even today if you look at the ground at the Coronado Historic site, there are pot sherds poking out of the ground everywhere. We can only imagine how many were at the site during the excavation.

First I must create the structure of the pot sherd object. This is called the wire frame.

potsherdstructure
Wire Frame

I then set it up to diffuse a color light. I chose yellow to mimic the sunlight that will be hitting it.

diffuselight
Diffusing Yellow Light

Then a texture is created. I created this texture in photoshop using an actual pot sherd image found at the Kuaua Pueblo.

potshrdtexture
Texture

Followed by a material that can be applied to a face on the object. I also created a sandy texture for the edges of the sherd also using a real image from a pot sherd found Kuaua.

potsherdmat
Materials

Resulting in a pot sherd!

potsherd1
Completed triangle shaped pot sherd

The next goal is to upload this object into Unity and use it to decorate the landscape. I also wanted to make the site look more like it is being “dug up” by the archaeologists. I have added dirt mounds and more texture to the grasses and rocks around the walls.

Creating a round pot sherd in Blender
Creating a round pot sherd in Blender
dirtmounds2
Dirt mounds along the wall
Added pot sherds to the landscape
Added pot sherds to the landscape
dirtmounds
Mounds of dirt along the walls
]]>
Create-A-Thon 2015 https://www.battlereztech.com/create-a-thon-2015/ Mon, 05 Dec 2016 17:45:59 +0000 http://www.battlereztech.com/?p=207 Continue reading Create-A-Thon 2015]]> I participated in the Albuquerque Create-A-thon.

PUPLISHED HERE!

Gallons of coffee were most likely consumed this weekend…

…while volunteering for the Albuquerque CreateAthon. Volunteers of technology experts and students have just one day to help a non-profit in Albuquerque with their technology needs. This project was overwhelmingly fun and exciting as my team and I stayed awake for 30 straight hours to participate and help the non-profit Centro Savila with a new logo, new website, new brochures and an amazing android application.

Channel 13 Video Here

bowl editingIn effort to catch up after this event I spent most of my time this week doing research and editing images for the Kuaua pueblo game.

I was in need of researching the benefits and ability to use a database to hold the data that will be used within the game. This includes images of artifacts, positioning data, information and stories to enhance the game as a learning tool.

Unity does not support an outside database very well without using a server with internet capabilities. Although using a local database stored on the computer this game will be run from is possible it can also cause many malfunctions causing the need for a high level IT personnel if something were to go wrong.

I have decided against the external database and will create one inside the Unity game that will of course serve my purposes well but will not be editable from the outside or as large as one needed to house the large portion of data from Coronado.

Instead I will be very selective with the artifacts to be used to keep the application as lightweight as possible. While programming this, I will build it to be scalable and useful to anyone in the future to advance the project and use an external database.

bowl editingmano before after.I have chosen three artifacts and started using Adobe Photoshop to enhance and crop the images to produce an aesthetic viewing inside of the game.

I was also shown AMAZING documents from the archaeologists while excavating Kuaua Pueblo. I have become fascinated with reading about their everyday work at uncovering the mysteries to this pueblo. These documents are helping Ethan and I to determine the locations of certain artifacts and objects within the many walls of the pueblo. I will be using this information to accurately place artifacts throughout the game to give a real sense to what it might have been like to be an archeologist working on the Kuaua Pueblo. I have also learned that apart from dirt and adobe walls found at the site there were many fireplaces throughout the rooms that I would like to add to the game.

The more invested I become with the project the more I love this historic site. Ideas to enhance this site come easily while sitting on the edge of the Rio Grande, watching kayaks float along the current and listening to the bees buzzing around me.

I feel blessed to feel apart of such an amazing place.

kayaks

]]>
Coronado GUI Development https://www.battlereztech.com/coronado-gui-development/ Mon, 05 Dec 2016 17:42:05 +0000 http://www.battlereztech.com/?p=205 Continue reading Coronado GUI Development]]> It was built in Unity3D using C#.

Published HERE!

GUI stands for Graphical User Interface and is pronounced “gooey.” This term was created in the 1970’s to distinguish text based user interfaces from those that contain windows, icons and buttons. Today almost all user interaction uses a GUI, from your computer to phone or tablet.

These icons and buttons that are clicked or touched are sending commands to the hardware instead of typing every command you need. If the interface you are using has graphical elements then you are using a GUI.

For the Kuaua Pueblo Dig game, we have decided to use a touch screen monitor to allow the users to move about the scene. This means the GUIs need to coincide with the correct layout and code to be controlled with a finger. This means the GUIs can not rely on multiple button input and there must be a button for every action that needs to be done.

One of the most important steps to designing a GUI is the “pen and paper” phase. The layout of the GUIs needs to be drawn first to make designing it on the computer much easier. It is also important to do this phase so that you will know how many GUIs are needed, what they will do and where they will send the user.

“Pen and Paper” Phase for Kuaua Dig Game

Once this step is satisfied, recreating the GUI layouts in unity is the next step. This can be a tedious process because everything depends on layers and settings.

  1. Setup “canvas” layer
  2. Attach it to the camera that will view it. There are many settings to play with until it is adjusted just right. This canvas will hold all of the GUI elements in view.
  3. Create “panel” layers. This panel layer will allow for background images or colors. Panels are important for grouping different interfaces together. A panel should hold a set of buttons. Another panel should be used to display text. The reason grouping different elements together is important practice is for controlling them with code. If the code needs to change the text in view but the buttons are in the same panel it might cause the buttons to change as well.
  4. Code the GUI. Depending on what needs to be done code will be created and attached to the GUI element so that it becomes interactable. Some examples in the Kuaua game are switching between GUIs, switching between scenes, exiting the game, showing information and controlling the camera view.
  5. DESIGN! This is the last step that needs to be done for the GUIs in the Kuaua game. Button images, titles and icons still need to be designed and then added to the GUIs. Right now I am using placeholder images that come with Unity until I create unique ones.

The following pictures are rough drafts of the GUIs in the game now. Everything in them will be replaced with unique images and designs created specifically for this project.

GUI for the Main Menu Scene
GUI for the Main Menu Scene
GUI for the Site Map Scene
GUI for the Site Map Scene
GUI for the Dig Game Scene
GUI for the Dig Game Scene
]]>
Attract Screen – The Nuclear Museum https://www.battlereztech.com/attract-screen-the-nuclear-museum/ Mon, 05 Dec 2016 17:18:25 +0000 http://www.battlereztech.com/?p=197 Continue reading Attract Screen – The Nuclear Museum]]> When working on the Element Factory for The National Museum of Nuclear Science & History, another component was a program that could launch two applications as well as draw users attention to the exhibit.

I enjoyed this project so much because of the creativity involved. I used C#, Visual Studio & Blend to came up with the following screen:

]]>
M. Verlaine Rhodes https://www.battlereztech.com/m-verlaine-rhodes/ Tue, 29 Nov 2016 21:19:11 +0000 http://www.battlereztech.com/?p=145 Continue reading M. Verlaine Rhodes]]> This was one of my favorite websites to design because it was for an artist. I enjoy trying to re-create the feel of the artwork online to give users an in depth look into the artist. I used PHP and WordPress for this site. I used the Fluida template and tweaked it’s css and php to fit my design.

Visit the Website here

 

]]>
Innovate & Create! – WEEK 1 https://www.battlereztech.com/innovate-create-week-1/ Sun, 10 Jul 2016 05:29:29 +0000 http://www.battlereztech.com/?p=101 Continue reading Innovate & Create! – WEEK 1]]>

Website

Podcasts!

Day 1

6/13/16

My first day of camp as well as some of the Girls Scouts was overwhelming as well as extremely fun. In the end I am just happy that I survived but also learned the girls names and a little bit about them. I was pleasantly surprised with how well many of the activities went – especially the Stream of Consciousness exercise.

Originally we decided to have them continually write for 3 minutes however we tried 10 minutes and all most all of the girls diligently wrote the entire time and complained that it was not enough time after words. I was thrilled to see so many budding writers in class. We even allowed them to continue writing and they did so without any push or help. This was shocking to me because I have always imagined being met with resistance for writing. Many of the girls, even the ones that refused to write came up with unique ideas during the 10 minutes. I would like to have the girls do a 5 minute stream of consciousness everyday to get the creativity flowing. I am very excited to see what they create tomorrow when we discuss poetry more in depth.

One thing that I felt could have been better was the use and creation of emails so that the girls could have websites. The girls could get it, however it was a lengthy process as well as frustrating. Another thing I noticed was that once we changed the lesson plan, it was impossible to get back on track. It was very well organized in the morning and then the afternoon we were trying to figure out where to pick up ect…

We had planned to give them a writing prompt: “And suddenly the 30 strangers in the room felt like the closest of friends.” Instead we went to Start – Up exhibit which was fun but then we were unable to follow our curriculum afterwards. In the end this did not matter as all the girls wrote stories without the prompt or worked on their website. The problem was that it created a time crunch and we ended up not doing the last activity either which was to learn photoshop. We instead created pixel art logos that we will digitize tomorrow. In the end we did not lose anything important and in fact covered well with the pixel activity.

Day 2

6/14/16

Today was extremely successful and fun for me, although I know that Victoria had a rough time at one point. We started the day off with designing a personalized Luchador mask, which started with a name, then draw your mask and thus extended into creating the mask physically. We then split into two groups and one group focused on doing Haiku while the other did erasure poetry. After that we finished up the day with sharing our poetry to the entire group and then cleaning the classroom.

For our icebreaker we decided to talk about Luchador masks. We found a fun website that would generate a Luchador name. This was extremely hilarious and fun. The girls all picked out a name and wrote it on their Kleenslate board. Then they drew what they would want their masks to look like. They were having so much fun we decided to extend the activity and brought out Art supplies so that they could create physical representations of their masks.

After this, we split the girls into two groups and I took half and Victoria took the other half. We needed to do this because the Erasure Poetry required photoshop and we did not have enough computers with that application. In my group, we talked about Haiku and how to create it. Then we played with Haikucubes to help us create them. I came up with multiple challenges for them using the cubes. They had so much fun. Some of the challenges:

  • Create a group Haiku
  • Make a Haiku with only the words on the blocks
  • Choose one word and that is your Title
  • Choose three words and each word starts each line of the Haiku
  • Each girl takes turns and chooses one word until we make a Haiku

20160614_142834The first group excelled with this activity and Anthony did interpretive readings of their haikus. I did have one girl who told me she will not participate and as hard as I tried I could not get her to join the activity.

Unfortunately, while this activity was going on, Victoria had a very frustrating time with her group during the Erasure poetry because MOST of the girls refused to participate in the activity. They just flat out said “We refuse to participate.” They acted silly and played games behind Victoria’s back. After lunch we switched groups and I also had a very hard time with the group. They participated but refused to follow directions and just screamed and acted wild. We still accomplished haikus however which I was happy for. They also performed interpretive readings at least. We decided to be more careful with which girls get grouped together.

Day 3

6/15/16

Today was Bandojo day. We started the day off with updating their blogs from poetry day. Then our guest speaker taught them how to use Bandojo until lunch time. After that we introduced podcasting to the girls and then split them into 3 groups and had them facilitate a podcast. After this we had them make and record their own music in Bandojo in groups of two.

20160614_114426

Day 4

6/16/16

We went to Meow Wolf today!

Day 5

6/17/16

 

 

]]>
The Element Factory https://www.battlereztech.com/the-element-factory/ Sun, 10 Jul 2016 05:09:54 +0000 http://www.battlereztech.com/?p=89 Continue reading The Element Factory]]> The National Museum of Nuclear Science and History has a very beautiful entrance that consists of a large periodic table with each element created out of marble. The tiles are large enough for a few people to stand on them comfortably which caused them to create a “Periodic Twister” game that helped kids learn about how elements are used together to create everyday household compounds. They also have a very large touch screen table that currently had one very bland timeline application for the Pioneers of Nuclear science exhibit.

Highlands was asked to come up with a way to combine the periodic Twister game with the touch screen table without losing the previous timeline application. We discussed several ideas until we came up with “The Element Factory.” This game would consist of a periodic table that provided a timed game in which a user would be asked to complete a compound by dragging elements into a bin. This would be a multiplayer game so it must allow for many touches at once.

We were also given special permission from Theodore Gray to purge his website for anything that we would find useful for our game. We created a touch table version of a periodic table using C# and Blend in Visual Studios and then plundered his website and created the content so that a user may learn about the elements without playing the game. They can then click to play the game and race against the clock. We created the table to pull all of the elemental data from 2 files stored in google drive excel sheet.

The final step was creating an attract screen that would also handled opening and closing the older application as well as our new game. Here is what I created with Blend and C#:

nuclear_attractScreen_2

ON FACEBOOK:

Thanks to these two software designers from New Mexico Highlands University we now have an educational video game in Periodic Hall (in front of Pioneers of the Atom).

Bresdin O’malley (on left) and Simone Seagle (on right) created an interactive periodic table that teaches you about the elements, and museum visitors can play a game that challenges their knowledge on chemical compounds. What a creative solution to make the visitors experience fun, interactive and unforgettable!

4321


Concept for game 

Name: The Element Factory

Objective: Create the compounds that are shuffled each game

Game Play: Everyone will be able to click on an element in the periodic table and that element will stick to their finger. They will then drag that element to the factory bin. They must collect all needed elements to advance to the next compound. Players race against a clock to get as high of a score as possible.

If the wrong element is put into the factory it will cause an unpleasant noise and be removed.

]]>
Detroit VR https://www.battlereztech.com/detroit-vr/ Sun, 10 Jul 2016 04:30:36 +0000 http://www.battlereztech.com/?p=35 Continue reading Detroit VR]]> I spoke to my friend Rachel about my project and she mentioned that her company makes 3D models of cities all over the world. She asked her boss if it would be possible to let me use some of the models for a VR research class and her boss was enthusiastic about it and said it shouldn’t be a problem.

I set up a deal to get downtown Detroit from his company PLW . This made it it possible to use all of my time for research into the use of dual systems with the Oculus Rift DK2.

Sadly the end of this project turned into a Fly through of downtown Detroit with Leap Motion hands. The Oculus support was dropped during my semester of research. This project had to be put on hold. The following is an example of the research data.

Documentation Blog

20150927_151455

DEVELOPMENT –>

For my independent research study wanted to develop a project using Unity software with the Oculus DK2 and the Emotive headgear. After this proved to be too difficult to develop with I decided to use the Leap Motion (I also looking into a device called the MYO armband) as the secondary device instead of the Emotive. It has recently been developed to attach to the front of the Oculus DK2 and be used in conjunction with it. In the middle of the development progress I spoke with PLW Model Works in Florida who develop 3D models of cities using realistic imaging. I was offered a section of any city I wanted to add to my program. I chose downtown Detroit and after working out an agreement I was given 7 GBs worth of models. After weeks of development I ran into a very large snag with the Oculus DK2 SDK and utilities package for Unity. The census becomes apparent that the Oculus released a broken set of utilities for the most recent Unity 2.3 as well as a runtime that no longer supports Unity. They also dropped support for any Unity version before 2.3 so using older versions did not fix the issue. After also experiencing issues with the Leap SDK I started to suspect that it is actually my OS system. I am running a 64-bit Windows OS system and the Oculus SDK has a hard time running on windows 7. I had to do a lot of work and download another program to run just the demos for the Oculus.

They report to be working on this problem, however not in time for this project to be completed. Instead I was able to integrate the Leap Motion Controller without the Oculus and use my Mac OS X system for development. To expand on this project I will hopefully be able to use the Oculus and Leap together once they update the support for Unity. This project can be used to “visit” Detroit without actually going there. I also want to use the project to build community awareness of Detroit. With more time and supported SDKs this project has large potential. I am hoping to continue development and make something to show the value of using a VR device. I am also wondering about using different VR systems instead of the Oculus because of so many companies running into the same problems I have and deciding to stop building with it.

This brings up a very important aspect to building with devices such as the Oculus as there is not a lot of documentation or help. This causes so much frustration to developers that they stop using the devices and the technology dies without every reaching the full potential. This goes for other devices such as the Kinect or the MYO armband as well.

Emotiv EPOC Headset

The Emotiv EPOC headset(1) is designed with several capacitors that act as an EEG and output several numbers that can be used to control different aspects of a game or program. While there is a few examples of this being used with the Oculus online there is a lot of consensus that it is not worth the effort and trouble(2). One reason being that the Emotive headset has connectivity problems and getting it to work is a shot in the dark(3). I myself experienced this problem while trying to get the headset to connect to my own brainwaves. I believe I have to much hair for a solid connection to be made between the set and my head. Another interesting reason why the Emotive can offer frustration with games is how tiring it can be(4). “Thinking” about walking is very tiring because our body does that subconsciously, causing the “VR” experience to be distorted. After this research I decided to halt development for this project using the Emotive headset.

  1. https://emotiv.com/
  2. https://m.reddit.com/r/oculus/comments/2v7135/could_oculus_be_worn_at_the_same_time_as_emotiv/
  3. https://forums.oculus.com/viewtopic.php?t=8635
  4. http://www.roadtovr.com/topic/mind-control-emotiv-epoc/

MYO Armband

The MYO armband(1) is an arm band that reads the muscles in your arm to perform actions on the computer. I used the armband for several days and actually quite enjoyed the experience. When it is synced correctly it works very well as a device to do small tasks on the computer. One of the drawbacks was how tired my arm muscles would get and the soreness I experienced after using it. Another drawback was that there are not many gestures that it can read causing the usefulness to be low for a video game. This reason proved to be a good reason not to use it for this project because expansion with the project would be hindered.

  1. https://www.myo.com/

Leap Motion Controller

The Leap Motion Controller(1) is a device that uses cameras to detect hand movement to control objects on the computer. This device offers a very large community and many documentation sites to help developers. The developers of the Leap are also very present on the forum boards and seem to work very hard to help developers with their issues. This proved to be a very important detail for why I wanted to use the Leap for this project. Another great aspect was that they have developed integration with the Oculus DK2 rift to make development easier. The Leap can connect to the front of the Oculus with the only drawback being an added wire connected to the device(2).

Development

I downloaded the Leap SDK 2.3.1+31549 and could not get it to run on my 64-Bit Windows 7 machine. Even with similar issues that were solved on the community forums(3) I was unable to fix the issue on my OS. The Leap Controller remained OFF even with calibration working. This also may be an issue with windows 7. When I downloaded the same SDK on my Mac OS Yosemite machine it worked perfectly. I downloaded the Leap Core Assets that work on Unity 5.2+(4). These work perfectly when the prefab HandController is dragged into the scene and the camera is placed directly behind the hands. They are very small and need to be scaled up. As long as an object has a RigidBody applied to it, the hands can interact with the object(5). Once the game was built however the FPS had a very hard time drawing the hands fast enough to give it a smooth appearance.

  1. https://www.leapmotion.com/
  2. https://developer.leapmotion.com/vr-setup
  3. Fixed Leap Problem
  4. https://developer.leapmotion.com/downloads/unity
  5. https://developer.leapmotion.com/getting-started/unity

Oculus DK2 Virtual Reality Headset

The Oculus DK2 VR headset(1) proved to be such a large hassle to deal with that my project can not use the headset at this moment in time. However, it should be able to be integrated into the Unity 5 software as well as the Unreal Engine(2). It explains that Unity 4 is supported but not well and users need to update to Unity 5 soon. The Oculus Utilities to integrate into Unity also come with the Leap Motion Controller Assets. You can also attach the Leap Controller to the front of the Oculus and be able to use both together to give a better controller option for the Oculus than using the keyboard.

 

Development:

In order for the Oculus to be developed with one must download the current SDK (0.8.0 as of now), the current Unity Utilities and the most current Unity software. It is supposed to be easily integrated into Unity 5+. However, the Oculus Developers recently dropped the support for all Unity build under 5.2 and produced an SDK that is full of bugs when dealing with Unity 5.2. This has been such an awful step for them that many companies have stopped developing with Oculus entirely(2). I have even posted a question myself on the Unity forum without any response so far(3). I also found a forum where the Oculus Developers admit to not supporting Unity at this time(4). In fact, I was so confused because the Oculus and Unity Requirement page explains that it should work with Unity 5.2 but after several days of research the page now appears to be 404(5). When I started testing with the Oculus earlier in the semester it worked just fine with Unity 5.1. After I opened my project after the newest Oculus SDK was released it no longer worked without upgrading Unity to 5.2. This fixed the errors I was getting but The headset stopped turing on and being available through Unity even when I built the program. I tried all the different SDKs, Unity Versions and the Utilities with zero success. I did the following table for Oculus SDK 0.6 and Oculus SDK 0.7 with different errors being produced for each SDK.

Oculus Utilities -> 0.1.0 0.1.2.0 0.1.2.3.0
Unity Builds
5.0.0 X X X
5.1.1 X X X
5.2.1 X X X

 

As of May 2015, Oculus dropped all support for OS Mac X and the last known SDK to work is 5.1 with no Unity Utilities to develop while using a Mac (7 & 8).

  1. https://www.oculus.com/en-us/dk2/
  2. https://developer.oculus.com/documentation/game-engines/latest/
  3. http://answers.unity3d.com/questions/1037902/oculus-rift-not-working-with-unity-5.html
  4. http://answers.unity3d.com/questions/1104992/oculus-dk2-unresponsive-for-unity-52-windows.html
  5. https://forums.oculus.com/viewtopic.php?t=26063
  6. https://developer.oculus.com/documentation/game-engines/unity-req/
  7. https://answers.oculus.com/search.html?f=&type=question&redirect=search%2Fsearch&sort=relevance&q=max+os
  8. http://www.macworld.com/article/2922722/no-oculus-rift-for-the-mac-but-your-mac-couldnt-handle-it-anyway.html
]]>
Scratch Programming Intro – Maze Game https://www.battlereztech.com/scratch-programming-intro-maze-game/ Fri, 15 Apr 2016 03:37:15 +0000 http://www.battlereztech.com/?p=68 Continue reading Scratch Programming Intro – Maze Game]]> Objective:

Introduce, demonstrate and facilitate using Scratch Programming and a makey makey controller.

Goals:

Create a video game

Create an animation scene

Merge video game and animation

Use makey makey to control game

  1. Introduce Scratch
    1. www.scratch.com
    2. Offer to create an account for saving purposes
    3. Click “Create”
  2. Background
    1. Show off images
    2. Find the X/Y coordinate image
    3. Demonstrate making a personalized backdrop
  3. Sprites
    1. Show off sprite images
    2. Demonstrate how to make your own sprite
    3. Grow / Shrink buttons
    4. Open X / Y Coord and show how to place sprite and where it is on the grid
  4. Scripts
    1. Make sure X/Y coord backdrop is open
    2. Event
      1. When Flag clicked to start program
    3. Control
      1. Forever loop
      2. If else loops
    4. Sensing
      1. (Sensing)Left, right buttons are clicked something will happen
      2. (Add to control loops)
      3. (Sensing) Show video ** ONLY IF TIME
    5. Looks
      1. (Looks)Change the costume
      2. (Looks)Say something
    6. Motion
      1. (Motion)Change by x
      2. (Motion)Change by y
      3. Positive and negative values
    7. Hitting a wall
      1. (Sensing)If hitting a certain color then reset sprite
    8. Reset Sprite
      1. (Motion)Reset sprite on start as well
    9. Point in direction
      1. (Motion)Point in direction left or right
    10. Backdrop
      1. (Looks) Change to next background
      2. (Sound) Add Sound
      3. (Scripts on BG) Add a sound script
]]>
Scratch Tutorial Game – Brick Breaker / Pong Game https://www.battlereztech.com/scratch-tutorial-game-brick-breaker-pong-game/ Fri, 15 Apr 2016 03:30:13 +0000 http://www.battlereztech.com/?p=63 Continue reading Scratch Tutorial Game – Brick Breaker / Pong Game]]> This tutorial was written by Allie Burnquist for Start-Up Studio at the Natural History Museum in Albuquerque, New Mexico. It describes a Brick Breaker / Pong Paddle Type game.

  • Create New Project
      1. File: New
      2. Rename Project
      3. Right-Click Cat Sprite and select Delete
  • Create Paddle
      1. Option 1 – Choose new Sprite from Library
      2. Option 2 – Paint new Sprite and name it Paddle
  • Give your Paddle Sprite Motion
      1. Events: Add when flag clicked
      2. Motion: Add go to X: 0  Y: -150
        1. Test: Move your Paddle Sprite anywhere on the Stage and then press the flag on the upper right hand of the Stage. Does your Paddle move back to the starting position?
      3. Control: Add a forever loop under the Motion command
      4. Control: Add an if/then statement inside of the forever loop
      5. Sensing: Add key space pressed? block into the if/then statement. Select the drop down menu on the key space pressed and select right arrow
      6. Motion: Add change x by 10 inside the if/then statement under the key right arrow pressed then and change 10 to 15
        1. Test: Press the flag again to reset the Paddle and press the right arrow key. Does your paddle move right?
      7. Select if/then statement and drag out of the forever loop. Select the duplicate stamp and stamp the if/then statement to create a duplicate. Drag one under the other until they attach. Drag both back into the forever loop.
      8. Select the drop down menu on key right arrow pressed in the second if/then statement, then select left arrow. Change move 15 steps to -15 steps inside of the second if/then statement.
        1. Test: Press the flag again to reset the Paddle and press the left arrow key. Does your paddle move left? Now try the right arrow key. Does that still work?
        2. Note: At any time you can use the duplicate, delete, shrink or grow an item. You can also copy Script from one Sprite to another by grabbing the Script and dragging it over the Sprite you wish to copy to.
  • File: Save Now

Now we have a Paddle that moves both left and right. Time to work on our Ball.

  • Create Ball
      1. Option 1 – Choose new Sprite from Library
      2. Option 2 – Draw new Sprite and Name it Ball
  • Give your Ball Sprite Motion
      1. Events: When flag clicked
      2. Motion: Go to X: 0  Y: 190
        1. Test: Move your Ball Sprite anywhere on the Stage and then press the flag on the upper right hand of the Stage. Does your Ball move back to the starting position?
      3. Motion: Point in direction 90 under Motion command
      4. Operators: Add pick random 1 to 10 into the point in direction, replacing the 90. Change the 1 to 10 and the 90 to 225
      5. Control: Add a forever loop under the Motion command
      6. Motion: Add move 10 steps into the forever loop and change 10 to 15
        1. Test: Press the flag again to reset the Paddle and activate the Ball. What happened to the ball? Try pushing the flag a few more times. Does the ball come down too fast? Try adding a wait 1 second Control before the forever loop. Play with the time. I like .5 seconds. How do we get the ball to bounce back?
      7. Motion: Add if on edge bounce into the forever loop under move 15 steps.
  • File: Save Now

Now we have a moving Paddle and bouncing Ball, but we need to stop the ball from going through the Paddle.

      1. Control: Add an if/then statement inside of the forever loop under the if on edge, bounce Motion
      2. Sensing: Add touching? block Select the drop down menu and select Paddle.
      3. Motion: Add point in direction 90 under touching Paddle
      4. Operators: Add pick random 1 to 10 into the point in direction, replacing the 90. Change the 1 to 90 and the 30 to -30
        1. Test: Press the flag again to reset the Paddle and activate the Ball. Use your right and left arrows to move the Paddle and stop the ball from hitting the bottom of the Stage
  • File: Save Now
  • Prepare the Backdrop and Add Sound
      1. Stage: Backdrops
      2. Add a rectangle along the bottom of the Stage
      3. Select Ball Sprite: Scripts
  • Controls: Add if/then statement inside the forever loop under the first if/then statement
  • Sensing: Add touching color? into the if/then statement. Click the square of color in the touching color? block then select the rectangle on the bottom of the Stage
  • Sound: Add play sound pop into the if/then statement under touching color? block
  • Controls: Add stop all into the if/then statement under play sound pop Sound
  • Test: Press the flag again to reset the game and try to play. Where did the sound go? Stop all ends up stopping the sound before it starts. Try placing a wait 1 second block between the play sound pop and stop all. Try playing with the time until you find one that works. I like .05. Once you find the right time, try to play the game again. Does everything work now? How could the game be better?
  • File: Save Now

If everything is working right there are a few more things we can add to make our video game more dynamic.

  • Adding a Game Over Screen
    1. Option 1 – Choose new Backdrop from Library
    2. Option 2 – Paint new Backdrop
    3. Add text and decorate the page however you would like and move back to the Script for Ball Sprite by clicking on the Ball Sprite
    4. Looks: Add switch backdrop to block in the second if/then statement in the forever loop between the play sound pop and wait .05 seconds. Select the drop down menu on the switch backdrop to block to backdrop 2
    5. Select backdrop 1 in backdrops and press the flag to see if it works. Want to hide the Ball and Paddle Sprites when the Game Over Screen comes up?
    6. Looks: Add hide block into the second if/then statement in the forever loop between switch backdrop to block and wait .05 seconds block and try again.
    7. Events: Add broadcast block into the second if/then statement in the forever loop between hide block and wait .05 seconds block. Select the drop down menu and choose new message and name the message Game Over.
    1. Select the Paddle Sprite
    2. Events: Add when I receive to the Script. Select the drop down menu and choose Game Over message
    3. Looks: Add hide block to the when I receive Game Over event

Right now the Ball and Paddle are hidden so we need to add a show command.

      1. Events: Add when space key pressed. Select the drop down menu and select space
      2. Looks: Add show block to when space key pressed
      3. Select go to X: 0  Y: -150 and drag script away from when flag clicked block and move to the when space key pressed block under show block
      4. Looks: Add hide block to when flag clicked
  • File: Save

This is the final Script for the Paddle! We want to match the start commands with the Ball, so select the Ball Sprite to change the Script and repeat the previous steps.

    1. Events: Add when space key pressed. Select the drop down menu and select space
    2. Looks: Add show block to when space key pressed
    3. Select go to X: 0  Y: 190 and drag script away from when flag clicked block and move to the when space key pressed block under show block
    4. Looks: Add hide block to when flag clicked
  • File: Save

This is the final Script for the Ball Sprite. Next we will create a title screen

  • Adding a Title Page
      1. Option 1 – Choose new Backdrop from Library
      2. Option 2 – Paint new Backdrop
      3. Add text and decorate the page however you would like. Press Script at the top of your work area next to Backdrops.
      4. Events: Add when flag clicked
      5. Looks: Add switch backdrop to block. Select the drop down menu and select the background you created for a Title screen. Mine is called Backdrop 3
      6. Controls: Add forever loop under the Looks command
      7. Controls: Add if/then statement into the forever loop
      8. Sensing: Add key pressed? block into the if/then statement
      9. Looks: Add switch backdrop to block to the if/then statement under the key pressed block. Select the drop down menu and select the game play backdrop with your rectangle at the bottom of the screen. Mine is called Backdrop 2.
        1. Test: Click the flag in the upper right hand corner of the Stage area and play your game. Does everything work? What else could we add?
  • File: Save

This is the final Script for the Backdrops. Now we can either add a score counter.

  • Adding a Score Counter
    1. Select Ball Sprite to enter Ball Sprit Script
    2. Events: Add when flag clicked
    3. Data: Select make a variable and name variable Score (make sure for all Sprites is selected) and check mark Score variable
    4. Data: Add hide variable to when flag clicked block. Select drop down menu and select Score
    5. Events: Add when key pressed block. Select drop down menu and select space.
    6. Data: Add show variable to when space key pressed. Select drop down menu and select Score
    7. Data: Add set to under set variable Score. Select drop down menu and select Score set blank number to 0
    8. Control: Add forever loop under set score to 0 block
    9. Control: Add if/then statement inside forever loop
    10. Sensing: Add touching? block to if/then statement. Select drop down menu and select Paddle
    11. Data: Add change by block to if/then statement under touching paddle? block. Select drop down menu and select Score and set blank number to 1
]]>