Skip to content

Instantly share code, notes, and snippets.

View SeanFelipe's full-sized avatar

SeanFelipe

View GitHub Profile
import pygame
from pygame.transform import scale2x
screen = pygame.display.set_mode((300,300))
spritesheet = pygame.image.load('spritesheet.png')
pacman_right = scale2x(spritesheet.subsurface(455, 0, 16, 16))
pacman_left = scale2x(spritesheet.subsurface(455, 16, 16, 16))
pacman_up = scale2x(spritesheet.subsurface(455, 32, 16, 16))
pacman_down = scale2x(spritesheet.subsurface(455, 48, 16, 16))
import pygame
from pygame.transform import scale2x
screen = pygame.display.set_mode((1024,768))
spritesheet = pygame.image.load('spritesheet.png')
MOVE_INCREMENT = 4
pacman_right = scale2x(spritesheet.subsurface(455, 0, 16, 16))
pacman_left = scale2x(spritesheet.subsurface(455, 16, 16, 16))
import pygame
def start(res):
return pygame.display.set_mode(res)
def loop():
running = True
while running:
for e in pygame.event.get():
if e.type == pygame.QUIT:
@SeanFelipe
SeanFelipe / index.pug
Created April 21, 2019 19:36
ReactJS And Two.js Path Rotation Exploration
.row.align-center
.column.small-12.medium-8.large-6
h1 Two.js: Rotate A Path Around A Fixed Point
.mount.js-mount
.row.align-center
.column.small-12.medium-8.large-6
p Rotating paths in two.js around a point requires each vertex in a path's `vertices` property to be <strong>offset</strong> the same distance away from an origin.
require_relative 'imports'
#require 'pry-debugger-jruby'
require 'pry'
class MainGame < ApplicationAdapter
def create
binding.pry
Gdx::graphics::setContinuousRendering(false)
@SeanFelipe
SeanFelipe / libgdx_jruby_breakpointing.rb
Last active December 17, 2017 18:53
breakpointing JRuby Libgdx code
require_relative 'imports' # LibGDX class java_imports
require 'pry-debugger-jruby'
class MainGame < ApplicationAdapter
def create
#binding.pry
breakpoint
Gdx::graphics::setContinuousRendering(false)
AwRdrn8ws68jzqvWU8GYYzWRGVUgaQDmtjRa4V
package kbn.libgdx
import com.badlogic.gdx.{ Gdx, ApplicationAdapter }
import com.badlogic.gdx.graphics.{ GL20, PerspectiveCamera }
import com.badlogic.gdx.graphics.g3d.ModelBatch
import com.badlogic.gdx.graphics.g3d.particles.{
ParticleEffect, ParticleSystem, ParticleEffectLoader
}
import com.badlogic.gdx.graphics.g3d.particles.batches.PointSpriteParticleBatch
import com.badlogic.gdx.assets.AssetManager
@SeanFelipe
SeanFelipe / prompt stuffs
Created April 29, 2015 22:49
prompt stuffs
~/work/lagunitas $ echo $PS1
\[\033[0;30;33m\]\w\[\e[0m\] $
# Pages can be defined like so:
LoginScreen < ScreenModel
element :email, "et_email"
element :password, "et_pw"
element :login_button, "btn_login"
end
# and called in step definitions like so
Then(/^I enter my email and password and press the login button$/) do
LoginScreen.email.type("foo@bar.com")