Oh ok. Well I just got a good idea for a spell randomly lol. A spell that blurs everything and makes you're enemies blind. Probally hard to do. But i've seen people make small little codes for pixelizing and stuff like that.
P.S. by blind I mean just mess up the AI so they attack and move randomly.
EDIT TO AVOID DOUBLE POSTING:
I'm confused on what I can do. While you're just recoding. I don't know what I can really add too it until you redo basically everything before. If you can give me something to add I can try to do it.
Second Edit:
You really only check this everytime you update... I understand real-life stuff, well, not really lol. I have nothing to do... thats probally why I check all of the forums everyday lol. When school starts I'll probally be just as busy. So anyways, I guess the most I can really do at the moment too is give code snippets, i probally have some horrible ways too do stuff. And most likely some bad habits. But if I come up with something. I would help in whatever way I could.
Also, can you sort of clean this up and help me a bit with it?
I'll attach the file with my horrible temp images too.
Rem Project: Hunter
Rem Created: Sunday, August 28, 2011
Rem ***** Main Source File *****
Rem =============
Rem = MAIN LOOP =
Rem =============
do
State = 6
If State = 0 then gosub Menu `Menu
If State = 1 then gosub Game `The game
If State = 2 then gosub Difficulty `For new games.
If State = 3 then gosub Pause `InGame pause menu.
If State = 4 then gosub Save `Saving, dur.
If State = 5 then gosub Load `Loading.
If State = 6 then gosub Init `Probally should have done this first...
If State = 7 then gosub Options `Menu
loop
Rem =============
Rem = Variables =
Rem =============
Init:
Rem If you're wondering, playerY and playerX is in the game loop, not main loop.
Global Monster01X = 0
Global Monster01Y = 0
Global Monster02X = 0
Global Monster02Y = 0
Global Monster03X = 0
Global Monster03Y = 0
Global Monster04X = 0
Global Monster04Y = 0
Global Monster05X = 0
Global Monster05Y = 0
Rem Difficulty, tracked by variables. 0 = Off, 1 = On
Global Easy = 0
Global Normal = 0
Global Hard = 0
State = 0
Return
Rem So obviously 5 is the limit at the moment. Easy too add more, but 5 is good for now.
Rem ===============
Rem = Subroutines =
Rem ===============
Menu:
wait key
`Menu Goes Here
Return
Options:
`Options Go Here
Return
Rem |===========- SubMenus -============|
Game:
Gosub Vars
For i = 1 to 3
Load image "Media\Terrain\Grass.png", platformID(i) `Terrain, for collision.
next i
Load image "Media\Mobs\HunterStatic.png", 1 `Mobs and animations go here.
Rem =============
Rem = Game Loop =
Rem =============
Gosub Vars
Do
Anim = 0
paste image BG, 0, 0 `We don't have one yet, but background is loaded here.
For i = 1 to 3
Sprite platformID(i), platform1_X(i), platform1_Y(i), platformID(i)
next i
If jumping = 0
old_Y = playerY
endif
Sprite playerID, playerX, playerY, imgnum
jumpmax = old_Y - 150
Gosub PlayerInput
Gosub PlayerAnim
Gosub Title
Gosub Gravity
Gosub Collision
Sync
Loop
Vars:
playerID = 1
BG = 100
gravity# = 3
jumping = 0
jumpspeed = 2
playerX = 25
playerY = 0
falling = 0
Rem Animation
anim = 0
fright = 1
frame = 0
imgnum = 1
dim platformID(3)
dim platform1_X(3)
dim platform1_Y(3)
for i = 1 to 3
platformID(i) = 100 + i
next i
platform1_X(1) = 20
platform1_Y(1) = 50
platform1_X(2) = 50
platform1_Y(2) = 150
platform1_X(3) = 100
platform1_Y(3) = 250
ink rgb(255, 0, 0), 1
title$ = Hunter
tx = Screen Width()
ty = 0
return
Title:
text tx, ty, title$
tx = tx - 1
if tx+text width(title$) < 0
tx = screen width()
endif
if jumping = 0 and falling = 0
text 100, 500, "On Ground" `Temporary.
endif
if jumping = 1
text 100, 500, "Jumping" `Temporary.
endif
if jumping = 3
text 100, 500, "Falling" `Temporary.
endif
if falling = 1
text 200, 500, "Falling" `Temporary.
endif
Gravity:
if falling = 1
playerY = playerY + gravity#
imgnum = 6
endif
if jumping = 1
imgnum = 5
playerY = playerY - (jumpspeed*3)
endif
if playerY <= jumpmax
falling = 1
jumping = 3
endif
Return
PlayerAnim:
if anim = 1
imgnum = 2 + (frame/2)
frame = frame + 1
of frame >= 4 then frame = 0
else
imgnum = 1
endif
return
Collision:
if sprite collision (playerID, platformID(1)) = 1
falling = 0
jumping = 0
playerY = playerY
endif
if sprite collision (playerID, platformID(3)) = 1
falling = 0
jumping = 0
playerY = playerY
endif
if falling = 0 and sprite collision (playerID, 0) = 0
falling = 1
endif
return
PlayerInput: `If you think we need to change the controls, go ahead. Just tell me.
Rem === Walk Right ===
if rightkey() = 1
if controlkey() = 1
Rem === Run Right ===
playerX = playerX + 3
endif
playerX = playerX + 2
if fright = 0
mirror sprite 1
fright = 0
endif
anim = 1
endif
Rem === Walk Left ===
if leftkey() = 1
if controlkey() = 1
playerX = playerX - 2
endif
playerX = playerX - 3
if fright = 1
mirror sprite 1
fright = 0
endif
anim = 1
endif
if spacekey() and jumping = 0 and falling = 0
jumping = 1
endif
Rem Player Reset
if inkey$() = "r"
playerX = 25
playerY = 0
endif
return
Difficulty:
Pause:
Save:
If file exist ("Data\Save01.dat") = 1 then delete file "Data\Save01.dat"
open to write 1, "Data\Save01.dat"
write long 1, playerX
write long 1, playerY
write long 1, Monster01X
write long 1, Monster01Y
write long 1, Monster02X
write long 1, Monster02Y
write long 1, Monster03X
write long 1, Monster03Y
write long 1, Monster04X
write long 1, Monster04Y
write long 1, Monster05X
write long 1, Monster05Y `You get the idea.
write long 1, Easy
write long 1, Normal
write long 1, Hard
write long 1, State `Don't know if I have to save this... but better safe then sorry.
close file 1
wait 1000
If file exist("Data\Save01.dat") = 1
Set text font "Courier"
Center text 320, 160, "Saved! Press ANY Key To Continue."
sync
wait key
Else `Corrupted file check. (Or crash, both I guess.)
Center text 320, 160, "Save Failed. Corrupt file. Press ANY key to continue."
sync
wait key
endif
Load:
`Loading goes here, I will do it later.
Rem |===========- SubMenus -============|
Rem =============
Rem = Functions =
Rem =============
Too lazy to make a signature.