Lecture 3: Blocks 1 TEALS MINECRAFT PROJECT. MINECRAFT BLOCKS Blocks form the terrain & buildings in the Minecraft world. Blocks can change appearance,

Slides:



Advertisements
Similar presentations
Objects. 2 Object Oriented Programming (OOP) OOP is a different way to view programming Models the real world A different view than Structured programming.
Advertisements

David Notkin Autumn 2009 CSE303 Lecture 13 This space for rent.
Programming with Alice Computing Institute for K-12 Teachers Summer 2011 Workshop.
SE 313 – Computer Graphics Lecture 13: Lighting and Materials Practice Lecturer: Gazihan Alankuş 1.
Week 9: Methods 1.  We have written lots of code so far  It has all been inside of the main() method  What about a big program?  The main() method.
CS150 Project Checkpoint 2 CheckPt2 is easy!!! BUT………………. This lab can be very tricky. BUT……………… Mark is here to help! You get to listen to cool.
Light Sensor By Uzair Aakhoon Checked by Talal. Introduction  In this presentation I am going to be explaining what is a Light sensor, how it is used.
Games and Simulations O-O Programming in Java The Walker School
Learning to program using Minecraft. Learning Objective Know what Minecraft is and to explain some of it’s uses Build a simple house in creative mode.
Inheritance using Java
By Chris from “Mikeandchris.jimdo.com”. Minecraft is a sandbox game developed in Sweden. It was originally only on the computer, but has since been put.
Chapter 4 Objects and Classes.
Making a Timer in Alice.
XP New Perspectives on Microsoft Office Access 2003 Tutorial 11 1 Microsoft Office Access 2003 Tutorial 11 – Using and Writing Visual Basic for Applications.
March 31, 2000CS102-01Lecture 1.3 Introduction to Object-Oriented Programming CS Lecture 1-3.
Copyright © 2015 – Curt Hill Minecraft Blocks Properties and Methods.
EEC-693/793 Applied Computer Vision with Depth Cameras Lecture 13 Wenbing Zhao
Changing Camera Views! Part 2: Simple Scene Change & Lighting Fixes By Bella Onwumbiko under the direction of Professor Susan Rodger Duke University July.
U9A2 Intro to Current Electricity (Part Deux). Part 1: Role of Battery in Circuit (Take 2) We need a model for the battery: Using the virtual circuit,
Copyright © Curt Hill Sounds, Resource Packs, JSON What more would you want?
Web Games Programming An Introduction to Unity 3D.
Behavior Programming. Structured Programming A series of if-thens Easy to get started in and hardly requires any thought or design beforehand But the.
How to use the timing feature Click to choose a shape, then click on the screen and drag it to place in on the slide.
CPS120: Introduction to Computer Science Lecture 14 Functions.
Game Maker – Getting Started What is Game Maker?.
Minecraftology By Lauren.
Module 13 Animations in WPF. Module Overview Using Animations Using Triggers Implementing Data Visualizations.
Class Builder Tutorial Presented By- Amit Singh & Sylendra Prasad.
1 Programming 2 Aims Give overview of concepts addressed in Web based programming module Teach you enough Java to write simple web and network applications.
The If Block. IF The “if” block can be found in the control tab. The if block means, “IF this happens, THEN do this.” You can put blocks ON the if block.
An Advanced Code Pattern: Inner Classes CSE301 University of Sunderland Harry R. Erwin, PhD Half Lecture.
Application development with Java Lecture 21. Inheritance Subclasses Overriding Object class.
Georgia Institute of Technology More on Creating Classes part 1 Barb Ericson Georgia Institute of Technology Oct 2005.
INSTRUCTIONS 1. Click SAVE AS – “NAME’s user name Info Book” 2. Type all of your information first, paying careful attention to what goes where. These.
Java Programming Final Keyword In Java. final keyword The final keyword in java is used to restrict the user. The final keyword can be used in many context.
COMP 110 Designing and overloading methods Luv Kohli November 3, 2008 MWF 2-2:50 pm Sitterson 014.
Recipes How to craft items from others Copyright © 2015 Curt Hill.
Structured Programming Dr. Atif Alhejali Lecture 4 Modifiers Parameters passing 1Structured Programming.
Object Oriented Programming in Java Habib Rostami Lecture 10.
 ASP.NET provides an event based programming model that simplifies web programming  All GUI applications are incomplete without enabling actions  These.
Adding Sounds Games Programming in Scratch. Games Programming in Scratch L6 Adding Sounds Learning Objectives Learn how to add sound to a Scratch game.
TEALS MINECRAFT PROJECT Lecture 1: Intro to Minecraft Forge.
UFCFSU-30-13D Technologies for the Web An Introduction to Unity 3D.
SNIPING TUTORIAL – BY TMAN THE IDEA: The objective of this tutorial is to create a sniping effect. To create the sniping effect you need to create a scope.
Lecture 6: Basic Entities TEALS MINECRAFT PROJECT.
Creating an Object that can draw itself The paint method can ‘draw’ because it is passed a graphics environment as a parameter. If a class method is passed.
Georgia Institute of Technology More on Creating Classes Barb Ericson Georgia Institute of Technology June 2006.
Liang, Introduction to C++ Programming, (c) 2007 Pearson Education, Inc. All rights reserved X 1 Chapter 9 Introduction of Object Oriented Programming.
Game Maker Tutorials Introduction Clickball IntroductionClickball Where is it? Shooting Where is it?Shooting.
Chapter 5 Introduction to Defining Classes Fundamentals of Java.
Scratch Animated Greeting Cards.
Chapter 4 - Finishing the Crab Game
3GB3 Game Design Unity 3D Basics.
Review What is an object? What is a class?
Lecture 5: Some more Java!
TEALS Minecraft Project
TEALS Minecraft Project
Interfaces.
Functions BIS1523 – Lecture 17.
Advanced Programming Behnam Hatami Fall 2017.
Recitation 7 October 7, 2011.
TEALS Minecraft Project
Tonga Institute of Higher Education
Class Diagram.
More on Creating Classes
TEALS Minecraft Project
Week 1 - Introduction and Objects
It is about the Minecraft Turn Around in a Cave.
Chapter 11 Inheritance and Encapsulation and Polymorphism
Presentation transcript:

Lecture 3: Blocks 1 TEALS MINECRAFT PROJECT

MINECRAFT BLOCKS Blocks form the terrain & buildings in the Minecraft world. Blocks can change appearance, trigger actions, spawn other blocks, and perform many other behaviors in game.

MINECRAFT Block OBJECTS All blocks extend the Minecraft Block class. Blocks are created once, but have methods that are called with parameters x, y and z (the location in the Minecraft world) when something happens to that location.

Block PROPERTIES Texture(s) Visible to the user looking at the block. parentMod.blockRegistry.newInstance(texture, newBlock, name) Material Determines sounds and other properties. Defined inside the block constructor. Blast Resistance How much resistance to nearby explosions from creepers or TNT. setResistance(float level), where level is a value from 1 to infinity. Luminance How much light the block emits. setLightLevel(float light), where light is a level from 0 to 1.

Block PROPERTIES (CONT.) Hardness How long it takes to mine the block. setHardness(float hardness), usually 0 to 5, occasionally higher. Creative Tab Location in the creative inventory of the block. setCreativeTab(CreativeTabs.someTab) Step Sound The noise the block makes when you walk over it. setStepSound(Block.soundTypeSomething)

BASIC BLOCK TYPES A big honkin' table of Minecraft block types… (from Minecraft.gamepedia.com)

BLOCK EXAMPLE Block Class package tealsmc.mods; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.init.Blocks; import net.minecraft.world.World; public class BasicBlock extends Block { public BasicBlock (Material material) { super (material); // Pass on material to base class. setCreativeTab (CreativeTabs.tabBlock); // Blocks tab. setLightLevel (1.0f); // Very bright. } public void onBlockAdded (World world, int x, int y, int z) { // Whenever this block is placed in world, add a stone block on top of it. world.setBlock (x, y+1, z, Blocks.stone); } }

BLOCK EXAMPLE Module Class package tealsmc.mods; import org.tealsk12.tealsmodloader.module.Module; public class BlocksModule extends Module { // This class registers all custom block types. public void onLoad() { // Register all custom blocks. parentMod.blockRegistry.newInstance ( "basic_block", new BasicBlock(Material.rock), "Basic"); } }

LAB 3: CUSTOM BLOCKS Let's make some blocks!