Skip to content

Commit

Permalink
Ryan attacks
Browse files Browse the repository at this point in the history
Added three Ryan attacks with sprites for the attacks (not player sprites!)
  • Loading branch information
BoomBoomMushroom committed Dec 15, 2023
1 parent 2762f93 commit 31cde92
Show file tree
Hide file tree
Showing 12 changed files with 117 additions and 15 deletions.
14 changes: 7 additions & 7 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,17 +141,17 @@ let characterBuilds = {

"Ultimate": (color, user)=>{},
},
"Jackson": {
"Ryan": {
"Neutral_B": (color,user)=>{},
"Side_B": (color,user)=>{},
"Side_B": (color,user)=>{return RyanChargedSing_SideB(color,user)},
"Up_B": (color,user)=>{},
"Down_B": (summonerColor, user)=>{},

"Neutral_A": (color,user)=>{},
"Side_A": (color,user)=>{},
"LeftSide_A_air": (color,user)=>{},
"RightSide_A_air": (color,user)=>{},
"Down_A": (color,user)=>{},
"LeftSide_A_air": (color,user)=>{return RyanQueenDash_SideAirA(color, user)},
"RightSide_A_air": (color,user)=>{return RyanQueenDash_SideAirA(color, user)},
"Down_A": (color,user)=>{return RyanTapDance_DownA(color,user)},
"Up_A": (color,user)=>{},

"Ultimate": (color, user)=>{},
Expand Down Expand Up @@ -278,10 +278,10 @@ sprites.push(background)

const player = new Fighter({
playerIndex: 0,
characterName: "Cooper",
characterName: "Ryan",
color: 'red',
facingRight: true,
attacks: characterBuilds["Cooper"],
attacks: characterBuilds["Ryan"],

position: {
x: 0 * canvasScale,
Expand Down
105 changes: 105 additions & 0 deletions js/customAttacks.js
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,107 @@ function CooperSideB_LongPunch(summonerColor, user){
return 2000
}

// Ryan Attacks

function RyanQueenDash_SideAirA(color, user){
user.velocity.x = 15 * (user.facingRight ? 1 : -1)

let clearingId = setInterval(()=>{
clearInterval(clearingId)
let eligable = []
for(var i=0;i<entities.length;i++){
if(entities[i].dead) continue
if(entities[i].color != color) eligable.push(i)
}
if(eligable.length==0) return
let targetId = eligable[randomInt(0, eligable.length-1)]
let rise = (entities[targetId].position.y)-(user.position.y)
let run = (entities[targetId].position.x)-(user.position.x)
let speed = 0.025

let e = new Sprite({
position: {
x: user.position.x,
y: user.position.y,
},
imageSrc: './sprites/ryan_images/chess_queen.png',
scale: canvasScale * .25,
framesMax: 1,
})
damageSprites.push({
entity: e,
color: color,
vel: {x:run*speed,y:rise*speed},

dmg: randomInt(5, 15),
life: 10000, // 5 seconds?
uses: 1,
})
}, randomInt(0, 300))

return 8000
}

function RyanTapDance_DownA(color, user){
for(var i=0;i<entities.length;i++){
if(entities[i].dead) continue
if(entities[i].color == color) continue

// no idea how long this is - hope it works!
entities[i].stunFrames = 100
}

return 4000
}


function RyanChargedSing_SideB(color, user){
let keybinds = userKeys[user.playerIndex]
let keyNeed = user.facingRight ? keybinds.Right : keybinds.Left

let holdTime = 0
let maxTime = 2000

let skipTimeMult = 30

let clearId = setInterval(()=>{
user.velocity.x = 0
},1)

let func = function(){
if((keys[keyNeed]!=true && holdTime >= 200) || holdTime>=3000){
return clearInterval(clearId)
}

holdTime += deltaTimeMS * skipTimeMult
let t = holdTime>=maxTime ? maxTime : holdTime
let damage = Math.floor( parabolaGet(1,2,2, t/1000) )

let e = new Sprite({
position: {"x": user.position.x, "y": user.position.y},
imageSrc: './sprites/ryan_images/note'+randomInt(1,7)+'-sheet.png',
scale: canvasScale * 0.1,
framesMax: 13,
})

e.width = 25
e.height = 55

damageSprites.push({
entity: e,
vel: {"x": user.facingRight ? 10 : -10, "y": 0},
dmg: damage,
color: color,
uses: 1,
life: 9000,
})

setTimeout(func, deltaTimeMS*skipTimeMult)
}
setTimeout(func, deltaTimeMS*skipTimeMult)

return 9000
}


// Dillion Attacks
Expand Down Expand Up @@ -376,4 +477,8 @@ function setEntityFrozenFrameAndImageSrc(frozenFrameCount, imageSrc, imageMaxFra
entity.frozenSprite = frozenFrameCount
entity.image = tempImage
entity.framesMax = imageMaxFrames
}

function parabolaGet(a,b,c, x){
return (a*(x*x)) + (b*x) + c
}
3 changes: 0 additions & 3 deletions js/customClasses.js
Original file line number Diff line number Diff line change
Expand Up @@ -750,9 +750,6 @@ class Fighter extends Sprite {
}

this.setSprite(this.sprites[this.lastMove][facing], this.sprites[this.lastMove][maxFramesFacing])

// display the proper sprite
// find this out, either attacking, jump, moving, idle
}

setSprite(spriteImage, maxFrames){
Expand Down
10 changes: 5 additions & 5 deletions notes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,14 @@ Ryan Attacks and Notes
* A Attacks
- Neutral ~ Spout factual nonsence firing a projectile that deals decent damage
- Side ~ Pulls out big ol' book that smack enemies in front of him
- Side Air ~ Dashes forward trying yo stab someone with a chess queen (can spike)
- Down ~ Does the funny little tap dance, minor damage and temp. stuns nearby enemies
- Side Air > Dashes forward trying to stab someone with a chess queen (can spike)
- Down > (SPRITE BASED) Does the funny little tap dance, minor damage and temp. stuns nearby enemies
- Up ~ Smacks the words "no" and "life" together above himself good damge and blasts enemy away
* B Attacks
- Neutral ~ Prays to god, recieves 1 of 5 buffs (damahe, defense, speed, jump, or 1% chance to one-tap enemy)
- Side ~ Sings incredibly loudly and fires a music note towards enemies (damage based on charge)
- Neutral ~ Prays to god, recieves 1 of 5 buffs (damage, defense, speed, jump, or 1% chance to one-tap enemy)
- Side > Sings incredibly loudly and fires a music note towards enemies (damage based on charge)
- Up ~ Pulls out winged shoes and given a moment to target (sepherof up b in smash bros ult.)
- Down ~ Smmons a skeleton that can have a gun, a sword, or a shield that attacks enemies
- Down ~ Summons a skeleton that can have a gun, a sword, or a shield that attacks enemies
* Ultimate
~ God and Goku appear in the background and combine the power to fire a ray of light where targeted (HUGE DAMAGE)

Expand Down
Binary file added sprites/ryan_images/chess_queen.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added sprites/ryan_images/note1-sheet.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added sprites/ryan_images/note2-sheet.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added sprites/ryan_images/note3-sheet.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added sprites/ryan_images/note4-sheet.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added sprites/ryan_images/note5-sheet.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added sprites/ryan_images/note6-sheet.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added sprites/ryan_images/note7-sheet.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 31cde92

Please sign in to comment.