Elemental rebooted Devlog

Hey it’s me again! I am back with another devlog (I’ll get back to the peanut butter tree roguelite soon) on my new and hopefully finished game called Elemental. You may have seen my elemental posts before but this is it I will make it with my knowledge of makecode TS (not that much) and hope to share it with you guys.

People who I think need to or should watch this topic

@VoxelMaster64 and @WoofWoof (gonna have fun debugging my spaghetti code, @Luke (loves sts may love this) , and @Hulahoop (probably maybe hopefully gonna playtest as someone who hasn’t played sts and testing difficulty of game)

I would say this game is very much unfinished and will take a while to code and draw art for. Stay tuned and please set this topic to watching. Here is the link to the project:

[My project](https://makecode.com/idonthaveaunbuggedlinkbutidontneedhelpyetsoyougetthisplaceholderlinkinstead)

Large wall of text

What is Elemental?

Elemental is going to be a roguelike game where you collect cards to attack enemies and block their attacks. You will be able to collect special cards that can Materialize Elements and Consume Elements. When you Materialize an element you get lasting effects while it still is active and when you consume elements you gain a strong short term bonus like extra damage or applying a debuff to an enemy. There will also be lore in the game (I will put the untranslated version in a comment for the mods).

Progress so far

What I have done so far:

  • set up my basic card class(need to implement render and overlap event method inside of it)
  • set up a position interface
  • made working card rendering(not very good)
  • working overlap and hitbox interface
  • working browser events(I am using the game—light version check out this topic!)
  • working assets

What I still need to add:

  • Enemies and behaviors
  • Better card rendering and adding more properties on cards (energy cost, other effects etc.)
  • Working hand, draw pile and discard pile
  • Events like shop and bosses
  • More cards and card rewards
  • Gold(currency)
  • Adding element system and effects
  • Adding the actual main character
  • Map for game (different from sts map)
  • smooth transitions and movement of cards(may make my own version of @ChimbroDaPro’s easings)
  • custom status bars with more customisability(yes I use American English) and because normal status bars are sprites iirc and I have to make them images
  • This is most likely not all if my 4gb Chromebook runs this at a crisp 80 fps or more after my final update I may add more content until it hits a solid 60fps most of the time(15 cards on screen with 10 relics is my baseline)
7 Likes

what is “sts”? and sure i cant playtest to see how difficult it is. I’m a gamer. of course i will

2 Likes

Progress update (also mods can you fix the hyperlink pls to be my project also please remove the I also after “the here will also be lore in the game (I will put the untranslated version in a comment for the mods).”)

I am working on a lerp method that I will add to the position interface(will become a class) or make a function out of. Now you may be asking what is lerp. Lerp or linear interpolation is a way to make an object move smoothly by inputting a start value, an end value, and a time value. Think of the time value as a slider between the start value and the end value. Now when you increase the time value the output value becomes greater and vice versa. this is the basic function(linear):

function lerp (start: number, end: number, time: number) {
    return start + (end - start) * time
}


now let us test it out shall we. We will apply lerp to a sprite and use a value that changes every game update called “larper”.

function lerp (start: number, end: number, time: number) {
    return start + (end - start) * time
}
let mySprite = sprites.create(assets.image`pinkPlaceholder`, SpriteKind.Player)
let larper =0
game.onUpdate(function() {
    larper+=.1
    mySprite.y=lerp(10,50,larper)
})

But wait our sprite keeps moving on forever without stopping at 50!!We need to clamp the value of “larper” between 0 and 1 the acceptable parameters of the time parameter. we will use Math.constrain to clamp it(you could also use Math.max)

function lerp (start: number, end: number, time: number) {
    return start + (end - start) * time
}
let mySprite = sprites.create(assets.image`PinkPlaceholder`, SpriteKind.Player)
let larper =0
game.onUpdate(function() {
    larper+=.1
    larper=Math.constrain(larper,0,1)
    mySprite.y=lerp(10,50,larper)
})

Now our sprites y goes from 10 to 50 and stays like that but it doesn’t have ANY flair to it so lets square our time value to make it look like it’s falling. We edit the lerp function and make it use *(time**2) instead of *time. Now here is our final version:

function lerp (start: number, end: number, time: number) {
    return start + (end - start) * (time**2)}
let mySprite = sprites.create(assets.image`PinkPlaceholder`, SpriteKind.Player)
let larper =0
game.onUpdate(function() {
    larper+=.1
    larper=Math.constrain(larper,0,1)
    mySprite.y=lerp(10,100,larper)
})

Well that is all from me. Have fun guys!!

1 Like

Since your link is not a valid link, no. When you have a valid link and wish to update it, then let us know.

Done.

Also, for your lerp() function, you may instead wish to extend the sprites.ExtendableSprite class. Should make things a little simpler for you to implement the function.

4 Likes

Sure I can help (assuming I have time)! When you send the project I’ll probably try to organize it at least how I would.

3 Likes

oh ok uh sts is short for “Slay the Spire”. Slay the Spire is one of the most influential deck builder roguelikes of all time. Also it involves a lot of synergies and probably some critical thinking skills which personally made it take 20hrs for me to beat 1 run in sts. Anyways I incorporated a version of the defects mechanics (orbs) into it and gave it quite a twist

3 Likes

uhh game—light doesn’t have sprites… like at all I use images drawn to screen via game.onPaint with a render function and stuff also replace it with this buns link with like nothing on it:

also I use 4 points because I might rotate it(not too sure since @Luke’s rotates it and it has some performance issues)

its a slider between 0 and 1. The “between the start value and the end value” you discribed is the output.

If I were you I wouldn’t directly edit lerp as that makes it not lerp anymore.

(also for the whole thing is add 0.01 to lerper to make it slower)

2 Likes

GGHVELDH alright alright!!! okay, I made that one change you asked for (honestly i guess maybe its not that bad of a change, but… whatever), so yeah, all done, you dont have to make your own easing extension, you still CAN, but like… Ive added a sprite parameter and it does work, I just didnt feel it was a necessary change given it just makes it less tedious instead of actually making something new… but yeah its there now.

3 Likes

probably gonna yoink some of @ChimbroDaPro’s easing stuff or I’ll just make my own functions.

Anyways I’m drafting a really long explanation on how my code works(dw I’ll post it soon). My coding is going good(don’t wanna jinx it) and i’m hoping for a release before August 2027. I will not pressure myself and call this a deadline as I am kinda burnt out from coding on it(that’s why I’m making my code explanation). It is getting late rn probably should sleep soon.

2 Likes

PEANUT BUTTER TREE!?

(cmon don’t be shy share the location​:upside_down_face:)

1 Like

what if I told you I rewrote pretty much all of it… Also can I assume your not coding in blocks at all for this?

2 Likes

I finished looking at it! Don’t worry, I didn’t change that much. I only added a scene handler, a sprite system, and… um….… oh wait that’s actually a lot. But the point is it should be easier to handle. If you find any bugs with the system then I will try to fix them.

3 Likes

Nice Man I’ll check it out on my Chromebook soon(I didn’t need the scene system just wanted it for browser events compatibility lol)

2 Likes

k so riddle me this how the HELL does this work. I swear ts is just magic anyways thanks a lot but I may uhh not use it because I have not a clue on how entity works. Its not you it’s me xD. The code that gives me a lot of confusion is scene.ts and entity.ts. I might make my own version of entity.ts to create pseudo sprites(with more perf).

2 Likes

*blame it on one man, cat or dog, woofwoof. Anyways uhh @ChimbroDaPro how do i explain it.., oh right it wont work since sprites don’t exist in this version. Also after many thinking’s and more, I have decided to switch to using buttons(maybe since I’ll try to port it to hardware).

1 Like

I would assume that there is 4 sprites there? and that when you overlap either of them. it raises the orange sprite?

1 Like

If it doesn’t need multiple scenes then do this. Also, the point of scenes and such is to keep code organized.

1 Like

extending a class shouldn’t cost performance. also I’d look at card.ts if I were you. basically the Entity class is for making other entity classes like PlayerCard, EnemyCard, Words, etc. and keeps the code clean.

1 Like

Uhh nooo he actually genuinely made his own pseudo sprites (just for overlap). It’s crazy stuff man!!