-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
- Loading branch information
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
[ViewState] | ||
Mode= | ||
Vid= | ||
FolderType=Pictures |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
text,type,typeId,Description | ||
Main,Process,creately.flowchart.process, | ||
"Level.py | ||
|
||
- setup_level | ||
-scroll_x | ||
-horisontal_collision | ||
-vertical_collision | ||
-go",Process,creately.flowchart.process, | ||
"Player | ||
|
||
- character_image | ||
- animate | ||
- get_input | ||
- apply_gravity | ||
- jump | ||
- update",Process,creately.flowchart.process, | ||
"Platforma | ||
|
||
- platform_image | ||
- animate | ||
- update",Process,creately.flowchart.process, | ||
"Score_counter | ||
|
||
- score_image",Process,creately.flowchart.process, | ||
"Support | ||
|
||
- player_importer | ||
- platform_importer | ||
- coin_importer",Process,creately.flowchart.process, | ||
"Config | ||
- level_map | ||
- tile_size | ||
- screen_width | ||
- screen height",Process,creately.flowchart.process, | ||
"Coin | ||
|
||
- coin_image | ||
- animate | ||
- update",Process,creately.flowchart.process, |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import pygame | ||
from support import coin_importer | ||
class Coin(pygame.sprite.Sprite): | ||
def __init__(self,pos): | ||
super().__init__() | ||
self.coin_image() | ||
self.frame_index = 0 | ||
self.animation_speed = 0.15 | ||
self.image = self.animations['Coin'][self.frame_index] | ||
self.rect = self.image.get_rect(topleft = pos) | ||
|
||
def coin_image(self): | ||
coin_path = '../' | ||
self.animations = {'Coin':[]} | ||
for animation in self.animations.keys(): | ||
full_path = coin_path + animation | ||
self.animations[animation] = coin_importer(full_path) | ||
|
||
def animate(self): | ||
animation = self.animations['Coin'] | ||
self.frame_index+=self.animation_speed | ||
if self.frame_index>=len(animation): | ||
self.frame_index = 0 | ||
|
||
image = animation[int(self.frame_index)] | ||
self.image = image | ||
|
||
def update(self,dx): | ||
self.animate() | ||
self.rect.x+=dx |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
level_map = [ | ||
'x x x', | ||
'x c c c x x', | ||
'x c x xx x xx xx xx xx xx x x', | ||
'x xxx x x xx xxx x x x x', | ||
'x x x c xx xxxxx x c x', | ||
'x xxx xxx c xxxxx xx xx xxxx xxx x x', | ||
'x xxxxxx xxx c xx xxx x x x', | ||
'x xxx xxx xxxx xxxxxx xxx c xxx xxx xxx x', | ||
'x P c xxxxxx xxx xxx x', | ||
'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',] | ||
|
||
tile_size = 64 | ||
screen_width = 1200 | ||
screen_height = len(level_map) * tile_size |