Skip to content

Instantly share code, notes, and snippets.

View DanBradbury's full-sized avatar

Dan Bradbury DanBradbury

View GitHub Profile
@DanBradbury
DanBradbury / ep3.md
Last active August 29, 2015 14:04
Episode 3: Sprites sprites sprites

##Basics of Working with Sprites In order to get the most out of Sprites we will undoubtedly want to add some animation and control to bring our objects to life.

In this episode we will take a look at the core of sprite control within Objects. We will also take a look at working with sprite sheets and using the built in Sprite Editor tool.

We will start with a single sprite spr_player that we control from a top down perspective through our obj_payer. Even though the player is moving around in the room we want to sync up some animation with the players input.

In order to do this we need to add the appropriate sprites for each of the movements that we will be using in our object. Luckily artists have given us the sprite sheet which is a clever way to shove all the relevant sprites we need onto 1 image.

For this project we will be using the artwork for the Liberated Pixel Cup and because we want

MOVE_SPEED = 4;
WALK_SPEED = 10;

if(keyboard_check(vk_up)){
 y -= MOVE_SPEED;
@DanBradbury
DanBradbury / ep4.md
Last active August 29, 2015 14:04
ep4 Parallax

Parallax Backgrounds

In any side scroller you are going to see the Parallax Scrolling effect. This effect was (in my mind) huge for castle crawl games like Castlevania that would utilize it on any window or open scenery to immerse the player in a subtle way. The first appearances of Parallax scrolling can be traced to 1982 in a game called Moon Patrol (video link) and has been used in many games since.

For the purposes of this episode we are going to create a simple sprite based Parallax Scrolling effect.

We will use these 2 backgrounds: Background 1 & Background 2 to create the following basic effect:

@DanBradbury
DanBradbury / ep4Notes.md
Last active August 29, 2015 14:04
ep4 notes
ac = ActiveRecord::Base.connection.execute("SELECT advertiser_id, id_from_network, name FROM advertiser_campaigns WHERE advertiser_id=1 ").first
ad = ActiveRecord::Base.connection.execute("SELECT id_from_network, name FROM advertisers WHERE id=#{ac[0]}").first
affiliate_id = 1
af = ActiveRecord::Base.connection.execute("SELECT id_from_network, name, commissions_ranking,call_volume_ranking, conversion_rate_ranking FROM affiliates WHERE id=#{affiliate_id}").first
dnpr_id = DynamicNumberPoolReferrer.last.id
@DanBradbury
DanBradbury / .vimrc
Last active August 29, 2015 14:04
My Dotfiles
set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
"
" " let Vundle manage Vundle, required
Plugin 'gmarik/vundle'
Plugin 'lsdr/monokai'

In today's episode we are going to create a pause effect that can be easily implemented into any game you may be working on. For this example we are going to build off of a minimalistic side scroller with only a few active objects.

Source code hosted on Github (pull, fork, or whatever you would like).

To implement the effect we will have o_player (this would be any control object in your game), trigger an event that creates o_pause which will handle all the logic for the effect.

o_player is the easiest part to implement so we should just take care of it first.

@DanBradbury
DanBradbury / e6Notes.md
Created August 18, 2014 04:27
ep6Notes
"arg = \"rr_dev-pc_TECH-337_gemify_models\""
"arg = \"rr_test-pc_TECH-337_gemify_models-default\""
"arg = \"rr_test-pc_TECH-337_gemify_models-sample_data\""
"arg = \"rr_test-pc_TECH-337_gemify_models-sample_data\""
"arg = \"rr_dev-pc_TECH-337_gemify_models\""
"arg = \"rr_test-pc_TECH-337_gemify_models-default\""
"arg = \"rr_test-pc_TECH-337_gemify_models-sample_data\""
Loaded suite organization_membership_test
Started
Error loading Marshal file /Users/danielbradbury/Documents/Invoca/web/test/fixturesdefault.marshal: No such file or directory @ rb_sysopen - /Users/danielbradbury/Documents/Invoca/web/test/fixturesdefault.marshal