Hi there !
I'm new to this forum. I actually joined because I discovered the RGS and I'm actually learning (a very little bit) how to Python programming with it (I never programmed before).
It's so much fun, the tutorial is so easy to understand.
But I still have 2 problems (3 in fact).
First one, my character does not collide with the blocks. So it keeps falling again and again. Is it something not in the tutorial that I "forgot" to write in the code ?
Second, when I add the line to assign jump to the "button1", the game does not start at all and write something in the log
warning: Not importing directory 'C:\deploy\template\.\game': missing __init__.py
Traceback (most recent call last):
File "main.py", line 4, in <module>
File "game\game.py", line 14
player.entity.yVelocity = -200
^
IndentationError: expected an indented block
Third, I desactivated the NTSC thing, and thegame doesn't fit in the screen. Why ?
(Notice, the collision bug thing)
I think this is all for now. Of course, event if the RGSEdit is a real pleasure to use, it needs to be improved. Like the "A file is already called like that, are you sure you want to erase it ?" well known feature :D
If you're interested to see were I'm wrong, here's my code
from librgs import *
def gameLoop():
return 1
RGS_Init(320,240,640,480,RGS_NORMAL)
screen = RGS_CreateScreen()
level = RGS_CreateTilemap(screen, 256,240, "level.map", "titles.sur")
player = RGS_CreateEntitySprite(screen, level, "goggles.spr")
player.entity.x = 43
player.entity.y = 64
RGS_TilemapFollowEntity(level, player.entity, 0,0)
RGS_PlaySpriteAnimation(player.sprite, "idle", 0)
while RGS_Update():
if RGS_KeyDown(RGS_BUTTON1) and player.entity.isTouchingGround:
player.entity.yVelocity = -200
if RGS_KeyDown(RGS_RIGHT):
player.entity.xVelocity = 100
player.entity.xDirection = 1
player.sprite.flipX = 0
RGS_PlaySpriteAnimation(player.sprite, "run", 0)
elif RGS_KeyDown(RGS_LEFT):
player.entity.xVelocity = 100
player.entity.xDirection = -1
player.sprite.flipX = 1
RGS_PlaySpriteAnimation(player.sprite, "run", 0)
else:
RGS_PlaySpriteAnimation(player.sprite, "idle", 0)
gameLoop()
while RGS_Update():
gameLoop()
RGS_Shutdown()
An game_example.py should have been included in the .zip, it would have been even more helpful.
And sorry for my english, you may have noticied that I'm not a native speaker :D