Gorilla Game
Community Forums/Showcase/Gorilla Game
| ||
EDIT I think I may just set this project aside and work on something else because there are more things I still want to code. Here is a game i've been working on since before GIAong. GIAong was just a pong remake to see if I could do it in 3D. R to spawn high in the air,P to pause F to spawn an enemy ^Only works into V2^ Enter\Return to Reload map Left,Right,Up,Down arrow buttons work The Up and Down buttons zoom in and out so you can get a closer look at the textures If you zoom in too much, the camera will get stuck. I do not intend on having the zooming option in the final version. ^Only works into V4^ Update 5/18/2008-GorillaV2 http://rapidshare.com/files/115388297/GorillaV2.zip Update 5/19/2008-GorillaV3 http://rapidshare.com/files/116162181/GorillaV3.zip Update 5/25/2008-GorillaV4 http://rapidshare.com/files/117658022/GorillaV4.zip |
| ||
Right now I'm working on changing the player code to a Type and it's not easy. Actually... it is... but trying to fix all the problems that comes with it isn't. Like, if I spawn 2 players and I'm controlling the second one, I hit the enemy on the head and then it gives me an error. It says that the enemy doesn't exist after I killed it. But if I would have killed that same enemy with the first player spawn, it would've died without a problem. So now I'm just plain confused about that but I'll just keepa workin. EDIT: Ok this is weird, If I have 2 players spawned and the first spawn kills the enemy, it still gives me the "Object does not exist", error. But if I do It with only one player spawned, it goes just fine. Any ideas why? Hm? Perhaps? Maybe? Possibly? EDIT2 Nevermind, it's not working either way... *sigh* EDIT3 AWRGHHH ITS MESSING WITH MEH MIND! I switched the placement of the function that checks the status of the Kangaroo enemy, and now it lets me kill it with only one Player spawned but still not with two. EDIT4 I tested 2 players with two camera viewports so i could see which was which and it seems the player 2 CAN kill the kangaroo but now player 1 can't. So if one player is spawned, that player can kill the enemy. But if 2 are spawned, only the second one can kill it. Also, if the enemy falls of the level and gets deleted, it's the same code as if it loses it's health If All\health =< 0 p\Score = p\Score + All\GiveScore FreeEntity All\mdl Delete All ElseIf EntityY(All\mdl) < -8 FreeEntity All\mdl Delete All EndIf So now I really have absolutely no idea what is wrong here :( |
| ||
You'd need to post more code and best to do it in the beginner forum rather than the showcase. |
| ||
I'm meerly showing off what I have so far, the rest of what I'm saying is just complaining lol. If I really really can't figure out my problem, I'll go ahead and ask... I'll figure it out one way or another. |
| ||
Deletion problems are a common mistake. Just make sure you don't call the Delete till the end of the For alliteration loop. I usually use a simple Bool variable to deside whether the delete is called. Then use if/else statements to decide if it still exists or not. |
| ||
The thing is, all went well until I introduced the Player type. The Enemy type was dependent on just the "anim = LoadAnimMesh("myanimmesh")" and now that there's more then one player, it's not sure what to do. For example, I had it cam = CreateCamera() anim = LoadAnimMesh Function Enemy_controls(All.Enemy) If EntityInView(All\mdl,cam) = 1 Then If EntityInView(All\mdl,cam) = 1 If EntityX(anim,True) < EntityX(All\mdl,True)... ... That was all I needed to put into the enemy functions And since I changed the player to Types i've used this p\cam = CreateCamera() p\mdl = LoadAnimMesh Function Enemy_controls(All.Enemy,p.Player) ;For All.Enemy = Each Enemy ;For p.Player = Each Player If EntityInView(All\mdl,p\cam) = 1 Then If EntityInView(All\mdl,p\cam) = 1 If EntityX(p\mdl,True) < EntityX(All\mdl,True)... ... I do want a camera per player so if I ever add multiplayer it will be there. Anyways, here is where it gives me the "Object does not exist" error after the entity is freed and deleted Function Enemy_check_status(All.Enemy,p.Player) If All\status = 0 Then Enemy_check_below(All) Enemy_controls(All,p) Enemy_player_inertia(All) ElseIf All\status = 1 Then Enemy_controls(All,p) Enemy_player_inertia(All) Enemy_jump_up(All) Enemy_check_above(All) ElseIf All\status = 2 Then Enemy_controls(All,p) Enemy_player_inertia(All) Enemy_fall(All) Enemy_check_below(All) End If End Function It highlights the "If All\status = 0 Then" part and shows me the error. Which doesn't explain too much to me. My conclusion is, they die just fine when they're hit by the newest type created. But if there's two player types spawned, the old/first one will give you an error if it touches it. |
| ||
Wewt, I fixed the problem. I added this into the UpdateEnemy functionIf Handle(All) <> 0 ...code endif and now it doesn't give me the "Object does not exist" error anymore. Me so happppy! |
| ||
Old news... There have been updates! |
| ||
The gorilla doesn't look so blocky now on V4... http://rapidshare.com/files/117658022/GorillaV4.zip Tell me what you think of the new gorilla :) Should I keep the old one or the new one? |