You are viewing a single comment's thread from:

RE: Keyboard input for the hammer

in #gamedev6 years ago

Nice programming. Just a thought, you said that you couldn't change the character's direction when swinging the hammer. I was thinking it might be that the hammer swing code is in a subroutine so the subroutine needs to finish before it sends control (or focus) back to the main program. Just a thought.

Sort:  

oh no i made it so that you can't change while an attack animation is running. but thanks anyway!

Just for my information, did you code that motion in a subroutine? I'm presently enrolled in a python and a java script course and I am still learning how to program. Sorry for the newbie question.

well. it's simply switching which image you wanna render, so there really isn't code for any motion (yet).
a subroutine is quite vague, so i'm not exactly sure. but the gameloop has to call keyboard input functions as well as the character updates (including switching images). so i guess yes.

all my code is here
https://github.com/RoundBearChoi/choibot_steem_all
for this game it's all under the 'TestingPyGame' folder.
but i'm probably more noob than you are. this is my first python project.

Thank you for the link, I will check it out. I'm finding that if I look at other's code, I learn how to use the language. By taking intro courses, it tells me the names of methods and tools but it doesn't tell you how use them in conjunction with other tools. Thank you. I took my first python course about 1 year ago and so far all I wrote was a very simple 'hangman' game. lol

Coin Marketplace

STEEM 0.17
TRX 0.15
JST 0.028
BTC 56430.09
ETH 2323.65
USDT 1.00
SBD 2.35