How To

Timo left us flying through objects. lol. How to walk on land?

0

tactics_pvp 2020-02-07 04:54 (Edited)

So yea, just finished Timo youtube guide.

Sorry Timo, when you asked me yesterday, If I learned anything from your video, and I said no. I thought you referring to your sample videos that you have of game snippets.

This guide taught me a lot. I’m going to repeat it again.

All I want do now for this code (which I don’t think is deep) should be beginner stuff for me is code to do the following:

* Slow down the scrolling speed.
* Prevent my pixel guy from flying. Just natural physics.
* Walk on the ground not through it and not through walls.


Can anybody hook me up with this code or guide me to somewhere that teaches me these specific things I am asking? Thanks.


This is the code:

GAMEPAD 1
BG 1
BG COPY 0,0,32,32 TO 0,0


X=64
Y=64
DO
BGX=BGX+1
SCROLL 1,BGX,0
IF UP(0) THEN Y=Y-1
IF DOWN(0) THEN Y=Y+1
IF LEFT(0) THEN X=X-1
IF RIGHT(0) THEN X=X+1
SPRITE 0,X,Y,TIMER/8 MOD 2 + 1
WAIT VBL
LOOP







#1:MAIN PALETTES
053F2F0000383400000C2410003F3C00
003F2A15003F2A15003F2A15003F2A15

#2:MAIN CHARACTERS
00000000000000000000000000000000
3820003C3030CC000010303E00000000
382000303C30CC00001030301E000000
FFFF5E040044FFFF0000A1FBFFFFFFFF
3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C
3C7E7FFFFFFFFE7C0000000000000000
100808894A2E1C1C0000000000000000

#3:MAIN BG
00001410000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000200000000
00000000000000020000000000000000
00000000000000000000000000000000
00000002000200000000000000020002
00000000000000000000000000020302
03020302000000000000030600020002
03020302030203020002000200020002
05020002000000020002000200020002
06020002000200020002000200000000
00020002000200020502000000000000
00020000030203020302000200020002
00020002000200000000000200000000
04020000000000000522000000020002
00020002000205220522052200020306
03060000030203020302030203020000
05220000000000000000030600020522
05220522000200020002000000000002
00000000000000000522000000000000
00000000000200020422000200020002
00020002000000000002000000000000
04220000000003260326000203220322
03220322032203220002030603060002
03220322032203220322032200000000
00020002000200020002001200120002
00020000000000020002000200020000
00000000000000000602060206020002
00020002001200120012001200000000
06020602060206020000000003020302
03020302030203020302030203020302
03020302030203020302030203020302
03020302


was8bit 2020-02-07 06:16

Fixed... post questions for anything :)

Fixed.nx | Open in app
2020-02-07 06:16

was8bit 2020-02-07 06:17 (Edited)

UP acts like a JUMP Button... would be better as A or B but wanted to do as few changes a possible....


tactics_pvp 2020-02-07 21:24

@was8bit
this is awesome! thank you.

these bits of keywords will help me learn. i’m still breaking post your other code.

i’m at work, long day today and tomorrow, but expect me back this sunday.


was8bit 2020-02-08 06:54

Well, i forgot to tell you that the 2 important CHECK subs come from Timo's program..

https://lowresnx.inutilis.com/topic.php?id=318

And also my "gravity" is abit of a quick hack, there are a few different ways to do gravity and jumping, depending on how you want the playaction to feel ..

Sprites interacting with background cell charactes can be tricky when you allow free pixel level movement, which you almost have to do when jumping...

If your game is top down view with no jumping, (like pacman) you can use a movement trick that restricts movement to cell to cell only, so no fancy pixel checks, just check the cell your player wants to go to, and if it is empty then perform exactly 8 pixel movements on players sprite and presto it ends up in the empty cell perfectly :)


Log in to reply.