Quick Links: Download Gideros Studio | Gideros Documentation | Gideros Development Center | Gideros community chat | DONATE
Liquidfun platformer - Page 2 — Gideros Forum

#### Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

# Liquidfun platformer

• Member
edited November 2020
 ```-- beginning of enterframe local vx, vy = self.body:getLinearVelocity() -- lots of calculation ... -- get the linear velocity again! local tvx, tvy = self.body:getLinearVelocity() local velocitychangex = vx - tvx local velocitychangey = vy - tvy local impulsex = self.body:getMass() * velocitychangex local impulsey = self.body:getMass() * velocitychangey -- impulse self.body:applyLinearImpulse(impulsex, impulsey, self.body:getWorldCenter())```
Before I was moving with setLinearVelocity and I thought that was the problem so now I use this method.

Likes: MobAmuse

my growING GIDEROS github repositories: https://github.com/mokalux?tab=repositories
+1 -1 (+1 / -0 )Share on Facebook
• Member
edited May 2021
@antix rrraptor sorry I just posted the code above, now that you pointed this I need to redo how I move the player. I will have another look at iforce tutorials and will let you know.
My code above makes no sense but strangely it works fine.

Thank you antix rrraptor

EDIT: I have tested with this code (game loop):<pre class="CodeBlock">
 ```vx = self.body:getLinearVelocity() if isleft then desiredvelx = -5 ... end local velocityxchange = desiredvelx - vx local impulsex = self.body:getMass() * velocityxchange self.body:applyLinearImpulse(impulsex, 0, self.body:getWorldCenter()) self:setPosition(self.posx, self.posy)```
With no luck the dynamic bodies still interpenetrate.

PS: don't look at the naming of my variables I am just testing
PS2: It's been days I am trying to figure this out, in my case I wanted to have some rocks fall on the player and on the ground. When the rocks have finished hurting the player and then lay on the ground I wanted the player to be able to walk over them (that was the idea).
PS3: that's weird box2d behavior, isn't it?
PS4: will try to post on the box2d github
my growING GIDEROS github repositories: https://github.com/mokalux?tab=repositories
• Member
MoKaLux said:

I am planning to do a yt tutorial in french? God's willing.

Viva Gideros Gideros rocks

months later, I have started my french yt tutorial
I found an easy way to come up with level building, I mean an infinite source of inspiration for level building (just mute the video)

peace

Likes: SinisterSoft

my growING GIDEROS github repositories: https://github.com/mokalux?tab=repositories
+1 -1 (+1 / -0 )Share on Facebook
• Member
edited July 2021
I tried everything I could but I am not able to make a fully fledge platformer using box2d
https://mokatunprod.itch.io/gdoc-03-platformer

In this demo I implemented double jump and pass through platforms but when you keep pressing up the player flies!!!

I also have hard time with slopes and jumping... So much pain

I can make something nice out of it but I am afraid it would be so basic that it won't match modern platformers!

This is supposed to be my next game for my GDOCS project.

EDIT: I managed to make it acceptable
 ```if self.body.isup and self.body.canjump and self.body.numjumpcount > 0 and not self.body.isdown then if vy < -4 then desiredVelY = -self.body.jumpspeed / 3 else desiredVelY = -self.body.jumpspeed end self.body.canjump = false self.body.numjumpcount -= 1 end```
Viva Gideros
my growING GIDEROS github repositories: https://github.com/mokalux?tab=repositories
• Member
my growING GIDEROS github repositories: https://github.com/mokalux?tab=repositories
• Member
edited July 2021
updated: https://mokatunprod.itch.io/gdoc-03-platformer

the previous background I had chosen was too complicated to make a level out of it. This time I have chosen a "fantasy ruins" style.

my growING GIDEROS github repositories: https://github.com/mokalux?tab=repositories
• Member
Fix sounds plz
• Member
I dont understand how hight jumps work.
• Member
I will fix everything soon rrraptor, I was focused on the gfx and level design.

I need to add AI, mobile controls, more enemies, fx, ...
I need to fix some controls as well

It is still WIP.
my growING GIDEROS github repositories: https://github.com/mokalux?tab=repositories
• Member
edited July 2021
- mobile controls (oleg)
- tnt particle engine (gregbug) to test but it is lagging the game (html5, windows is ok)
- screen shake (camera by rrraptor)

Still work in progress... https://mokatunprod.itch.io/gdoc-03-platformer
my growING GIDEROS github repositories: https://github.com/mokalux?tab=repositories
• Maintainer
Instead of tnt particles - use the particles sprite...

Likes: MoKaLux

Coder, video game industry veteran (since the '80s, ❤'s assembler), arrested - never convicted hacker (in the '90s), dad of five, he/him (if that even matters!).
https://deluxepixel.com
+1 -1 (+1 / -0 )Share on Facebook
• Member
edited July 2021
updated with gideros particles sprite and no more lags thanks SinisterSoft.
I can share the code I have so far, just tell me

Likes: oleg, SinisterSoft

my growING GIDEROS github repositories: https://github.com/mokalux?tab=repositories
+1 -1 (+2 / -0 )Share on Facebook
• Member
MoKaLux said:

- mobile controls (oleg)
- tnt particle engine (gregbug) to test but it is lagging the game (html5, windows is ok)
- screen shake (camera by rrraptor)

Still work in progress... https://mokatunprod.itch.io/gdoc-03-platformer

Instead of rotating the cups. Can be done by pulsating special effects using cosine and sine

Here is a piece of code from my game about a cat where elements of the game pulsated to the beat of the music:
 ```---------------------------------- -- ENTER FRAME ---------------------------------- local frameRate=application:getFps() local fineSkip=0 stage:addEventListener(Event.ENTER_FRAME, function(e) fineSkip=e.deltaTime*frameRate   --МЕНЮ if c.level==3 then g_menu:setRotation(3*math.cos(e.time*sound_tact)*-1) g_play:setRotation(3*math.sin(e.time*sound_tact)) banner:setY(-450+3*math.cos(e.time*sound_tact)) banner:setRotation(0.5*math.sin(e.time*sound_tact)) --b_ach3 b_ach3:setRotation(3*math.sin(e.time*sound_tact/1.5)) b_ach4:setRotation(3*math.cos(e.time*sound_tact/0.5)) end if c.level==1 then logo:setY(20+2*math.sin(e.time*sound_tact+5)) logo:setX(centrX+2*math.cos(e.time*sound_tact+5)*-1) b_play:setRotation(2*math.sin(e.time*sound_tact/1.5)) b_play:setX(centrX+15*math.sin(e.time*sound_tact/1.5)*-1) -- кнопка рекорди в start -- print("logo") b_score:setY(centrY-30+2*math.cos(e.time*sound_tact+5)) b_score:setX(minX+2*math.sin(e.time*sound_tact+5)*-1) --b_ach3 b_ach3:setRotation(3*math.sin(e.time*sound_tact/1.5)) b_ach4:setRotation(3*math.cos(e.time*sound_tact/0.5)) --else --print("---") end     --підтанцьовка фону if sound_tact==9.7 then g_tree2:setScaleY((0.01*math.sin(e.time*sound_tact))+0.9) elseif sound_tact==12 then g_tree1:setScaleY((0.02*math.sin(e.time*sound_tact))+0.9) g_tree2:setScaleY((0.02*math.cos(e.time*sound_tact))+0.9) end --коливання води voda2g:setY(2*math.sin(e.time*sound_tact)) voda2g:setX(2*math.cos(e.time*sound_tact)*-1)   voda1g:setY(0.7*math.sin(e.time*sound_tact)) voda1g:setX(0.7*math.cos(e.time*sound_tact)*-1)```

Likes: MoKaLux

my games:
мій блог по гідерос https://simartinfo.blogspot.com
Слава Україні!
+1 -1 (+1 / -0 )Share on Facebook
• Member
edited August 2021
thank you oleg for the feedback, updated with your suggestion
self.img:setRotation(math.sin(e.time*4)*16)

What is missing before I start writing my gdoc for it (please keep in mind it is beginner oriented)?
- a parallax background?
- bg music (on its way )
- more enemies?
- a boss?
- another level?
- ...?

Or have I covered the basics and should let the people do the missing stuff?
my growING GIDEROS github repositories: https://github.com/mokalux?tab=repositories
• Member
edited August 2021
I think that the control buttons 'IJKL' are not very convenient.
-Because control depends on which language is enabled on the computer
-On non-gaming keyboards there is a restriction on pressing several keys with letters at the same time
-'IJKL' keys are not intuitive

**It is better to do arrow control or WASD (But it should be provided that it works in different languages ​​and not only in English ..)

*** I also had problems with jumping - he jumps very low

Likes: MoKaLux

my games:
мій блог по гідерос https://simartinfo.blogspot.com
Слава Україні!
+1 -1 (+1 / -0 )Share on Facebook
• Member
edited August 2021
thanks oleg, you can use arrow keys too (on my computer it doesn't work so well because of key ghosting https://forum.gideros.rocks/discussion/comment/62950/#Comment_62950). IJKL is for french (and maybe other keyboards). I will add WASD which is not convenient at all on a french keyboard.
I don't have any gamepad so I cannot test it yet

Jumping is a bit tricky because it's a question of feeling, I will try to make it better.

Updated (with higher jumps) beware jump away from a wall not close to a wall!
Thank you mister oleg
my growING GIDEROS github repositories: https://github.com/mokalux?tab=repositories
• Member
I'm just wondering.
How is a French keyboard different from a regular one?

**I thought that all keyboards are the same, just the alphabet is different ..
my games:
мій блог по гідерос https://simartinfo.blogspot.com
Слава Україні!
• Member
edited August 2021
azerty vs qwerty vs qwertz vs ... french is azerty

DID YOU KNOW? they picked qwerty for english keyboard because you can write TYPEWRITER using only the first row of the keyboard!
my growING GIDEROS github repositories: https://github.com/mokalux?tab=repositories
• Member
edited August 2021
MoKaLux said:

azerty vs qwerty vs qwertz vs ... french is azerty

DID YOU KNOW? they picked qwerty for english keyboard because you can write TYPEWRITER using only the first row of the keyboard!

We are talking about different things, I'm not talking about binding to the letters of the alphabet but about binding to the keys.

In English 'WASD' and in Ukrainian it is 'CFIV' - the letters are different but the keys are the same ..

ps/ I do not know what the principle of the English keyboard, and the Ukrainian keyboard is made on the principle of frequency of letters in the Ukrainian language, those letters that are used more often -located closer to the center, those letters that are used less -located away from the center of the keyboard ..
my games:
мій блог по гідерос https://simartinfo.blogspot.com
Слава Україні!
• Member
edited August 2021
oleg said:

In English 'WASD' and in Ukrainian it is 'CFIV' - the letters are different but the keys are the same ..

oh I misundertood, so in french that should be ZQSD, I use IJKL because of old times (amstrad CPC 6128 ), and maybe because I am left handed too, or I am not really sure why

Likes: oleg

my growING GIDEROS github repositories: https://github.com/mokalux?tab=repositories
+1 -1 (+1 / -0 )Share on Facebook
• Member
edited August 2021
updated:
- flying enemies with ai
- a boss
- a full level

to do: polish and adjust controls and ...
https://mokatunprod.itch.io/gdoc-03-platformer
my growING GIDEROS github repositories: https://github.com/mokalux?tab=repositories
• Member
MoKaLux said:

updated:
- flying enemies with ai
- a boss
- a full level

to do: polish and adjust controls and ...
https://mokatunprod.itch.io/gdoc-03-platformer

Hi. I don't know how your jumps are implemented, so I just want to share my jumping method - maybe this information will help you ..

 ```jumpSpeed=1 gravityPower=0.2   stage:addEventListener(Event.ENTER_FRAME, function(e) playerY += jumpSpeed jumpspeed -= gravityPower```

Likes: MoKaLux

my games:
мій блог по гідерос https://simartinfo.blogspot.com
Слава Україні!
+1 -1 (+1 / -0 )Share on Facebook
• Member
thanks my dear oleg, I will polish the jumping specially for you I am using box2d and it is a bit hard to fine tune the movements.
my growING GIDEROS github repositories: https://github.com/mokalux?tab=repositories
• Member
edited August 2021
updated https://mokatunprod.itch.io/gdoc-03-platformer
- level selection (2nd level WIP)
- better controls? (jump)
- new nmes

What do you think? What is missing?
Thank you

PS: I need to work my artistic side
my growING GIDEROS github repositories: https://github.com/mokalux?tab=repositories
• Member
MoKaLux said:

updated https://mokatunprod.itch.io/gdoc-03-platformer
- level selection (2nd level WIP)
- better controls? (jump)
- new nmes

What do you think? What is missing?
Thank you

Congratulations, the game has become playable.

I really like the guide to platform games from Scott Rogers - I think you will find it interesting.
http://mrbossdesign.blogspot.com/2008/10/platformer-primer.html

I liked it so much that I even once translated it into Ukrainian.
https://simartinfo.blogspot.com/2019/06/blog-post.html

Likes: MoKaLux

my games:
мій блог по гідерос https://simartinfo.blogspot.com
Слава Україні!
+1 -1 (+1 / -0 )Share on Facebook
• Member
You can shoot while climbing, but threre is no animation.
You can stick to walls by pressing jump button as fast as possible. One way platforms give you jump boost for some reason.

Likes: MoKaLux

+1 -1 (+1 / -0 )Share on Facebook
• Member
edited August 2021
thank you mister oleg
I am not making a full game, the purpose is to make a written tutorial (my GDOC project ) then when it's done a YT tutorial based on it. Your link to the guide is quite amazing though

We need more gideros tutorials guys

So I will add some stuff to the WIP 2nd level, then I can start the Gideros Document, God's willing.

Viva Gideros
my growING GIDEROS github repositories: https://github.com/mokalux?tab=repositories
• Member
edited August 2021
rrraptor said:

You can shoot while climbing, but threre is no animation.

there is no such animation in mixamo
rrraptor said:

You can stick to walls by pressing jump button as fast as possible.

oh I forgot this bug and I am not really sure how to handle this one. Short explanations: every platforms (including moving platforms) are drawn as rectangle in Tiled. Then in code I add the rectangle plus 2 little rectangles on both sides (left and right) with friction 0. For a bottom rectangle it is more difficult
rrraptor said:

One way platforms give you jump boost for some reason.

This is box2d fine tuning which is difficult but easy to fix just adjust the values

Some more bugs I found:
- the missiles for the spaceships are transparent!
- the boss can shoot himself!
- ...

Thank you very much commander rrraptor, much appreciated
Other than that, do you think that is enough for a tutorial?

PS: you know fine tuning is a never ending story
my growING GIDEROS github repositories: https://github.com/mokalux?tab=repositories
• Member
I think Box2d is used to simulate physics in the first place but in platformers physics is usually simple. Maybe it would be better to use bump, although it does not provide slopes, but I think it can be easily achieved with math.
Here is a link where you can find some info about slopes:
https://gamedevelopment.tutsplus.com/tutorials/basic-2d-platformer-physics-part-8-slopes--cms-28704?_ga=2.82781717.2048936275.1629196040-389888950.1629196040
And full list:
https://tutsplus.com/authors/daniel-branicki?_ga=2.7277233.2048936275.1629196040-389888950.1629196040
MoKaLux said:

Other than that, do you think that is enough for a tutorial?

I don't know if this is enough. But I know for sure that the bugs need to be fixed first.
And my 5 cents: replace the graphics, because the current one looks like a mess (there are many asset packs with everything you need).

Likes: MoKaLux

+1 -1 (+1 / -0 )Share on Facebook
• Member
edited August 2021
thank you rrraptor for your honest feedback, much appreciated
1. box2d for platformers; there are some people for, some people against. After some attempts I feel more in the first group.
2. slopes may be very tricky (cf antix attempts using slopes with bump plugin), for example in the link you kindly provided it only deals with 45 degrees slopes!
3. the bug where you can stick to the moving platform is fixed
4. the bug when gaining speed when going through platforms is partially fixed
5. regarding gfx I agree, they are bad . Could you please check the gfx for the 2nd level?
updated: https://mokatunprod.itch.io/gdoc-03-platformer

I am looking forward to making the yt tutorials
my growING GIDEROS github repositories: https://github.com/mokalux?tab=repositories