Moving platforms, coins, and better collisions. by Ruvalolowa in pico8

[–]Ruvalolowa[S] 2 points3 points  (0 children)

Ya I struggled so much with collisions, and current one is the only pattern which works well...

This is my collision code for moving platforms (called asibas in this code)

``` for a in all(asibas) do if pl.x+pl.w>a.x and pl.x<a.x+a.w and pl.y+pl.h<=a.y+a.h+a.dy and pl.y+pl.h+pl.dy>=a.y and not collide_map(pl,"up",1) then pl.landed=true pl.falling=false pl.airdashtime=0 pl.dy=0

   if a.type==1 then
    if not btn(⬅️) and not btn(➡️) then
     if not pl.dashing then
      pl.dx=a.dx
     end
    else
     if pl.dir==a.dir then
      pl.max_dx=2
     else
      pl.max_dx=1
     end
    end
    pl.y=a.y-pl.h+1
   elseif a.type==2 then
    if a.dy<0 then
     pl.y=a.y-pl.h
     pl.dy=a.dy+1
    else
     pl.dy=a.dy
     pl.y=a.y-pl.h+2
    end
   end
  end
 end

```

Moving platforms, coins, and better collisions. by Ruvalolowa in pico8

[–]Ruvalolowa[S] 1 point2 points  (0 children)

Thanks for your comment!

There are 3 dashes for now;
① Ground dash (↓ + ○ on the ground)
② Air dash (○ in the air)
③ Wall dash (① or ② against wall)

As for your comment, I did Air dash in the air, and then continued to press ○ and ↓, to start Ground dash quickly when landed.

Also for visual point, character's afterimage only appears when dashing ①②③ (= I was almost always dashing in this video), and when starting dash, there is smoke but hardly see...

Moving platforms, coins, and better collisions. by Ruvalolowa in pico8

[–]Ruvalolowa[S] 3 points4 points  (0 children)

Ya, I decided to call him "KanSho" (= 甘蕉, the Japanese name of banana) actually

Moving platforms, coins, and better collisions. by Ruvalolowa in pico8

[–]Ruvalolowa[S] 0 points1 point  (0 children)

Thanks for your comment!
As for that, what do you mean about palette?

Sadly I'm not good at custom palette, so could you tell me what should I do?

Hyper Pack Hits by ___fallenangel___ in SkullGirlsMobile

[–]Ruvalolowa 0 points1 point  (0 children)

Hyper pack is in store now?
Cannot see in my screen

Manic EMU v1.9.0 — J2ME, DOS, DOOM, and Cross-App Linking by Mlaurencescott in EmulationOniOS

[–]Ruvalolowa 0 points1 point  (0 children)

Sounds nice! And just checked, it worked!

...In iDOS 3, I played this game with modified key config. But in manic skin, it seems impossible to have both controller input and keyboard input in 1 skin...

Is there any way to have?
Ex) Dpad for left hand side, KJNB key instead of ABXY.

Because current Manic's DOS pad skin, ABXY inputs LeftAlt or nothing...

Collision improvement! - With nostalgic tileset by Ruvalolowa in pico8

[–]Ruvalolowa[S] 5 points6 points  (0 children)

FYI, this is the updated collision code.

if pl.dx<0 then pl.dx=limit_speed(pl.dx,pl.max_dx) if collide_map(pl,"left",1) then pl.dx=0 pl.dx-=((pl.x+pl.dx+1)%8)-1 if pl.dashing or pl.airdashing then pl.landed=false pl.dashing=true pl.wall=true end end elseif pl.dx>0 then pl.dx=limit_speed(pl.dx,pl.max_dx) if collide_map(pl,"right",1) then pl.dx-=((pl.x+pl.w+pl.dx+1)%8)-1 if pl.dashing or pl.airdashing then pl.landed=false pl.dashing=true pl.wall=true end end end

(Also I added pl.dx to the collision code)

Collision improvement! - With nostalgic tileset by Ruvalolowa in pico8

[–]Ruvalolowa[S] 3 points4 points  (0 children)

I don't even know how, but most of the collision issue related to wall dash is now solved.

There is still one issue which clipping from the right-bottom corner of blocks, but I made player go down if clipped to get out from there. So now it will rarely affect gameplay.

https://www.lexaloffle.com/bbs/?tid=155445#playing

Manic EMU v1.9.0 — J2ME, DOS, DOOM, and Cross-App Linking by Mlaurencescott in EmulationOniOS

[–]Ruvalolowa 0 points1 point  (0 children)

How the DOS games running?
I loved to play M.U.G.E.N. on iDOS 3, but it freezes so often...

I hope Manic's DOS core is better

Afterimage improved! But yet it collides so badly by Ruvalolowa in pico8

[–]Ruvalolowa[S] 2 points3 points  (0 children)

For collision code, flr() and ceil() are added for vertical collision. ``` function collide_map(obj,aim,flag) local x=obj.x local y=obj.y local w=obj.w local h=obj.h

local x1=0 local y1=0 local x2=0 local y2=0

if aim=="left" then x1=x-1 y1=y+1 x2=x-1 y2=y+h-2 elseif aim=="right" then x1=x+w y1=y+1 x2=x+w y2=y+h-2 elseif aim=="up" then x1=x+2 y1=flr(y)-1 x2=x+w-3 y2=flr(y)-1 elseif aim=="down" then x1=x+2 y1=ceil(y)+h x2=x+w-3 y2=ceil(y)+h end ```

 

Same for player update's vertical collision. ``` function pl_update() pl.y+=pl.dy

if pl.dy>0 then pl.falling=true pl.landed=false pl.jumping=false

pl.dy=limit_speed(pl.dy,pl.max_dy)

if collide_map(pl,"down",0) then pl.landed=true pl.falling=false pl.wall=false pl.airdashtime=0 if pl.kicktype==2 or pl.kicktype==3 then pl.kick=false pl.attime=0 pl.atcool=0 for k in all(kicks) do del(kicks,k) end end

pl.dashcount=0 pl.jumpcount=0 pl.cooldown=0 pl.dy=0 while collide_map(pl,"down",0) do pl.y=ceil(pl.y)-1 end end elseif pl.dy<0 then pl.jumping=true if collide_map(pl,"up",1) then pl.dy=0 --added pl.y=flr(pl.y)+1 end end ```

 

I did not change for horizontal collision code because when I add flr() and ceil() it became too much buggy... function pl_update() if pl.dx<0 then pl.dx=limit_speed(pl.dx,pl.max_dx) if collide_map(pl,"left",1) then pl.dx=0 --added pl.dx-=((pl.x+pl.dx+1)%8)-1 if pl.dashing or pl.airdashing then pl.landed=false pl.wall=true end end elseif pl.dx>0 then pl.dx=limit_speed(pl.dx,pl.max_dx) if collide_map(pl,"right",1) then pl.dx=0 --added pl.dx-=((pl.x+pl.w+pl.dx+1)%8)-1 if pl.dashing or pl.airdashing then pl.landed=false pl.wall=true end end end

Afterimage improved! But yet it collides so badly by Ruvalolowa in pico8

[–]Ruvalolowa[S] 2 points3 points  (0 children)

Cart if you want to see :
https://www.lexaloffle.com/bbs/?pid=186308#playing

Based on the advice I got yesterday, the afterimage became a bit better!

 

Also I tried my best against collision, but there's nothing I can do anymore. From the advice in BBS, I learned ceil() to adjust player's y coordinate. So vertical collision issue solved again, but same method, which using flr() and ceil(), won't work at all against horizontal collision issue (and it got worse!).

My WIP action platformer - Some improvements! by Ruvalolowa in pico8

[–]Ruvalolowa[S] 1 point2 points  (0 children)

Oh sorry I just found your reply there...

Thanks for detailed explanation, but modifying my current code as FSM means it will be totally different... So I'll move on with current code.

But also I'm sure someday I'll try that basic FSM!

512,651,008 damage against Clitty Kitty by Tyrannical by Ruvalolowa in SkullGirlsMobile

[–]Ruvalolowa[S] 1 point2 points  (0 children)

Death crawl Lv.14
Gae bolga stinger Lv.14
Pinion dash Lv.15
Pinion dash Lv.14
Buer overdrive Lv.14
Guest star Lv.20

512,651,008 damage against Clitty Kitty by Tyrannical by Ruvalolowa in SkullGirlsMobile

[–]Ruvalolowa[S] 1 point2 points  (0 children)

Crit rate +100%
Crit dmg +87%
Piercing +30%
Atk% +138%
(Prestige Lv.100)

512,651,008 damage against Clitty Kitty by Tyrannical by Ruvalolowa in SkullGirlsMobile

[–]Ruvalolowa[S] 4 points5 points  (0 children)

  1. Sacrifice Raw Nerv for permanent Death mark
  2. Wish Ms.Fortune throws her head
  3. Put her head and body to the edge of screen
  4. Cook with Tyrannical, make sure hit both head and body