ackvonhuelio you just did the whole entire game for me which was uh not expected
getting undefined error in my tower defense game
ackvonhuelio and yes this is complicated
- Edited
ackvonhuelio yeah you damn well need to give me a documentation on this because i have no clue of how this works
- Windows
ackvonhuelio teach me how u do font thing
-wyi that was me and i used impixel's official codeorg forum post
https://forum.code.org/t/font-question-for-game-lab/35924/3?u=pluto
- Windows
Would you guys mind if I used this as the code basis for a game where it's tower vs tower and they move?
Sorta like starcraft but also not.
You play as a person who's goal is to A: Survive
and B: Keep people from dying.
You are caught in the crossfire of 2 sides:
One is 2 incredibly strong fighters, With high move speeds, regen abilities, heavy yet fast melee attacks, and the ability to launch missles which deal splash damage, and lasers cutter attacks, which have to lock on a target first.
The other is basically just normal people, in far larger numbers. They have several classes:
Boss: Voxel. Flame thrower, fire capsule (splash damage grenade), Holograms, and can call in RC-probe things to support him. High health.
Standard soldier: Shotgun, fire capsule. moderate health.
Arsonist: Can place down a fire turret, can call in probes (these ones shoot fire). Fire capsules.
Inhibitor: Can place down fire turrets, call in probes, place holograms of both allies and enemies,
ackvonhuelioLvl 41
pluto
not even close
i didn't implement:
moneys
abilities
winning
losing
more than 1 level
loadout selection
so theres plenty more for u to do
ackvonhuelioLvl 41
pluto
so basically what i did:
- replaced all the redundant switch statements with for loops so you don't have to manually plug in every hotbar slot, type of tower, and enemy
// to remind you how a for loop works:
for(var i = 0; i < array.length; i++){
// create variable i and iterate from zero to the length of the array
console.log(array[i]);
// print the ith object in the array, since i goes from zero to the length of the array everything in the array is printed
} - added different types of enemies
- added wave setup variable(creates enemies at specified locations after specified delays with optional messages)
- added pivot setup variable(creates a bunch of points that will turn enemies when they touch them, causing the enemies to follow a path).
You can make these pivots visible by changing the variable at the top of the code. - fixed enemy+tower size, stats, movement, and shooting.
enemies/towers/bullets have all the basic attributes, like health and speed, as well as a 'data' attribute which is all of the stats from their type.
ex:enemy.health
gives current health,enemy.data.health
gives the max health of all enemies of that type. - got rid of all the setIntervals and replaced them with frame-based timing, general advice unless ur making a rythm game or animation or somethin don't use setInterval.
ackvonhuelioLvl 41
- Edited
-wyi
if you can understand my messy code sure i guess
- Windows
ackvonhuelio Your stuff is confusing but I'll figure it out well enough with time.
[unknown] i thought i had a basic knowledge of arrays, but i don't lol
- Windows
ackvonhuelio
What do the variables "i" and "q" on lines 325 - 347 do? I'm kinda just trying to use to code as a way to make an A.I. that shoots other A.I.s of different factions.
ackvonhuelioLvl 41
[unknown]
i and q are parts of the for loops
see my above comment for reminder on how for loops work
lines 379 and 381 are leftover from plutos original code, its doing absolutely nothing but i never bothered to delete the variables
- Windows
ackvonhuelio
yep I'm dumb as shit cause I don't understand that