You are on page 1of 5

DEPARTMENT OF COMPUTERSCIENCE&ENGINEERING

GITAM INSTITUTE OF TECHNOLOGY


GITAM (Deemed to be University)
Degree B. Tech. Course CSE Semester VIII CIE Mid-I
Course ECS 442 Course Name Game Programming Category& PE&3:0:0:3 Max. 30
Code Credits Marks
Date 05-03-2020 Portion for Modules 2,3 Term Nov2019 to Time 10:30AM to
Exam April2020 12:00 Noon
Answer ALL Questions
1. (a) Apply with a Java Codes for “ The Applet play() method loads a sound (perhaps from across the network)
and plays it once”?2M
import java.applet.Applet; import java.awt.*;
public class OldMcDonald extends Applet { public void init() { play( getCodeBase(), "McDonald.mid"); }
public void paint(Graphics g) { g.drawString("Older McDonald", 25, 25); }
} // end of OldMcDonald class
[This question relates to Co2 Understand the Various Imaging and Visual effects
Explaining[L2]]
(b) Build a Audio I/O to/from the mixer?2M
[This question relates to Co2 Understand the Various Imaging and Visual effects
Implementing[L2]

(c) Recall “Collision processing can be split into two basic categories”?2M
Collision processing can be split into two basic categories: collision detection and collision response,
with the range of responses being application speci
[This question relates to CO2 Co2 Understand the Various Imaging and Visual effects Implementing
(L2)]
(d) Develop a Java Code for ” headTowardsTourist() rotates the sprite then attempts to move it forward”? 2M
[This question relates to Co3 Analyze the Isometric tile Games and 3D sprites Implement[L4]

private void headTowardsTourist() { double rotAngle = calcTurn( getCurrLoc(), ts.getCurrLoc()); double


angleChg = rotAngle-currAngle; doRotateY(angleChg); // rotate to face tourist currAngle = rotAngle; // store
new angle for next time if (moveForward()) ; else if (moveLeft()) ;
www.it-ebooks.info
This is the Title of the Book, eMatter Edition
The Alien Sprite | 501
else if (moveRight()) ; else if (moveBackward()) ; else System.out.println("Alien stuck!"); }

2. (a) Develop a Class diagrams for JumpingJack?6M


[This question relates to Co2 Understand the Various Imaging and Visual effects Summarize[L2]

(b) Summarize “BricksManager is separated into five broad groups of methods”? 4M


Loading bricks information. • Initializing the bricks data structures. • Moving the bricks map. • Drawing the
bricks. • JumperSprite-related tasks
[This question relates Co2 Understand the Various Imaging and Visual effects Summarize (L2)]

Loading bricks information. • Initializing the bricks data structures. • Moving the bricks map. • Drawing the bricks.
• JumperSprite-related tasks. These are mostly various forms of collision detection between the sprite and the bricks
(OR)
3. (a) Model a Class diagram for “ AlienTiles”?6M
[This question relates to Co2 Understand the Various Imaging and Visual effectsSummarize [L2]
(b) Compare DirectX or OpenGL? 4M
[This question relates to CO2Understand the Various Imaging and Visual effects Summarize[L2]
Often, the debate about which version of Java 3D is better is a debate about the relative merits of DirectX Graphics
and OpenGL. In most technical areas, DirectX Graphics and OpenGL are almost equivalent since both are based on
the same graphics pipeline architecture and ideas flow between the two. The most significant differences between
the two APIs are unrelated to their functionality. OpenGL is ported to a wide range of platforms and OSs, and
DirectX is limited to PCs running Windows and the Xbox. DirectX is controlled by Microsoft alone, and the
OpenGL Architecture Review Board (ARB) allows input from many partners. The Direct X Graphics version of
Java 3D is only available for Windows, where some users report that it’s marginally faster than the OpenGL
implementation. However, I’ve never noticed any difference when I’ve tried both systems. The future seems
brightest for the OpenGL version, which is the main focus of the current “bug fix” release of Java 3D, Version
1.3.2. I’ll use the stable OpenGL version (1.3.1) in the rest of this book. It can be downloaded from
http://java.sun.com/ products/java-media/3D/, together with ample documentation and a long tutorial.

4. (a) Illustrate a Class Diagrams for Checkers3D? 6M


[This question relates toCO2 Understand the Various Imaging and Visual effects Implement[L2]
(b) Develop constructor for WrapCheckers3D ? 4M
[This question relates to CO3: Analyze the Isometric tile Games and 3D sprites Implement[L4]
public WrapCheckers3D() { // other code su = new SimpleUniverse(canvas3D);
j3dTree = new Java3dTree(); // create a display tree for the SG
createSceneGraph(); initUserPosition(); orbitControls(canvas3D); su.addBranchGraph( sceneBG );
j3dTree.updateNodes( su ); // build the tree display window
}
(OR)
5. (a) Build a Java Program for calcScaleFactor()? 6M
[This question relates to CO3Analyze the Isometric tile Games and 3D sprites Implement [L4])
private Vector3d calcScaleFactor(BranchGroup loadedBG) { BoundingBox boundbox = new
BoundingBox( loadedBG.getBounds() );
Figure 16-7. Righthand, positive rotation for the x-axis
x+
y+
z+
// obtain the upper and lower coordinates of the box Point3d lower = new Point3d(); boundbox.getLower( lower );
Point3d upper = new Point3d(); boundbox.getUpper( upper );
// calculate the maximum dimension double max = 0.0; if( (upper.x - lower.x ) > max ) max = (upper.x -
lower.x );
if( (upper.y - lower.y ) > max ) max = (upper.y - lower.y );
if( (upper.z - lower.z ) > max ) max = (upper.z - lower.z );
double scaleFactor = 10.0/max;
// limit the scaling so that a big model isn't scaled too much if( scaleFactor < 0.0005 ) scaleFactor = 0.0005;
return new Vector3d(scaleFactor, scaleFactor, scaleFactor); } // end of calcScaleFactor()
(b) Develop a Java Code for to create lathe shapes ? 4M
[This question relates to CO3 Analyze the Isometric tile Games and 3D sprites Implement[L4]
TextureLoader texLd10 = new TextureLoader("textures/swirled.jpg", null); Texture
swirledTex = texLd10.getTexture();
double xsIn2[] = {-0.001, -0.7, -0.25, 0.25, 0.7, -0.6, -0.5}; double ysIn2[] = { 0, 0, 0.5,
1, 2.5, 3, 3}; LatheShape3D ls3 = new LatheShape3D( xsIn2, ysIn2, swirledTex);
displayLathe(ls3, -1.0f, -5.0f, "cup");

Please access the solutions and scheme on G-learn from 10-03-2020

You might also like