Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 New project... what's that game called?
Index -> Programming, Turing -> Turing Submissions
View previous topic Printable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
NikG




PostPosted: Mon Mar 20, 2006 9:27 am   Post subject: New project... what's that game called?

Hey all, I've attached a demo of my latest project.

It's an attempt at that game where there's a city on the bottom, and missiles (?) are coming down from the top and you have to destroy them by clicking in their path and setting off a bomb (?). I forgot what it's called... I called it City Defender for now.

I've already started working on the city, a end of stage shopping system (where you can purchase different bombs and shields), and a few other things.

Questions:
1. What is the original friggin name of this game???

2. As you can see, all the missiles begin dropping/firing at the same time. How can I randomize the time for them to start?
(Note: I have not used any processes after reading a lot about how much they suck on this forum, although I think it would make coding this game easier).


Edit: v0.5 removed, v0.7 uploaded. See post #4 below.
03/28/06 Edit: v0.7 removed, v0.81 uploaded. See last post by me below.



CityDefender v081.zip
 Description:
City Defender v0.81
(Note: left-click for bomb, right-click for cBomb, middle-click for nBomb)

Download
 Filename:  CityDefender v081.zip
 Filesize:  273.94 KB
 Downloaded:  176 Time(s)

Sponsor
Sponsor
Sponsor
sponsor
Andy




PostPosted: Mon Mar 20, 2006 9:48 am   Post subject: (No subject)

doomsday
chrispminis




PostPosted: Mon Mar 20, 2006 11:35 pm   Post subject: (No subject)

Hmm you sure? I don't remember myself but that doesn't ring a bell. But boy this brings back memories! Of being six and playing SkiFree, DoomsDay (if you insist), and Millipede, god that was great.


EDIT : Actually inspires me... since now we have a SkiFree and a DoomsDay copy, perhaps I'll try my hand at Millipede. Then I'll have my nostalgia trio completed!
Tony




PostPosted: Mon Mar 20, 2006 11:39 pm   Post subject: (No subject)

all the more fun to play your favourite games in open-source as you can customize the experience to what you really want Wink

want to spawn some extra widgets? tweak the force of gravity? you know where to look Laughing

(all of this is so much more fun with Ruby, as you can make all such changes in real time as you play the game)
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
NikG




PostPosted: Tue Mar 21, 2006 12:55 am   Post subject: UPDATED!

I just completed my demo version 0.7 (GET IT FROM THE FIRST POST).

Game engine is pretty much done; I've even got the code in place for shields and super bombs. I've just got to add the city (along with city collision) and the shopping system.


Anyways, for this version get the highest score you can after 5 stages or after using 20 bombs, whichever comes first.

My best is 230 (of a possible 300... Sad)
TheOneTrueGod




PostPosted: Tue Mar 21, 2006 3:26 pm   Post subject: (No subject)

Nice work. I noticed that when you hold the mouse button down it throws multiple bombs. Since I don't have the source, I don't know what you were actually doing, but what it looks like is:

code:

If mousebutton = 1 then
   bombcount += 1
   bombx(bombcount) := mousex
   bombx(bombcount) := mousex
   delay(100)
end if


Instead, try having an old button variable, and just before you call mousewhere, set oldbutton to mousebutton. Then, instead of the above code, use something like:

code:

If mousebutton = 1 and oldbutton not= 1 then
   bombcount += 1
   bombx(bombcount) := mousex
   bombx(bombcount) := mousex
end if


Other than that, excellent work.

+Bits

PS:(I swear this game was called missile defence...)
codemage




PostPosted: Wed Mar 22, 2006 9:13 am   Post subject: (No subject)

Ditto on missile defence.
NikG




PostPosted: Wed Mar 22, 2006 10:54 am   Post subject: (No subject)

Thanks to TheOneTrueGod for helping me with that mouse button hold-down bug. I wasn't gonna bother trying to figure how to fix it until later, but you did it for me.

Updates to the game:
- I've added a purchase screen with a decent interface.
- I've draw 5 cities (using 3 different boxes places in different order, haha)
- I've added missile-city collision, although I'm still trying to make this better.
- I'm still working on the shields

The game will be tough! I guarantee it.
Expect v1.0 out soon; I promise I'll put it up with the full source code.
(Note: v1 will not technically be complete... I might have an intro, but probably no menu and no highscores feature, although those things are in the plans)

(And incase anyone points out, YES the graphics are crap but I just don't find creating graphics nearly interesting enough to justify the time I would spend on them.)
Sponsor
Sponsor
Sponsor
sponsor
TheOneTrueGod




PostPosted: Wed Mar 22, 2006 5:24 pm   Post subject: (No subject)

Oh yah, also, for the random falling at the same time thing, alls you gotta to is randomize their start Y position.

Basically, from what I can gather, the set BombY code would be like:

BombY (Bombcount) := maxy

what you want to do is simply

BombY (Bombcount) := maxy + Rand.Int (0,100)

Or change the 100 to whatever you want the change in height to be.

Sorry: I know I didn't use code tags, but I didn't feel it was worth it for one line of code.
NikG




PostPosted: Thu Mar 23, 2006 9:47 am   Post subject: (No subject)

Thanks again, TheOneTrueGod!

I don't know why I didn't think of that!
This whole time, I've been trying to find a good way to use a delay for the start time (without using proesses) and you just gave me a much simpler solution.


Question:
I just read a great tutorial on writing text using the Font command by basketball4ever (see it here).
My question is: does it work exactly like locatexy?
To clarify: locatexy looks for the closest actual row & column to place the text in; does Font.Draw do this too, or does it actually draw the text in the exact x&y coordinates passed to it?
TheOneTrueGod




PostPosted: Thu Mar 23, 2006 4:41 pm   Post subject: (No subject)

It draws the text at the exact x,y provided.

It draws the font relative to the lower left of the font. So, if the string you wanted to output was "Hi", the bottom-most left pixel of the "H" would be at the (x,y) co-ordinates provided.

If you want to have text that moves with an object, you will need to centre it around that object. To do that, theres a simple equation.

First of all, you need to know the font size you are using (I assume you will know this, because you are going to be creating the font anyways Razz)
For this demonstration, i will use the letter "s" to resemble the size.

The (x,y) parameters you pass to Font.Draw should be as follows:

objectx - (length("*String you want to be written*") div 2) * s,objecty + objectheight + (Distance you want between the top of the object and the bottom of the text)

Hope that helps (And I hope I didn't say something wrong there)
chrispminis




PostPosted: Thu Mar 23, 2006 8:34 pm   Post subject: (No subject)

ditto on ditto on Missile Defence.

It's been forever since I've seen ditto used seriously, I was actually just discussing that with someone today lol.
NikG




PostPosted: Tue Mar 28, 2006 1:12 am   Post subject: v0.81 of Doomsday, Missile Defense, City Defender

It's been a while since I posted something... I haven't had a lot of free time lately, but I've tried to squeeze in an hour here and there whenever possible.

v0.81 is available from the first post. Lots of updates since the previous post, including cities, shields, bigger bombs, a scoring system, and a couple of bug-fixes (thanks TheOneTrueGod). About 850 lines of code, a lot of which is from fully functional (hopefully) shopping and defenses screens.
(ignore the crappy explosion and 'city defenses' animation)

Let me know of any bugs you come across, or any other improvements you'd like to see.

Edit: forgot to mention: use left-click to use normal bombs, right-click to use cBombs, and middle-click to use nBombs.
Display posts from previous:   
   Index -> Programming, Turing -> Turing Submissions
View previous topic Tell A FriendPrintable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 13 Posts ]
Jump to:   


Style:  
Search: