0% found this document useful (0 votes)
105 views26 pages

Lecture 5: Legend of Zelda: Colton Ogden [email protected] - Edu David J. Malan Malan@harvard - Edu

This document summarizes topics from Lecture 5 of the GD50 course including: - Top-down perspective and infinite dungeon generation in Legend of Zelda games - Hitboxes, hurtboxes, and event-driven programming - Screen scrolling and stenciling techniques - Data-driven game design using tables to define enemy properties and behaviors - Resources for NES homebrew programming and a Super Mario Bros disassembly - Details an assignment to add enemy drops, breakable pots, and pot throwing to the game

Uploaded by

Aryan Gupta
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
105 views26 pages

Lecture 5: Legend of Zelda: Colton Ogden [email protected] - Edu David J. Malan Malan@harvard - Edu

This document summarizes topics from Lecture 5 of the GD50 course including: - Top-down perspective and infinite dungeon generation in Legend of Zelda games - Hitboxes, hurtboxes, and event-driven programming - Screen scrolling and stenciling techniques - Data-driven game design using tables to define enemy properties and behaviors - Resources for NES homebrew programming and a Super Mario Bros disassembly - Details an assignment to add enemy drops, breakable pots, and pot throwing to the game

Uploaded by

Aryan Gupta
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 26

GD50

Lecture 5: Legend of Zelda


Colton Ogden
[email protected]

David J. Malan
[email protected]
Topics

● Top-Down Perspective
● Infinite Dungeon Generation
● Hitboxes/Hurtboxes
● Events
● Screen Scrolling
● Data-Driven Design
But first, a demo!
Our Goal
Top-Down Perspective
Dungeon Generation

http://tartarus.rpgclassics.com/zelda1/1stquest/dungeonmaps.shtml
Hitboxes/Hurtboxes
Events

● An event is registered to trigger via some name, implemented


via an anonymous function.
● Something in the game warrants the event being triggered, or
“dispatched”.
● The anonymous callback function tied to the Event, the
handler, is passed arguments via the event’s dispatch.
Event library: functions

● Event.on(name, callback)
○ Calls `callback`, which is a function, whenever the message by its `name` is
dispatched via `Event.dispatch`.
● Event.dispatch(name, [params])
○ Calls the callback function registered to `name`, set by `Event.on`, with
some optional `params` that will be sent to that callback function as
arguments.

https://github.com/airstruck/knife/blob/master/readme/event.md
Screen Scrolling
Stenciling
Stenciling functions

● love.graphics.stencil(func, [action], [value], [keepvals])


○ Performs all stencil drawing within `func`; anything drawn during that time
will act as the stencil pixels during `love.graphics.setStencilTest`.
`action` defines how those pixels will behave with pixels drawn onto them
during `love.graphics.setStencilTest`, while `value` is the value `action`
is reliant upon.
● love.graphics.setStencilTest(compare_mode, compare_value)
○ Compares pixels drawn via `compare_mode` with that of `compare_value`, only
drawing pixels whose result of this mode is true.
Game Design via Data

['goblin'] = {
health = 10,
strength = 2,
texture = 'goblin',
animations = {
['idle'] = {
frames = {1},
interval = 1
},
['walking-left'] = {
frames = {2, 3, 4, 2},
interval = 0.2
}
},
weapon = 'club',
aggressive = true,
sleepsAtNight = true,
flammable = true
}
NES Homebrew

● http://wiki.nesdev.com/w/index.php/Nesdev_Wiki
● http://wiki.nesdev.com/w/index.php/Programming_guide
● http://wiki.nesdev.com/w/index.php/Installing_CC65
Super Mario Bros. Disassembly

https://gist.github.com/1wErt3r/4048722
Assignment 5

● Make some enemies drop hearts randomly, which heal the


player for 2 damage (one whole heart).
● Allow the player to lift pots (using the animation included in
the sprite sheet).
● Pots should stick to the player while they are carrying them,
and their walking animations should change while carrying.
● Allow the player to throw pots and damage enemies. If it hits a
wall, an enemy, or travels farther than four tiles, destroy it.
Next Time...

https://opengameart.org/content/physics-assets
See you next time!

You might also like