...
 
Commits (3)
baseURL = "https://cs.ksu.edu/~nhbean/cis580/"
baseURL = "https://cs.ksu.edu/~nhbean/cis580"
languageCode = "en-us"
title = "K-State CIS 580 Textbook"
......
+++
title = "CIS 580 Textbook"
date = 2020-03-21T10:53:05-05:00
title = "Homepage"
date = 2020-03-20T10:53:05-05:00
+++
# K-State CIS 580 - Foundations of game Programming Textbook
# Foundations of Game Programming
This is an open textbook written for the <b>Kansas State University CIS 580 - Foundations of Game Programming</b> course.
......
......@@ -2,9 +2,8 @@
title: "Introduction"
pre: "1. "
weight: 1
date: 2018-08-24T10:53:26-05:00
date: 2020-03-20T10:53:05-05:00
---
Particle engines leverage thousands of very small sprites to create the illusion of fire, smoke, explosions, precipitation, waterfalls, and many other interesting effects. They are a staple in modern game engines both to create ambience (i.e. fires and smoke) and to enhance gameplay (glowing sparkles around objects that can be interacted with). In this section, we'll discuss the basics of how particle engines work, and iteratively build a particle engine in MonoGame that can be used in your own games.
Particle systems leverage thousands of very small sprites to create the illusion of fire, smoke, explosions, precipitation, waterfalls, and many other interesting effects. They are a staple in modern game engines both to create ambience (i.e. fires and smoke) and to enhance gameplay (glowing sparkles around objects that can be interacted with). In this section, we'll discuss the basics of how particle engines work, and iteratively build a particle system in MonoGame that can be used in your own games.
I've prepared a starter project in which we will build this engine. Feel free to clone it from GithHub, here:
// TODO: GitHub link
\ No newline at end of file
I've prepared a starter project in which we will build this particle system. Feel free to clone it from GithHub, here: [https://github.com/ksu-cis/particle-system-starter](https://github.com/ksu-cis/particle-system-starter)
\ No newline at end of file
......@@ -2,7 +2,7 @@
title: "The Particle Structure"
pre: "2. "
weight: 2
date: 2018-08-24T10:53:26-05:00
date: 2020-03-20T10:53:05-05:00
---
At the heart of a particle engine is a collection of particles - tiny sprites that move independently of one another, but when rendered together, create the interesting effects we are after. To draw each individual particle, we need to know where on the screen it should appear, as well as the texture we should be rendering, and any color effects we might want to apply. Morever, each frame our particles will be moving, so we'll also want to be able to track information to make that process easier, like velocity, acceleration, and how long a particle has been "alive".
......
......@@ -2,7 +2,7 @@
title: "The Particle System Class"
pre: "3. "
weight: 3
date: 2018-08-24T10:53:26-05:00
date: 2020-03-20T10:53:05-05:00
---
The next part of the particle system is the class representing the particle system itself. Go ahead and create a new class file, _ParticleSystem.cs_ and define a `ParticleSystem` class in it:
......
......@@ -2,7 +2,7 @@
title: "Using the Particle System"
pre: "4. "
weight: 4
date: 2018-08-24T10:53:26-05:00
date: 2020-03-20T10:53:05-05:00
---
To use our particle system, we'll need to create one in our `Game1` class in our _Game1.cs_ file. Let's start by adding a private field to hold a reference to one:
......
......@@ -2,7 +2,7 @@
title: "Implementing Delegates"
pre: "5. "
weight: 5
date: 2018-08-24T10:53:26-05:00
date: 2020-03-20T10:53:05-05:00
---
While we have a working particle system, it's not very flexible. There are a number of approaches we can use to add some flexibility to it. Let's start by thinking about what will change between different particle systems. Let's think through a couple of examples:
......@@ -141,5 +141,3 @@ Also note how we no longer need the `Emitter` property - we can now set the spaw
We also are using MonoGame's [MathHelper.Lerp](https://docs.microsoft.com/en-us/previous-versions/windows/silverlight/dotnet-windows-silverlight/bb197816(v%3Dxnagamestudio.35)) method to linearly interpolate our random value between 0 and 1 to the ranges [-50, +50] and [0, 100]. There are many such helpful methods packed into the [MathHelper](https://docs.microsoft.com/en-us/previous-versions/windows/silverlight/dotnet-windows-silverlight/bb197892(v=xnagamestudio.35)) class.
Try running the game now. See how different our particle system behaves based on a few changes? By moving the spawning and updating functionality to delegates, we can quickly modify each particle system we create to meet our needs.
Next, let's look at how we can define a few commonly-used particle system effects quickly.
\ No newline at end of file
---
title: "Standard Particle Systems"
pre: "6. "
weight: 6
date: 2020-03-21T10:53:05-05:00
---
+++
title = "Particle Engines"
date = 2018-08-24T10:53:05-05:00
weight = 60
title = "Particle Systems"
date = 2020-03-20T10:53:05-05:00
weight = 10
chapter = true
+++
### Game Development Techniques
# Particle Engines
# Particle Systems
One, Two, three, ... BOOM!
\ No newline at end of file
......@@ -2,4 +2,5 @@
git pull --recurse-submodules
hugo
rsync -az public/ nhbean@cslinux.cs.ksu.edu:public_html/cis580
exit 0