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

Liquidfun platformer

2»

Comments

  • MoKaLuxMoKaLux 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.
    my growING GIDEROS github repositories: https://github.com/mokalux?tab=repositories
  • MoKaLuxMoKaLux Member
    edited May 9
    @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 <3

    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
  • MoKaLuxMoKaLux 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 :p (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
  • MoKaLuxMoKaLux Member
    edited July 17
    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 :s

    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 <3
    my growING GIDEROS github repositories: https://github.com/mokalux?tab=repositories
  • MoKaLuxMoKaLux Member
    edited July 17
    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
  • MoKaLuxMoKaLux 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 :s

    It is still WIP.
    my growING GIDEROS github repositories: https://github.com/mokalux?tab=repositories
  • MoKaLuxMoKaLux Member
    edited July 30
    added:
    - 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
  • SinisterSoftSinisterSoft Maintainer
    Accepted Answer
    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
  • MoKaLuxMoKaLux Member
    edited July 31
    updated with gideros particles sprite and no more lags :smile: 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
  • olegoleg Member
    edited August 1 Accepted Answer
    MoKaLux said:

    added:
    - 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://play.google.com/store/apps/developer?id=razorback456
    мій блог по гідерос https://simartinfo.blogspot.com
    Слава Україні!
    +1 -1 (+1 / -0 )Share on Facebook
  • MoKaLuxMoKaLux Member
    edited August 1
    thank you oleg for the feedback, updated with your suggestion :)
    self.img:setRotation(math.sin(e.time*4)*16)

    I need your help please :)
    What is missing before I start writing my gdoc for it (please keep in mind it is beginner oriented)?
    Do I need to add:
    - a parallax background?
    - bg music (on its way :) )
    - more enemies?
    - a boss?
    - another level?
    - more advanced "ai"?
    - ...?

    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
  • olegoleg Member
    edited August 1
    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://play.google.com/store/apps/developer?id=razorback456
    мій блог по гідерос https://simartinfo.blogspot.com
    Слава Україні!
    +1 -1 (+1 / -0 )Share on Facebook
  • MoKaLuxMoKaLux Member
    edited August 1
    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 B)
    my growING GIDEROS github repositories: https://github.com/mokalux?tab=repositories
  • olegoleg 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://play.google.com/store/apps/developer?id=razorback456
    мій блог по гідерос https://simartinfo.blogspot.com
    Слава Україні!
  • MoKaLuxMoKaLux Member
    edited August 1
    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! :o
    my growING GIDEROS github repositories: https://github.com/mokalux?tab=repositories
  • olegoleg Member
    edited August 1
    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! :o

    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://play.google.com/store/apps/developer?id=razorback456
    мій блог по гідерос https://simartinfo.blogspot.com
    Слава Україні!
  • MoKaLuxMoKaLux Member
    edited August 1
    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
Sign In or Register to comment.