Jill Endless Run

Yes, for example, a functionality that trims or crops the blank or empty space around each frame and keeps the information of the position of the drawing inside the frame, for example:

Or

This happens (at least to me) when you have an animation like “run” where the width of each drawing inside a frame is different, like this:

And

In this last example, the legs are spread in one frame and close together in the other, but you have to keep the size of the images the same to maintain the position of the whole animation.

Or maybe it’s just me that I don’t know how to configurate properly the atlas :sweat:

1 Like

And I guess I could use more than one atlas for all the animations of the same GameObject, right? :thinking:

Success! :grinning:

I resized the animations and it resulted in a 2048x2048 atlas texture! :grin:

And it is working! :smile:

I tested it on a Mac in Chrome, Firefox and Safari, and it seems to be working fine :thumbsup:

Ok, now, before I post it I want to make clear that it is a work in progress, it is a free-time “family” project (my daughter and me) and that I am not an artist, all the graphics are just there as concept, I did all of Jill’s animations and all the other sprites I got them from the internet to save development time :sweat_smile:.

It will not be an endless runner, it will be level based.

Also, for now all the items pop randomly, but I think they should have some order…

The game, as you will notice, is an evolution from the getting started tutorial, and I haven’t finished many, many things, but it is running (and it will continue to run, because it does not have a “dead” state :yum:)

Control:
The space bar is the only input, it is supposed to accept “tap” too, but it is not working yet.
Everything is activated by the space bar, for example, when you are running and press the space bar you jump, and depending on how much you press the space bar is the height of your jump, also when you are on the air and you press the space bar, you activate the current power up. Also when you are running over a box on the floor and press the space bar, you activate it.

Power-ups:
I added some power ups to collect, but I’m still coding what “magnet”, “fly” and “dash” should do. For now fly performs as glide and dash as double_jump.

Boxes on the ground:
The boxes on the ground are activated by the space bar, the try them, although I am still coding the blue one :disappointed_relieved:

The Apples:
They give you health :muscle:

It is supposed to be fun, family game

You can play it here:
http://alethos.xyz/jill_run/

I hope you enjoy it!

3 Likes

Dude, “work in progress” stuff aside, this is great! :slight_smile: Really impressed by the animations of Jill – it really adds a lot of oumph when you work so much on the details like you’ve done; like the wobbly effect when you bounce off of a trampoline. Keep up the great work! What does your daughter think?

1 Like

Nice!!!

I notice that there are some artifacts on the edges on some graphics. To fix that, just set “Extrude borders” in the atlas to 1 or 2 pixels.

2 Likes

Thank you very much @Axel, your words are very encouraging!

I have received a very good response from my daughter :smile:, she’s been involved in the design process, and she is the one pointing out any deficiencies in the animations :stuck_out_tongue_closed_eyes:, she has been insisting me to update the ground imagery, because “it doesn’t feel like they are the same style…” :stuck_out_tongue_winking_eye:

And that makes me very happy :blush:

@sicher, thank you about your tip! Yes, I had noticed those “artifacts” too and I didn’t know how to get rid of them, thanks! :thumbsup:

I will get a new release without the artifacts ASAP!

1 Like

@sicher, thank you, I set Extrude Borders = 2 and there are no more artifacts :thumbsup:

But now, I have a problem with an animation, it’s “fly”, (one of the missing ones), I use frames (PNGs) of different sizes (135x150 and 78x138) and when I run it in the atlas editor (inside Defold) it runs well, but when it runs in-game it “auto-scales” all frames in the animation to the size of the first frame, distorting the ones with different size.

Is there a restriction on the frame size of an animation in that every frame in the animation must be the same size?

I have updated the online version so you can see what I’m talking about, I have set all the power ups to “fly” so you can try again and again the same animation, it’s like flappy birds (flappy jill!)

Thank you

Yes, all frames of a flip book animation must be of the same size.

Thanks @britzl

I will work on that then

Greetings!

Ok, I updated the frame size in the flipbook animation for “fly” and it’s running fine now.

I also added the “dash” power up behaviour, so the only one missing is “magnet”…

Any suggestions on how to implement a magnet power up?
Has anyone implemented a magnet power up in the getting started tutorial?

Hmmm… How to attract the coins in the platforms…

:thinking:

I updated the online version if someone wants to take a look :nerd:

@Edgaronfo

For making a magnet power up I’d make another collision (I’d use a sphere collision box) around the player specifically for the coins and make it toggle-able so when you get a buff it activates for a brief amount of time. When a coin triggers it, just transform it into the player.

Also encase you didn’t know, your online version seems to let the user go off the screen and then the game keeps scrolling without you actually playing anymore.

@sven might have an idea on how to build magnets.

@Giftcard thank you for your observation!, yes, I noticed that before, but right now I am focusing on the game mechanics (and I think I am almost done) and then I will head onto the level mechanics, where I plan to fix that.

About your suggestion for the magnet power up, it sounds good, I’ll take that in consideration, I was thinking something like what the HUD tutorial does but with the coin sprites instead :thinking:

Let’s see what happens… :stuck_out_tongue_winking_eye:

Hi, @jakob.pogulis , do you think you can point me out a little more on @sven 's idea please? I didn’t find anything related :slight_frown:

Thank you :smiley:

I think Sven is home with a fever, otherwise I’m sure he’d provide you with more information. I would probably do what @Giftcard suggested and create a collision object on your player object that will trigger when colliding with coins and when that happens move the coins towards the player’s position.

About how to make magnet - it’s a very simple physics.

See ai_magnet_update function here

and update function here

1 Like

Hi @britzl,

Yes, @Giftcard’s suggestion (and yours) is excellent.

I am only figuring out what to do if the player jumps or falls. The coins must follow the player, right? So I think “someone” has to post a message to each coin with the current positon of the player until the coin disappears… :thinking:

EDIT: I have to update the coin with the player’s position.

And I hope @sven gets well soon! :thumbsup:

@baturinsky Thank you very very much! :grinning:

If I get it right, in the update function, you update the object’s speed and position with the speed and the target position, am I correct?

So when the player’s “big magnet collision object” triggers the coin, I have to start updating the coin speed to get to the player’s position.

Something like:

function update(self, dt)
    ...
    coin_object.set_position(player.get_position() + self.velocity * dt)
    ...

But I’ll have to pass the players’s object id, so the coin can get its position… :thinking:

Thank you again!

You can store player’s id or position itself in a global object.

Your case is simpler than mine, because I sometimes have several magnets dragging in different directions.

You basically needs to do just two things, both can be done in coin’s update cycle: add player-pointing acceleration to coin’s velocity, and add coin’s current velocity to coin’s position. Maybe you’ll also need to apply friction to velocity.

Excellent!

I can store a pointer to the player’s object in the coin, like:

self.player_obj_id = player.id... (something like that...)

So in the coin update function I can get the player’s position like:

local player_position = go.get_position( self.player_obj_id )

Then according to your sugestion (and using your code :stuck_out_tongue_winking_eye:):

1.- “add player-pointing acceleration to coin’s velocity”:

local player_pos = go.get_world_position(self.player_obj_id)
for k,coin in pairs(coins_table) do
    local r = player_pos - go.get_world_position(coin.id)
    local d = vmath.length(r)
    coin.velocity = coin.velocity + vmath.normalize(r) * pow2(1000 / (d + 60)) * self.buff
end

2.- “add coin’s current velocity to coin’s position”:

self.velocity = self.velocity * (1 / (1 + 0.2*dt))
if vmath.length(self.velocity) > 200 then
    self.velocity = vmath.normalize(self.velocity) * 200
end 
go.set_position(go.get_position() + self.velocity * dt)

(I still don’t get very well the thing about normalization… :confused:)

What do you think?