You can support the development on the Github Sponsors page.


Tech > PLATFORMER TUTORIAL


Demo made for tutorial @ infinitelimit.net
made by trelemar
uploaded by trelemar
added:
download cartridge
- CLICK TO PLAY -

37


This demo was made to follow along at:

https://www.infinitelimit.net/article/simple-platformer-tic-80

Comments


CrazyFox

Hey, I'd just like to thank you for this tutorial.
I learned a lot by dissecting it in every way I could think of.

Now I just need to figure out smooth scrolling...

trelemar

#240 Thanks! I'm glad you found it useful. I actually wrote a camera tutorial that should help you with smooth scrolling as well, here's the link: https://tic.computer/play?cart=161

fromlowrescoder

how do i add new blocks of diffrent colors and have collision detection for them?

fromlowrescoder

oh nevermind


oscar1000108

There seems to be an issue where you can clip 1 pixel into a corner.
To reproduce: get to where the player is in this screenshot: https://cdn.discordapp.com/attachments/424244220988227585/455049946270531595/unknown.png and hold right. You should get stuck in the corner of the platform below.

Trianull

The landing and wall scripts are a bit unoptimized, leading to clipping and the dreaded "Fake Landing" (The landing that kills your momentum before you fully land)
To fix landing, have ground detection happen after you go into the ground, and use a while-do script to push yourself back to the surface. Similarly for walls, use a direction variable and push yourself out according to the direction using another while-do script.
Hope this helps.

willowcat2010

But could you teach me how to make the map? I'd really appriciate.

MilkBoi

I found that when I tried to jump it would not allow me to jump, for some reason btnp(4) wasn't working for me. What I did was change btnp(4) to btnp(up) and this solved the problem. Why did this happen, and is there a better way to fix my problem?


Oleg

Wow, cool!

TRPL

This should be posted in the Tools section, since it is basically a platformer engine, but its great for learning to do this studd

Parokis

Awsome tutorial!

Popolon

If you replace, Line 34, p.vy=0 by this, you will avoid a strange slow down/accelerate again effect;

p.y=((p.y+p.vy)//8)*8
p.vy=0

The current aglorithm is got for fixed tic80 screen with current values, as it take 164 pixels to reach 8 px speed with 0.2 acceleration from vy=0 and screen is 136px high, but with higher level, p.vy could reach >8 px speed and stride above one tile. In this case, the test should be, if p.vy >= 8, to trace all tiles between the character position and the destination with current speed.


peterhil

I ported this to Fennel – will upload cart later:
https://github.com/peterhil/tic-demo-platformer/blob/main/src/game.fnl

CactyCatt

Thanks A LOT!

Mgue1207

What is the Code for load?

marsMan687

So helpful

Sulfurix

you're tutorial help me a lot. thx

Lightuptheray

Is there any version but. In python???


Post comment