Virus Sector (development thread)

This forum is currently in read-only mode.
0 favourites
From the Asset Store
You can become a REAL game developer. Learn the basics and get resources that will let you get profits from your game!
  • It's the zombie apocalypse.

    Yes, I know. It's been done a million times. But it's been done a million times as an arcade gorefest.

    I have a vision for a zombie survival game, where survival is the main focus, not seeing who can shoot the most targets. I envision a large open world, a city sprawling with infected but also full of much needed supplies. The city is surrounded by smaller suburbs of houses and backyards, and a dense forest surrounds this, scattered with hidden shacks for hiding out in. There is a day and night system, with I am Legend style infected who are vulnerable to sunlight, making day the time to scavenge for supplies and night the time to barricade yourself in, or fight the zombie hordes. There are vehicles, many weapons, an RPG style leveling system, and co-operative split screen play. This is the world I have planned for Virus Sector.

    *cue dramatic music*

    OK, so some history. I was actually working on another zombie game a while back which I also had a development thread for. The project fell over, mainly because I was focused heavily on visual things like lighting and effects, and doing all those instead of creating a working game first. I have high hopes for this project, as it's neatly planned out this time and I'm going to try to get all the main gameplay elements done first, so I can see what I'm working with.

    I made this development thread for 3 reasons:

    1. To showcase the game I'm making

    2. For my own motivation

    3. To get help from the Construct community when I get stuck.

    Now here's the cap: http://dl.dropbox.com/u/7129504/Virus%20Sector.cap (updated with dropbox link, lets hope it works this time)

    Controls:

    Arrow keys: Move

    Press TAB to cutaway the buildings, to see behind them

    Press T to speed up time.

    A screenshot:

    <img src="http://img576.imageshack.us/img576/2851/virussector.png">

    It's still not totally as detailed as I want it to be. This is just a basic image to give you the idea of what it will look like.

  • Hi. The link to your .cap file is bad, so I could not see what you were doing for timekeeping.

    However, it's fairly easy to pad a number out with zeroes to two digits. Here's an example that assumes you have a Text object for display, and use the Date object for the current time:

    + System: Every 1000 milliseconds
    -> Text: Set text to Date.GetHour & " : " & Right("00" & str(Date.GetMinutes), 2)[/code:2o3x8c7e]
    
    It simply converts the minutes to a string with [i]str(Date.GetMinutes)[/i], concatenates that onto the string [i]"00"[/i], then returns the rightmost two characters with the [i]Right()[/i] function.
    
    In this case, you'd probably just need [i]"0"[/i] in place of the [i]"00"[/i], but the two leading zeroes would be needed in case the minutes string ever returned an empty string, depending upon how you keep time.
    
    If you don't know of it, there is a page on the Wiki with a list of helpful functions for use in expessions, such as the str() and Right() functions used above:
    
    [url]http://sourceforge.net/apps/mediawiki/construct/index.php?title=System_Expressions[/url]
  • Ugh, that's the second time dropbox hasn't worked for me. I'll upload it with mediafire instead, check the first post again.

  • Ah, so if you replace the expression in your clock display event with the one below, it should work fine.

    global('Hour') & ":" & Right("00" & str(global('Minute')), 2) & " " & global('AMPM')[/code:3p2f39y4]
    
    Anyway, Dropbox seems to work quite fine for me. Just in case you didn't know, make sure you put the file in your 'Public' folder within the Dropbox folder, and after it syncs, use the right-click context menu for [i]Dropbox -> Copy public link[/i], which copies it to the clipboard for pasting wherever.
  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Thanks, that works perfectly

    I'm going out now, but when I get back I'll get started on some more game mechanics stuff. Next, I think I'll get started on weapons and items. Then I'll update the cap.

  • Update!

    I've completed the day and night effects, and done some more sprites. The effects look quite nice, and really add to the atmosphere. I've updated the .cap in the first post, and also updated the screenshot.

    To see the effects more clearly, press T to speed up the timescale.

  • Just a reminder: There already is a sytem expression for padding, called ZeroPad. Instead of

    global('Hour') & ":" & Right("00" & str(global('Minute')), 2) & " " & global('AMPM')[/code:3v2hg9o8]
    
    you can simplify by
    [code:3v2hg9o8]global('Hour') & ":" & ZeroPad(global('Minute'), 2) & " " & global('AMPM')[/code:3v2hg9o8]
  • Thanks for the tip tulamide I've updated the code.

  • Ok, no update today but I am stuck. I'm trying to create quite a complex calculation and I haven't the slightest idea how to put it into an event.

    What I want is: To find the nearest "zombiebox" sprite which is overlapping "player1cone" sprite, AND is in line of sight of "player1box". When found, "player1" creates a sprite, "bullet", and bullet sets it's angle towards the sprite "zombiebox".

    Any idea how to put this into a single event?

  • Just make an event like you described it.

    <img src="http://img257.imageshack.us/img257/7521/event2.gif">

  • Well, I tried your code R0J0hound, but nothing happens.

    Here, check my .cap, see what I'm doing wrong: http://dl.dropbox.com/u/7129504/Virus%20Sector.cap

    Press right ctrl and an arrow key to fire in that direction. At the moment, you can only fire up.

  • On event 49 change "Else" to "'pistol ammo' greater than 0". It seems that while ELSE works in most cases it doesn't work in that case.

    Only one "playercone" is needed so instead of spawning a "playercone" set it's position to "player1box".

    Change "player1box pick closest to zombiebox.X, .Y" to "zombiebox pick closest to player1box.X, .Y" as we want the closest zombie not the closest player.

    The condition "zombiebox overlaps playercone" needs to be changed to "zombiebox overlaps at offset (0,0) playercone" because otherwise a bullet will be shot at each zombiebox in the playercone.

    Here is a modification of your cap with those fixes and a few more: download

    +Muzzle animation unchecked Loop so it can be destroyed when it's animation is finished.

    +added else event (event 52) so if there are no zombieboxes to shoot, a bullet will just be shot in the same direction as the player.

    +cleaned up events 10-17 so they just set the angle of Player1 and set a global variable "DirectionPressed" to 1 which is previously set to 0 in event 3. "DirectionPressed" is then used in the weapon handling (event 48) so you don't have to handle all 8 directions all over again.

    + Finally Event 18 is changed to:

    + Player1box: is moving
    -> Player1: Set animation to "Walk" & Player1 ('Weaponout')
    + System: Else
    -> Player1: Set animation to "Stand" & Player1 ('Weaponout')[/code:3a1mu8cq]
    
    I hope all that makes sense, let me know if anything doesn't.  Cool project, has that gta feel to it.
    -cheers
  • Wow. You have just made my job so much easier than it would have been! I'll make sure to credit you R0J0hound, when this is done. Thanks so much, I thought I'd be stuck on that problem forever!

    Well, now that's all cleared up, I'll do some finishing touches on it and update the.cap in the OP.

  • Ok, I've run into another snag. It's quite a simple one this time, I just really don't understand how to make the bullet object work with the "instant hit" command set on. Can anyone tell what I'm missing?

    http://dl.dropbox.com/u/7129504/Virus%20Sector%20new.cap

  • OR doesn't play well with triggers it would seem. As it is, the actions are run only if the conditions before the first OR are true. Put "on step" into a event by itself and put the rest of the conditions as a sub-event and it will work. Alternatively you could make all those objects part of a family and eliminate the need for OR. Your conditions would then look something like this:

    + On Step
    + Bullet overlaps stopfamily
    [/code:3pl7bj2u]
    
    PS: no need to give me credit, just glad to help.
Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)