Skip to content

Instantly share code, notes, and snippets.

View wkta's full-sized avatar

moonbak ♤ wkta

View GitHub Profile
@wkta
wkta / essai-pve0.py
Created June 16, 2023 19:26
explication exemple pve
import pyved_engine as pve
pve.init(1, maxfps=120) # initialise avec la taille de fenetre standard
# 1 représente la valeur de "upscaling" --> x1 donc sans upscaling
#
# maxfps ne sera pas utilisé AUTOMATIQUEMENT, sauf si on utilise la
# classe pve.GameTpl ...
# Dans cet exemple, on l'utilise pas donc faut utiliser sa propre "clock"
# dans tous les cas:
@wkta
wkta / katasdk-pathfinding-demo.py
Last active September 13, 2022 22:55
use pip install katasdk before running this one
import katagames_sdk as katasdk
kengi = katasdk.kengi
kengi.init(2, caption='demo-pathfinding uses kengi')
pygame = kengi.pygame
# constants
MAP_DIM = (14, 9)
BG_COLOR = 'antiquewhite2'
COLOR_PALETTE = {
0: (144, 105, 151),
1: (53, 25, 25)
@wkta
wkta / TextBlock_test.py
Last active March 11, 2022 10:15
example to show how one can manage text blocks (->GUI building) in a convenient way
"""
how can we manage text blocks (->GUI building) in a convenient way?
This may be an answer. Contributors: .wkta-tom#7412 | S_P_Y#1331
"""
import pygame
def create_txtblock_surf(text, ft_obj, color=(0, 0, 0), bg_color=(255, 255, 255), alignment_f=0.0, debug=0):
"""
goal = to produce a pygame surface
@wkta
wkta / TECH-DEMO1.py
Last active October 7, 2021 16:14
Kata Engine xxx Tech-demo1 (asteroids-like)
# TECH-DEMO1.py | revision: oct.07 - 2021
# showcases how the Kata engine works
# (tested with v0.0.6)
# Visit https://kata.games to learn more!
# source-code by "wkta-tom" | MIT License
# https://github.com/wkta
# thomas@gaudia-tech.com
@wkta
wkta / keybase.md
Created September 10, 2019 08:53

Keybase proof

I hereby claim:

  • I am wkta on github.
  • I am marlonb (https://keybase.io/marlonb) on keybase.
  • I have a public key ASAEevw2gIoaWk0hnlEiGszm7SWBXNS4qFg_p65betnfBgo

To claim this, I am signing this object:

PROMPT_MSG='type an integer greater or equal to 1 > '
input_ok = False
while not input_ok:
try:
num_tested = int(input(PROMPT_MSG))
if num_tested >= 1:
input_ok = True
except ValueError:
pass
@wkta
wkta / day_31.py
Last active October 24, 2019 12:58
#MonthOfCode day 31 - exit
# thema= EXIT, description= a dumb game. How to win this?
import random
import time
import sys
COIN_F = (True,False) # coin flipping
RUSSIAN_R = (False,False,True,False,False,False) # luck: 1 out of 6
START_MSG = 'A new gladiator enters the arena...'
D_QUOTES = (
'Death may have taken you but memories remain',
@wkta
wkta / day_30.py
Last active June 16, 2023 08:45
#MonthOfCode day 30 - infinity
# in order to run this demo, simply type:
# "pip install katasdk"
# JOIN THE Game Dev COMMUNITY on discord now!! https://discord.gg/SHdJhcWvQD
from math import cos, sin, pi
import katagames_sdk as katasdk
katasdk.kengi.bootstrap_e()
kataen = katasdk.kengi
@wkta
wkta / day_29.py
Created March 31, 2014 17:02
#MonthOfCode day 29 - golf
from random import choice
mid_names = [ "" for i in xrange(7) ]
mid_names.extend( [ "Kindred", "Junior", "Senior", "Jack" ])
first_names = \
[ "Tiger", "Mike", "Edgar", "Jean-Paul", "Sandra", "Clara", "Gary", "Philip", "Edwin" ]
last_names = [ "Woods", "Jackson", "Nelson", "Watson", "Palmer", "Hagen", "Nicklaus", "Haeger", "de LaMartre" ]
def printRandomName():
mid = choice(mid_names)
@wkta
wkta / day_28.py
Created March 31, 2014 17:01
#MonthOfCode day 28 - race
import random
import time
def detPrecision( candidate, model):
chars_cand = list( candidate)
chars_model = list(model)
while( len(chars_cand)<len(chars_model) ):
chars_cand.append(' ')
while( len(chars_cand)>len(chars_model) ):
chars_cand.pop()