@britzl no sir…the “getting started tutorial” and my game have some similarities…but the only difference between them is:
-
in the “getting started tutorial” - the ground is moving from right to left, while in my game, the ground isn’t need to move…
-
in the “getting started tutorial” - the hero frog plays the “running_right” animation (and as what i observed on it, the frog is NOT ACTUALLY RUN BY ITSELF…it only plays the running animation but actually it didn’t move in its current position(in left most edge), but instead the ground is moving for it.) ,… while in my game, i want my hero to actually move by itself forward (without pressing any key and without the ground scrolling)
actually, i used the same code of “hero.script” in the “getting started tutorial” coz it actually fits on my hero…but what i really cant get is that - i want my hero to move in the ground automatically by itself…when i used the code and run the game… my hero can jump whenever i pressed the space key,…but it didnt move on its current position,…so i tried to modify the hero.script…i tried to delete first this code “go.set_position(go.get_position() + self.velocity * dt)” and then replace this code to it ( in the function update(self, dt)
function update(self, dt)
local speed = 300
local p = go.get_position()
p.x = p.x + speed * dt
go.set_position(p)
end
when i tried to run the game,…the frog can now run into the platform…BUT it cant jump from the ground…note that i actually set the frog on the ground (Y =30) …and whenever i change it’s position (Y = 130 and above) …it can actually run in the air without collision from the ground…so i think there is a problem in the code that i was used…can you guess whats the real problem that am i facing?..coz actually my brain is start to shrink right now… thanks for your time to read this and more power to you guys…