Skip to content

Instantly share code, notes, and snippets.

View topherPedersen's full-sized avatar
💭
Rolling my katamari ball

Christopher Pedersen topherPedersen

💭
Rolling my katamari ball
View GitHub Profile
@topherPedersen
topherPedersen / animatedDuck.py
Created July 18, 2018 20:10
Simple Animation in Python using the 2D Turtle Graphics Module
# Launch Window using Turtle Graphics/Tkinter
import turtle
screen = turtle.Screen()
screen.setup(635, 355)
# Create Turtle Object
myTurtle = turtle.Turtle()
# Add Background
screen.bgpic("DuckHuntBackgroundBlank.jpg")
@topherPedersen
topherPedersen / objectOrientedSprite.py
Last active July 18, 2018 20:17
Object Oriented Sprite Example in Python using the Turtle Graphics Library
# Example of how to create a player sprite object that inherits from the object
# turtle.Turtle in Python using the 2D Turtle Graphics Module. Code posted to
# my personal github for reference teaching students at theCoderSchool in
# Flower Mound, TX
# Launch Window using Turtle Graphics/Tkinter
import turtle
screen = turtle.Screen()
screen.setup(635, 355)
@topherPedersen
topherPedersen / GallopingUnicorn.py
Created July 19, 2018 20:24
Obstacle Avoidance Game Written in Python using Turtle Graphics
# *************************************************************************
# GallopingUnicorn.py
# Copyright (c) 2018 Christopher Pedersen, All Rights Reserved
# *************************************************************************
# This is free and unencumbered software released into the public domain.
# Anyone is free to copy, modify, publish, use, compile, sell, or
import math
import random
# Launch Window using Turtle Graphics/Tkinter
import turtle
screen = turtle.Screen()
screen.setup(635, 355)
# Add Background
screen.bgpic("DuckHuntBackgroundBlank.jpg")
@topherPedersen
topherPedersen / DetectInputMoveSprite.swift
Last active July 22, 2018 19:05
Simple iOS App Written in Swift Demonstrating How to Detect User Input (screen tap) and Move a Player Sprite
// NOTE: This gist is comprised of two swift files, GameScene.swift and GameViewController.swift
//
// GameScene.swift
// HelloSpriteKit
//
// Created by Christopher Pedersen on 7/8/18.
// Copyright © 2018 Christopher Pedersen. All rights reserved.
//
@topherPedersen
topherPedersen / SimplePong.py
Last active July 23, 2018 03:23
Simple Pong Game in ~100 lines by Peter Kwak
# Pong by Peter Kwak (Edited by Chris Pedersen)
# This is free and unencumbered software released into the public domain.
# For more information, please refer to <http://unlicense.org/>
import turtle
# Create Game Window
screen = turtle.Screen()
screen.setup(500, 400)
screen.bgcolor("black")
@topherPedersen
topherPedersen / Magic8Ball.py
Last active July 23, 2018 03:24
Command-line Version of Magic 8 Ball
# Magic 8 Ball by Chris Pedersen
# This is free and unencumbered software released into the public domain.
# For more information, please refer to <http://unlicense.org/>
import random
# Greet the User
print("Welcome to Magic 8 Ball!")
# Create Game Loop
@topherPedersen
topherPedersen / duckhunt.py
Last active July 25, 2018 13:22
Duck Hunt Clone written in Python using the 2D Turtle Graphics Module
# Duck Hunt by Chris Pedersen
# This is free and unencumbered software released into the public domain.
# For more information, please refer to <http://unlicense.org/>
import math
import random
# Launch Window using Turtle Graphics/Tkinter
import turtle
screen = turtle.Screen()
@topherPedersen
topherPedersen / emptyLandscape.html
Last active July 25, 2018 17:25
How to create an empty landscape in Babylon.js (HTML5 Game Development)
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html" charset="utf-8"/>
<title>Babylon - Getting Started</title>
<!--- Link to the last version of BabylonJS --->
<script src="https://cdn.babylonjs.com/babylon.js"></script>
<style>
html, body {
overflow: hidden;
@topherPedersen
topherPedersen / BabylonJSDemo.html
Last active July 25, 2018 18:29
Babylon.JS Demo (Create a player sprite and empty landscape. Includes game controls to move player sprite)
<!DOCTYPE html>
<!--
Babylon.js Demo by Peter Kwak and Christopher Pedersen at theCoderSchool
in Flower Mound, TX for use teaching our introductory programming students.
This tutorial was created to demonstrate how our students favorite game,
www.ShellShock.io was created using JavaScript and the Babylon.js library.
This is free and unencumbered software released into the public domain.
For more information, please refer to <http://unlicense.org/>
-->