…it seems that the ground sprites only partially appear on screen. Furthermore, everything moves very, very fast - faster than I believe it’s supposed to. Can someone explain what causes this behavior and how to fix it?
Sounds like vsync might not be enabled in your graphics driver.
You can either enable vsync in your graphics driver settings, alternatively you could check “variable_dt” in game.project settings which will let the engine use actual time when stepping.
I noticed that delta time (dt) provided to the update() function of the controller.script isn’t used. And I see now that it’s not used in the tutorial code either. This is quite surprising as it can result in different results depending on hardware. The update function should look like this to use dt:
function update(self, dt)
self.gridw = self.gridw + self.speed * dt
Obviously you need to increase the speed from 6 to something larger (try 360 pixels per second).
I recently joined, and I wonder if it’s alright to ride this existing topic, as I’m having trouble with this same tutorial as well.
I am at step 4, creating a hero character. It says to move the frog images to match the box and sphere shapes, but I can’t see the frog sprites and the collision object simultaneously. What am I doing wrong?
Hard to tell. So you have the hero.go file open? And in the Outline you should have a spine component and a collision component attached (plus at a script and at a later stage also a particle fx). Like this:
I was just taking the screenshot, when I noticed that I was missing one leg sprite in the atlas, and adding it fixed it. It’s strange I was missing it, since I’m 99% sure I used select all when moving the images, but what are you going to do, down to user error this one.
Thank you for your time and sorry about the bother!
Added crutch until spikes are added. If Hero beats his head in a jump of the left corner of the platform - the speed of x decreases, if the head beats of the right corner of the platform - the speed increases and he runs off the zone.
Fast remedy:
local function handle_geometry_contact(self, normal, distance)
.....
if self.velocity.x~=0 then
self.velocity.x=0
end
end