This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
Messages - Doomkiller
Pages: 1 ... 8 9 10 11 12 13 14 [15] 16 17 18 19 20 21 22 ... 115
281
« on: September 14, 2011, 04:40:57 AM »
E1M2 - Sonic Clang
Cookie to person who guesses what game it is from
It's from Doom
Which Doom though?
282
« on: September 13, 2011, 07:21:50 AM »
E1M2 - Sonic Clang
Cookie to person who guesses what game it is from
283
« on: September 12, 2011, 02:48:52 AM »
Doom, you forgot Worm 8. And RPJK, I can't make so long team name.
Oh err, Pinky :) *plus 1 to those that get the reference*
284
« on: September 11, 2011, 06:40:59 AM »
Team Name - The Doomed Ones Worm 2: Sgt Doom Worm 3: DeadTarget Worm 4: Dawn of Doom Worm 5: Blaze Of Doom Worm 6: Doom Hurricane Worm 7: CyperDemon CPU Skill: 5 (well I did own in Worms 3d..) Gravestone: A heckish looking one? Special Weapon: Holy Hand Grenade (for the irony) Language: A demon type one, if not Australian Winning song: Australian I guess :P Flag: same as above
There :P
285
« on: September 11, 2011, 06:25:34 AM »
Doom 3?
286
« on: September 11, 2011, 05:44:13 AM »
Left 4 Dead "I'll see peace back on earth if I've gotta murder these bots with my bare hands!" LW - Common Infected MW - Hunter HW - Witch AW - Boomer BW - Smoker SHW - Tank
Funny, I actually had a Left 4 Dead team for Backlash before :P Cept it went LW - Hunter MW - Charger HW - Tank SHW - The Witch All were VSes, cept for the Witch (fs)
287
« on: September 11, 2011, 05:37:06 AM »
10 years ago, at the same day, we bought "new" car, Blue Toyota Corolla.. When we were going home, we heard recent news from the radio... When we arrived home, dad turned up the TV and wwatched the broadcast... Though I was so young so I didn't understand what happened...
Anyway, it's very sad that this did happen... I wish that this kind of horrible terrorism wont happen ever again...
Hahaha, sounds like what I did when this happened As my mum said: "Mummy, there are crashing planes into building" Mum thought I was joking till she saw the news :P
288
« on: September 09, 2011, 09:09:09 PM »
Haha I know the feeling :P
289
« on: September 09, 2011, 05:29:43 AM »
I pretty much like just about every genre, as long as its done well. What defines as done well, thats personal opinion really
Atm, heavily into MMO rpgs (WoW, Aion, MapleStory), but still play Doom 3 and minecraft from time to time
290
« on: September 09, 2011, 02:02:09 AM »
Also, you should keep using Python, it's a much wider used language than AS. And yes, you can write games with it. Check out PyGame (very easy game library) or pyglet (very advanced multimedia and OpenGL framework).
It's only because im doing AS in class, and Python was for the programming challenge that I was doing
291
« on: September 07, 2011, 10:44:50 PM »
292
« on: September 07, 2011, 07:11:46 PM »
 :P Nice one there, Doom. Care to share the pic?
I can share the whole folder if you want. 41.1mbs
293
« on: September 07, 2011, 07:05:30 PM »
I've never programmed in AS, but I guess in your function checkFor2Hit, the argument should be of SpecialBaddie type, not Baddie (unless you find a way to convert a SpecialBaddie to a Baddie object in AS - in other languages this is called polymorphism).
Thank you so much, can't believe I didn't think of that before :D The game works fine now, so if anyone wants to try it, inbox me and I'll send it to you :)
294
« on: September 07, 2011, 02:01:11 AM »
 :P
295
« on: September 07, 2011, 01:56:38 AM »
Yes, I know. Moved from python to ActionScript now :P Anyway, if anyone is skilled in the way of actionscript, can you please tell me how to fix this problem? Here is the code: stop();
// variables used // var score:Number = 0; var bangSound:Sound = new fire(); var distance:Number = 0; var adjDistance:Number = 0; var radians:Number = 0; var dx:Number = 0; var dy:Number = 0; var gunLength:uint = 90; var bullets:Array = new Array(); var bulletSpeed:uint = 20; var baddies: Array = new Array(); var specialbaddies: Array = new Array(); var timer:Timer = new Timer(1000); timer.start(); var side:Number = 0; var life:Number = 3 var target:MovieClip;
// event listeners// stage.addEventListener(MouseEvent.MOUSE_MOVE, aimGun); stage.addEventListener(MouseEvent.MOUSE_MOVE, targetMove); stage.addEventListener(MouseEvent.MOUSE_DOWN, fireGun); stage.addEventListener(Event.ENTER_FRAME, moveObjects); timer.addEventListener(TimerEvent.TIMER, addBaddie); timer.addEventListener(TimerEvent.TIMER, addspecialBaddie);
//Outputs life and score// Pscore.text = String(score); count.text = String(life);
//aims gun to the mouse// function aimGun(evt:Event):void { gun.rotation = getAngle(gun.x, gun.y, mouseX, mouseY); distance = getDistance(gun.x, gun.y, mouseX, mouseY); adjDistance = distance / 12 - 7; range.text = "Range: " + String(adjDistance.toFixed(2)) + "m"; range.x = mouseX + 20; range.y = mouseY - 10; }
//gets the angle// function getAngle(x1:Number, y1:Number, x2:Number, y2:Number):Number { radians = Math.atan2(y2 - y1, x2 - x1); return rad2deg(radians); } //gets the distance// function getDistance(x1:Number, y1:Number, x2:Number, y2:Number):Number { dx = x2 - x1; dy = y2 - y1; return Math.sqrt(dx * dx + dy * dy); }
//turns radians to degrees// function rad2deg(rad:Number):Number { return rad * (180 / Math.PI); }
//turns the cursor to the movie clip// initialiseCursor(); function initialiseCursor():void { Mouse.hide(); target = new Target(); target.x = mouseX; target.y = mouseY; target.mouseEnabled = false; addChild(target); }
//moves the movie clip to follow the mouse// function targetMove(evt:MouseEvent):void { target.x = this.mouseX; target.y = this.mouseY; }
//fires the bullet on mouse click in direction of mouse// function fireGun(evt:MouseEvent) { bangSound.play(); var bullet:Bullet = new Bullet(); bullet.rotation = gun.rotation; bullet.x = gun.x+Math.cos(deg2rad(gun.rotation))*gunLength; bullet.y = gun.y+Math.sin(deg2rad(gun.rotation))*gunLength; addChild(bullet); bullets.push(bullet); }
//turns degrees to radians// function deg2rad(deg:Number):Number{ return deg*(Math.PI/180); } //calls the function to move the baddies and bullets// function moveObjects(evt:Event):void { moveBullets(); moveBaddies(); moveSpecialBaddies(); }
//moves the bullets// function moveBullets():void{ for (var i:int = 0; i < bullets.length; i++) { dx = Math.cos(deg2rad(bullets[i].rotation)) * bulletSpeed; dy = Math.sin(deg2rad(bullets[i].rotation))* bulletSpeed; bullets[i].x += dx; bullets[i].y += dy; if (bullets[i].x < -bullets[i].width || bullets[i].x > stage.stageWidth + bullets[i].width || bullets[i].y < -bullets[i].width || bullets[i].y > stage.stageHeight + bullets[i].width) { removeChild(bullets[i]); bullets.splice(i, 1); } } }
//adds the baddies randomly// function addBaddie(evt:TimerEvent): void { var baddie:Baddie = new Baddie(); side = Math.ceil(Math.random() * 4); if (side == 1) { baddie.x = Math.random()*stage.stageWidth; baddie.y = - baddie.height; } else if (side == 2) { baddie.x = stage.stageWidth + baddie.width; baddie.y = Math.random() * stage.stageHeight; } else if (side == 3) { baddie.x = Math.random() * stage.stageWidth; baddie.y = stage.stageHeight + baddie.height; } else if (side == 4) { baddie.x = - baddie.width baddie.y = Math.random() * stage.stageHeight; } baddie.angle = getAngle(baddie.x, baddie.y, gun.x, gun.y) baddie.speed = Math.ceil(Math.random()* 15); addChild(baddie); baddies.push(baddie); }
//adds the special baddie// function addspecialBaddie(evt:TimerEvent): void { side = Math.ceil(Math.random() * 40); if (side < 5) { var specialbaddie:SpecialBaddie = new SpecialBaddie(); if (side == 1) { specialbaddie.x = Math.random()*stage.stageWidth; specialbaddie.y = - specialbaddie.height; } else if (side == 2) { specialbaddie.x = stage.stageWidth + specialbaddie.width; specialbaddie.y = Math.random() * stage.stageHeight; } else if (side == 3) { specialbaddie.x = Math.random() * stage.stageWidth; specialbaddie.y = stage.stageHeight + specialbaddie.height; } else if (side == 4) { specialbaddie.x = - specialbaddie.width specialbaddie.y = Math.random() * stage.stageHeight; } specialbaddie.angle = getAngle(specialbaddie.x, specialbaddie.y, gun.x, gun.y) specialbaddie.speed = Math.ceil(Math.random()* 20); addChild(specialbaddie); specialbaddies.push(specialbaddie) } }
//moves the baddies towards the turrent and c if they hit the turrent// function moveBaddies():void { for (var i:int = 0; i < baddies.length; i++) { dx = Math.cos(deg2rad(baddies[i].angle)) * baddies[i].speed; dy = Math.sin(deg2rad(baddies[i].angle)) * baddies[i].speed; baddies[i].x +=dx; baddies[i].y +=dy; if (baddies[i].hitTestPoint(gun.x, gun.y, true)) { removeChild(baddies[i]); baddies.splice(i, 1); loseLife(); }else{ checkForHit(baddies[i]); } } }
//moves the special baddies// function moveSpecialBaddies():void { for (var i:int = 0; i < specialbaddies.length; i++) { dx = Math.cos(deg2rad(specialbaddies[i].angle)) * specialbaddies[i].speed; dy = Math.sin(deg2rad(specialbaddies[i].angle)) * specialbaddies[i].speed; specialbaddies[i].x +=dx; specialbaddies[i].y +=dy; if (specialbaddies[i].hitTestPoint(gun.x, gun.y, true)) { removeChild(specialbaddies[i]); specialbaddies.splice(i, 1); loseLife(); }else{ checkFor2Hit(specialbaddies[i]); } } }
//c if the bullets hit the baddie// function checkForHit(baddie:Baddie):void { for (var i:int = 0; i < bullets.length; i++) { if (baddie.hitTestPoint(bullets[i].x, bullets[i].y, true)) { removeChild(baddie); score = score + 20; Pscore.text = String(score); baddies.splice(baddies.indexOf(baddie), 1); } } }
//c if bullet hit special baddie// function checkFor2Hit(specialbaddie:Baddie):void { for (var i:int = 0; i < bullets.length; i++) { if (specialbaddie.hitTestPoint(bullets[i].x, bullets[i].y, true)) { removeChild(specialbaddie); score = score + 200; Pscore.text = String(score); specialbaddies.splice(specialbaddies.indexOf(specialbaddie), 1); } } }
//c if all lifes a lost, to which it gets rid of all baddies and enters next frame// function loseLife():void { life -= 1; count.text = String(life); if (life < 0){ gotoAndStop(3); if(baddies.length > 0){ for (var i:int = 0; i < baddies.length; i++) {removeChild(baddies[i]);} } if(bullets.length > 0) { for (var i = 0; i < bullets.length; i++) {removeChild(bullets[i]);} } if (specialbaddies.length > 0){ for (var i:int = 0; i < specialbaddies.length; i++) {removeChild(specialbaddies[i]);} } timer.stop(); removeChild(target); Mouse.show(); stage.removeEventListener(MouseEvent.MOUSE_MOVE, aimGun); stage.removeEventListener(MouseEvent.MOUSE_MOVE, targetMove); stage.removeEventListener(MouseEvent.MOUSE_DOWN, fireGun); stage.removeEventListener(Event.ENTER_FRAME, moveObjects); } }
And the error I keep getting: TypeError: Error #1034: Type Coercion failed: cannot convert SpecialBaddie@11c436a1 to Baddie. at ShootingGame_fla::MainTimeline/moveSpecialBaddies() at ShootingGame_fla::MainTimeline/moveObjects()
Now, the game does work, however, whenever the "specialbaddie" enters the stage, that error happens. The 'specialbaddie' still moves, but the collision detection does not work (ie, when the bullet hits the specialbaddie) and even though I made a seperate function for it, it does not work  Any help would be appreciated (for those interested, I can send you the flash file to have a look of the game)
296
« on: September 07, 2011, 01:38:36 AM »
Yeah, I do play it, but havn't touched it in a while. Shame too, cause it is quite a good game :P And I bet my friends on there are missing me xD
After next week though, I should be able to get back into it, so if you ever want to Gazea2 you could pm me your ign and i'll add you :)
297
« on: September 07, 2011, 01:35:33 AM »
Why are we sacking Exo?
Mediocre Employee
Ok, thats just a win :P
298
« on: September 05, 2011, 07:15:58 AM »
Exo sacking? wha? Why are we sacking Exo?
299
« on: September 05, 2011, 06:43:48 AM »
The sound, of nothing
300
« on: September 03, 2011, 08:36:12 AM »
Ohh ok thanks
Also, yeah im used to actionscript atm, hence the // // comments :P
Pages: 1 ... 8 9 10 11 12 13 14 [15] 16 17 18 19 20 21 22 ... 115
|