Skip to content

Instantly share code, notes, and snippets.

Avatar

SeanFelipe

View GitHub Profile
View pacman_maze_1.py
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))
View helpers.py
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 Apr 21, 2019
ReactJS And Two.js Path Rotation Exploration
View index.pug
.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.
View libgdx_jruby_plain_binding_pry.rb
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 Dec 17, 2017
breakpointing JRuby Libgdx code
View libgdx_jruby_breakpointing.rb
require_relative 'imports' # LibGDX class java_imports
require 'pry-debugger-jruby'
class MainGame < ApplicationAdapter
def create
#binding.pry
breakpoint
Gdx::graphics::setContinuousRendering(false)
View mwali
AwRdrn8ws68jzqvWU8GYYzWRGVUgaQDmtjRa4V
View Particles3dExample.scala
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
View prompt stuffs
~/work/lagunitas $ echo $PS1
\[\033[0;30;33m\]\w\[\e[0m\] $
View cb_screen_models.rb
# 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")