1. Post #161
    I've implemented tiles that damage and knock you back on impact. (AKA. Bouncy spikes) Only there's this bug that if you hold space when jumping on a spike it will launch you up into the air.



    Not gonna fix it.
    Reply With Quote Edit / Delete Windows 8 Netherlands Show Events Winner Winner x 4Artistic Artistic x 1 (list)

  2. Post #162
    Zyx
    Guest 3855 is lost and can't find the park exit
    Zyx's Avatar
    February 2005
    2,839 Posts

    Muzzle flare (Not shown, but photoshopped in), decal sprite on impact blood/generic
    Everything at 300% zoom.
    Reply With Quote Edit / Delete Windows 7 Show Events Artistic Artistic x 4 (list)

  3. Post #163
    hOnK :o)
    i300's Avatar
    December 2009
    3,987 Posts
    Obligitory "congrats Maurice!" post

    http://www.rockpapershotgun.com/2012...th-mari0rtals/
    Reply With Quote Edit / Delete Windows 7 United States Show Events Winner Winner x 20Friendly Friendly x 1 (list)

  4. Post #164
    Richy19's Avatar
    May 2010
    5,411 Posts
    So I have lost about a weeks worth of code because I forgot to push to my repo... FUCK!
    Reply With Quote Edit / Delete Linux United Kingdom Show Events Friendly Friendly x 9 (list)

  5. Post #165
    calzoneman's Avatar
    February 2008
    460 Posts

    Muzzle flare (Not shown, but photoshopped in), decal sprite on impact blood/generic
    Everything at 300% zoom.
    Every time you post a screenshot of that game it gets zoomed in further and further.
    Looks cool though
    Reply With Quote Edit / Delete Windows 7 United States Show Events Funny Funny x 16Agree Agree x 1 (list)

  6. Post #166
    Nigey Nige's Avatar
    June 2010
    1,341 Posts
    It bugs me when games journalists try to fit jokes into headlines at the expense of all logic.

    Edited:

    Maurice, this is your fault
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events Agree Agree x 10Funny Funny x 1 (list)

  7. Post #167
    Paid for a title.
    Maurice's Avatar
    June 2005
    6,175 Posts
    Oh great they're saying Mari0 has online multiplayer
    Can't wait to disappoint people!

    Edited:

    They fixed it.
    Reply With Quote Edit / Delete Windows 7 Germany Show Events Friendly Friendly x 24Funny Funny x 3Winner Winner x 2 (list)

  8. Post #168
    Gold Member

    October 2008
    3,838 Posts
    weird practices like state managers.
    I agree with the rest of your post but what's wrong with state managers? I've used them in all my games so far and I don't see anything wrong with them...
    Reply With Quote Edit / Delete Windows 7 United States Show Events Agree Agree x 6 (list)

  9. Post #169
    Nigey Nige's Avatar
    June 2010
    1,341 Posts
    LOVE isn't hard to use
    my 2D camera only goes sideways in the wrong dimension in the wrong direction and I can't fix it
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events Funny Funny x 8 (list)

  10. Post #170
    Gold Member
    Neo Kabuto's Avatar
    November 2008
    5,641 Posts
    my 2D camera only goes sideways in the wrong dimension in the wrong direction and I can't fix it
    Well, I'm sure we could help you with that here if you want.
    Reply With Quote Edit / Delete Windows 7 United States Show Events Friendly Friendly x 1 (list)

  11. Post #171
    Nigey Nige's Avatar
    June 2010
    1,341 Posts
    Well, I'm sure we could help you with that here if you want.
    I posted in WDYNHW. Thanks for the offer :3
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events Friendly Friendly x 2 (list)

  12. Post #172
    Andrew McWatters
    Dennab
    March 2011
    4,658 Posts
    I agree with the rest of your post but what's wrong with state managers? I've used them in all my games so far and I don't see anything wrong with them...
    To me the concept is very strange. Not once have I seen the design implemented into a commercial game with an open modding platform or one that eventually released their source in full, 2D or 3D. I generally always see more of a layer approach, but everything is in the same "state". You have the the menu, a hud, and a viewport. Maybe some other stuff, too. But generally things are destroyed and recreated in their own systems. Not in clumps.

    This all being said, I suppose like anything else, implementations can have their own variations. But for the most part, I've seen people who make state managers destroy the world environment and the heads up display in the same pass. Why?

    I'm not saying it's bad (though it could easily be, like in the example above), but it certainly isn't something I see commonplace outside of hobbyist programming.

    If anyone could point out a commercial or even notable free game out there that uses the state approach, I'd love to hear about it. I only see the practice in tutorials and such.
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  13. Post #173
    AtomiCasd's Avatar
    June 2011
    588 Posts
    It's basically a seperation of game logic like introstate(load resources), menustate(menu) and playstate(the game), instead of having it all in a blob of code in your game manager.

    Working in a group makes it easier to handle code.
    Reply With Quote Edit / Delete Windows 7 Norway Show Events

  14. Post #174
    Ploo's Avatar
    December 2009
    364 Posts
    Muzzle flare (Not shown, but photoshopped in), decal sprite on impact blood/generic
    Everything at 300% zoom.
    Why is Claude battling soldiers? You should use sprites of GTA3 gang members. That'll be amusing.
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events

  15. Post #175
    www.bff-hab.de
    Dennab
    February 2009
    7,832 Posts
    LOVE isn't hard to use, I think what I find as an issue for most people is they don't have a sense of how to structure their game internally. That's where everything starts to fall apart. It could be because they don't have experience elsewhere with games, so they fall back on weird practices like state managers.
    Love isn't a game engine, it's a graphics engine (+ pysics engine). People tend to forget that.
    Reply With Quote Edit / Delete Windows 7 Germany Show Events Agree Agree x 1 (list)

  16. Post #176
    chimitos's Avatar
    September 2010
    2,370 Posts
    5 pages late, but I love how I got in the OP with one android button.
    Reply With Quote Edit / Delete Windows Vista United States Show Events

  17. Post #177
    Liquid Helium's Avatar
    October 2010
    116 Posts
    Level system! Background! Poorly drawn smiley faces!

    Reply With Quote Edit / Delete Windows 8 United Kingdom Show Events Artistic Artistic x 4 (list)

  18. Post #178
    Gold Member
    BlkDucky's Avatar
    May 2008
    6,502 Posts
    The word you're looking for is "framework".

    Not quite a game engine, but more than a graphics library or something.
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events Agree Agree x 4 (list)

  19. Post #179
    Zyx
    Guest 3855 is lost and can't find the park exit
    Zyx's Avatar
    February 2005
    2,839 Posts
    Why is Claude battling soldiers? You should use sprites of GTA3 gang members. That'll be amusing.
    Point me to some top-down versions of them and I'll gladly do it. The reason I use the enemies I do now is that I don't have anything better.
    Reply With Quote Edit / Delete Windows 7 Show Events

  20. Post #180
    Gold Member

    March 2005
    3,028 Posts
    I agree with the rest of your post but what's wrong with state managers? I've used them in all my games so far and I don't see anything wrong with them...
    WTF exactly is a "state manager"? Is it some form of FSM?
    Reply With Quote Edit / Delete Show Events Agree Agree x 3 (list)

  21. Post #181
    ASK ME ABOUT MY PLAYBOOK INSTEAD OF COLLEGE
    icantread49's Avatar
    April 2011
    1,625 Posts
    If anyone could point out a commercial or even notable free game out there that uses the state approach, I'd love to hear about it. I only see the practice in tutorials and such.
    write a scene with a moving shape in it and make it pause on 'P'. it has to display "paused" while it's paused, and it has to allow you to quit with 'Q' when it's pause, or resume with 'R' when it's paused

    no, really, do it. and post the code here
    Reply With Quote Edit / Delete Windows XP United States Show Events Funny Funny x 5 (list)

  22. Post #182
    write a scene with a moving shape in it and make it pause on 'P'. it has to display "paused" while it's paused, and it has to allow you to quit with 'Q' when it's pause, or resume with 'R' when it's paused

    no, really, do it. and post the code here
     .
     .
     .
        if gmenu.pause then
            _g.setFont(fonts.textBig)
            _g.printf("GAME PAUSED", 312, 300, 400, "center")
    
            _g.setFont(fonts.text)
            _g.printf("Click anywhere to continue", 312, 400, 400, "center")
        end
     .
     .
     .
    function love.mousepressed(x, y, but)
        if but == "l" then
            pressed = true
            if gmenu.pause then
                gmenu.pause = false
                paused = false
                map.showModal = false
            end
     .
     .
     .
    

    Edited:

    That's without states

    Edited:

    State management*
    Reply With Quote Edit / Delete Windows 8 Netherlands Show Events

  23. Post #183
    ASK ME ABOUT MY PLAYBOOK INSTEAD OF COLLEGE
    icantread49's Avatar
    April 2011
    1,625 Posts
    -snip-
    Reply With Quote Edit / Delete Windows XP United States Show Events Useful Useful x 1 (list)

  24. Post #184
    Gold Member
    ryandaniels's Avatar
    December 2006
    3,942 Posts
    I've been bothered by a certain coding convention I've been flipping back and forth between:

    What seems like the traditional way of writing a function where certain input is invalid is

    Code:
    void Function(Object foo)
    {
    if(foo!= null)
    //do some stuff
    }

    But lately, especially when I'm doing Windows Forms stuff, I find myself instead doing this

    Code:
    void Function(Object foo)
    {
    if(foo== null)
    return;
    
    //now do stuff
    }
    I think the probably the most important thing here is consistency, but I can't really figure out which one has more merit.

    Usually, I judge by how self documenting or how well it matches what's really going on, but even though I lean a little bit towards my new way on this regard, I also worry whether it will in the end be more difficult to stick to that standard because there may be extreme circumstances where using it would be arbitrary. And I don't want to have to continue thinking this hard every single time this comes up.
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  25. Post #185
    Gold Member
    horsedrowner's Avatar
    January 2009
    3,750 Posts
    My screenshot uploader 'superscrot' now supports SFTP! It was pretty much necessary since I moved from a webhost to a VPS, and I didn't want to install an FTP server when I had SSH.

    It still doesn't have a proper icon though.

    Reply With Quote Edit / Delete Windows 7 Netherlands Show Events Programming King Programming King x 1 (list)

  26. Post #186
    WhatTheEf's Avatar
    November 2010
    532 Posts
    prev post
    I've uploaded the exe's if you wanna give them a try (maybe you'll find some bugs or something)

    TicTacToe

    Maze game(exe and txt must be in the same folder):

    exe

    maze.txt
    Reply With Quote Edit / Delete Windows 7 Anonymous Proxy Show Events

  27. Post #187
    Ask about my EBOLA fetish
    GameDev's Avatar
    February 2010
    12,433 Posts
    Oh great they're saying Mari0 has online multiplayer
    Can't wait to disappoint people!

    Edited:

    They fixed it.
    Apparently there are people still thinking theyre paying for it
    Reply With Quote Edit / Delete United States Show Events Funny Funny x 5Agree Agree x 1 (list)

  28. Post #188
    Icedshot's Avatar
    April 2010
    2,361 Posts
    I've been bothered by a certain coding convention I've been flipping back and forth between:

    What seems like the traditional way of writing a function where certain input is invalid is

    Code:
    void Function(Object foo)
    {
    if(foo!= null)
    //do some stuff
    }

    But lately, especially when I'm doing Windows Forms stuff, I find myself instead doing this

    Code:
    void Function(Object foo)
    {
    if(foo== null)
    return;
    
    //now do stuff
    }
    I think the probably the most important thing here is consistency, but I can't really figure out which one has more merit.

    Usually, I judge by how self documenting or how well it matches what's really going on, but even though I lean a little bit towards my new way on this regard, I also worry whether it will in the end be more difficult to stick to that standard because there may be extreme circumstances where using it would be arbitrary. And I don't want to have to continue thinking this hard every single time this comes up.
    I would say the second method avoids an extra } at the end of the function, which makes it a little neater overall

    If it really can't decide that much, flip a coin and stick to one. Its not that much of an issue, and if you are really spending that much time worrying about such a minor formatting issue, i would suggest not doing that
    Reply With Quote Edit / Delete Windows Vista United Kingdom Show Events

  29. Post #189
    Gold Member
    Hentie's Avatar
    May 2010
    2,129 Posts
    Oh great they're saying Mari0 has online multiplayer
    Can't wait to disappoint people!

    Edited:

    They fixed it.
    omg i cant believe im talking to a celebrity

    1000th post
    Reply With Quote Edit / Delete Windows 7 United States Show Events Funny Funny x 19Winner Winner x 1Agree Agree x 1 (list)

  30. Post #190
    Gold Member

    March 2005
    3,028 Posts
    I've been bothered by a certain coding convention I've been flipping back and forth between:

    What seems like the traditional way of writing a function where certain input is invalid is

    Code:
    void Function(Object foo)
    {
    if(foo!= null)
    //do some stuff
    }

    But lately, especially when I'm doing Windows Forms stuff, I find myself instead doing this

    Code:
    void Function(Object foo)
    {
    if(foo== null)
    return;
    
    //now do stuff
    }
    I think the probably the most important thing here is consistency, but I can't really figure out which one has more merit.

    Usually, I judge by how self documenting or how well it matches what's really going on, but even though I lean a little bit towards my new way on this regard, I also worry whether it will in the end be more difficult to stick to that standard because there may be extreme circumstances where using it would be arbitrary. And I don't want to have to continue thinking this hard every single time this comes up.
    I think the second method is generably preferable. I use the second method, and a lot of open source (linuxy) code I look at uses the second method. I think it was Torvalds who said something along the lines off " if you need more than two/three levels of indentation, you're doing something terribly wrong". If you can avoid nested blocks, by all means, avoid nesting blocks.
    Reply With Quote Edit / Delete Show Events Agree Agree x 3Informative Informative x 2 (list)

  31. Post #191
    ASK ME ABOUT MY PLAYBOOK INSTEAD OF COLLEGE
    icantread49's Avatar
    April 2011
    1,625 Posts
     .
     .
     .
        if gmenu.pause then
            _g.setFont(fonts.textBig)
            _g.printf("GAME PAUSED", 312, 300, 400, "center")
    
            _g.setFont(fonts.text)
            _g.printf("Click anywhere to continue", 312, 400, 400, "center")
        end
     .
     .
     .
    function love.mousepressed(x, y, but)
        if but == "l" then
            pressed = true
            if gmenu.pause then
                gmenu.pause = false
                paused = false
                map.showModal = false
            end
     .
     .
     .
    

    Edited:

    That's without states

    Edited:

    State management*
    okay great! everything is working perfect, you're happy, the user's happy, annndddddd

    wait! you forgot to add an options menu! if the game is paused and the user presses a button, you want to overlay an options screen while still showing bits and pieces of the paused game.

    enjoy
    Reply With Quote Edit / Delete Windows XP United States Show Events Dumb Dumb x 2Agree Agree x 2 (list)

  32. Post #192
    Gold Member
    Lexic's Avatar
    March 2009
    6,123 Posts
    I've been bothered by a certain coding convention I've been flipping back and forth between:

    What seems like the traditional way of writing a function where certain input is invalid is

    Code:
    void Function(Object foo)
    {
    if(foo!= null)
    //do some stuff
    }

    But lately, especially when I'm doing Windows Forms stuff, I find myself instead doing this

    Code:
    void Function(Object foo)
    {
    if(foo== null)
    return;
    
    //now do stuff
    }
    I think the probably the most important thing here is consistency, but I can't really figure out which one has more merit.

    Usually, I judge by how self documenting or how well it matches what's really going on, but even though I lean a little bit towards my new way on this regard, I also worry whether it will in the end be more difficult to stick to that standard because there may be extreme circumstances where using it would be arbitrary. And I don't want to have to continue thinking this hard every single time this comes up.
    I always use the second approach, because the "bad path" aka "something has gone wrong" is removed from the function immediately. You no longer have to worry about it by doing something like matching }s later on. You're free to carry along the happy path as if nothing had happened at the main indentation level of the function.

    Edited:

    Extreme but legit example:
    Style 1:
    -- A command to warrant a player.
    cider.command.add("warrant", "b", 0, function(ply, arguments)
    	if(!arguments[1])then
    		return false, "This command requires 3 arguments!";
    	end;
    	
    	local target = player.Get(arguments[1]);
    	
    	-- Get the class of the warrant.
    	local class = string.lower(arguments[2] or "");
    	
    	-- Get the reason for the warrant.
    	local reason =  table.concat(arguments, " ", 3);
    	
    	-- Check if a second argument was specified.
    	if (class == "search" or class == "arrest") then
    		if (reason) then
    			if (target) then
    				if ( target:Alive() ) then
    					if (target._Warranted ~= class) then
    						if (!target.cider._Arrested) then
    							if (CurTime() > target._CannotBeWarranted) then
    								if ( hook.Call("PlayerCanWarrant",GAMEMODE, ply, target, class, reason) ) then
    									hook.Call("PlayerWarrant",GAMEMODE, ply, target, class, reason);
    									
    									-- Warrant the player.
    									target:Warrant(class, nil, reason);
    								end
    							else
    								return false, target:Name().." has only just spawned!";
    							end
    						else
    							return false, target:Name().." is already arrested!";
    						end
    					else
    						if (class == "search") then
    							return false, target:Name().." is already warranted for a search!";
    						elseif (class == "arrest") then
    							return false, target:Name().." is already warranted for an arrest!";
    						end
    					end
    				else
    					return false, target:Name().." is dead and cannot be warranted!";
    				end
    			else
    				return false, arguments[1].." is not a valid player!"
    			end
    		else
    			return false, "This command requires 3 arguments. Please supply a reason for this warrant!";
    		end;
    	else
    		return false, "Invalid warrant type. Use 'search' or 'arrest'!";
    	end
    end, "Commands", "<player> <search|arrest> <reason>", "Warrant a player.");

    Style 2:
    -- A command to warrant a player.
    GM:RegisterCommand{
        Command     = "warrant";
        Arguments   = "<Target> <Arrest|Search>";
        Types       = "Player Phrase";
        Help        = "Give someone a warrant";
        function(ply, target, class)
            if (not target:Alive()) then
                return false, target:Name() .. " is dead!";
            elseif (target._CannotBeWarranted > CurTime()) then
                return false, target:Name() .. " can't be warranted right now!";
            elseif (target:Arrested()) then
                return false, target:Name() .. " is currently arrested!";
            elseif (target._Warranted == class) then
                return false, target:Name() .. " already has a" .. (class == "arrest" and "n " or " ") .. class .. " warrant!";
            elseif (class == "search" and target._Warranted == "arrest") then
                return false, target:Name() .. " already has an arrest warrant!";
            elseif (not gamemode.Call("PlayerCanWarrant", ply, target, class)) then
                return false;
            end
            gamemode.Call("PlayerWarrant", ply, target, class);
            target:Warrant(class);
        end
    };

    Second is vastly superior :o)
    Reply With Quote Edit / Delete Mac United Kingdom Show Events Agree Agree x 5 (list)

  33. Post #193
    Gold Member
    Hentie's Avatar
    May 2010
    2,129 Posts
    Style 2:
    -- A command to warrant a player.
    GM:RegisterCommand{
        Command     = "warrant";
        Arguments   = "<Target> <Arrest|Search>";
        Types       = "Player Phrase";
        Help        = "Give someone a warrant";
        function(ply, target, class)
            if (not target:Alive()) then
                return false, target:Name() .. " is dead!";
            elseif (target._CannotBeWarranted > CurTime()) then
                return false, target:Name() .. " can't be warranted right now!";
            elseif (target:Arrested()) then
                return false, target:Name() .. " is currently arrested!";
            elseif (target._Warranted == class) then
                return false, target:Name() .. " already has a" .. (class == "arrest" and "n " or " ") .. class .. " warrant!";
            elseif (class == "search" and target._Warranted == "arrest") then
                return false, target:Name() .. " already has an arrest warrant!";
            elseif (not gamemode.Call("PlayerCanWarrant", ply, target, class)) then
                return false;
            end
            gamemode.Call("PlayerWarrant", ply, target, class);
            target:Warrant(class);
        end
    };

    Second is vastly superior :o)
    Learned something new today.
    http://codepad.org/4rN8QkDS
    Reply With Quote Edit / Delete Windows 7 United States Show Events Informative Informative x 3 (list)

  34. Post #194
    okay great! everything is working perfect, you're happy, the user's happy, annndddddd

    wait! you forgot to add an options menu! if the game is paused and the user presses a button, you want to overlay an options screen while still showing bits and pieces of the paused game.

    enjoy
    Not in my game.

    Reply With Quote Edit / Delete Windows 8 Netherlands Show Events Funny Funny x 5Zing Zing x 2Winner Winner x 1 (list)

  35. Post #195
    hOnK :o)
    i300's Avatar
    December 2009
    3,987 Posts
    Still haven't gotten my free playbook. I'm really hoping it comes today.
    Reply With Quote Edit / Delete Mac United States Show Events Agree Agree x 2 (list)

  36. Post #196
    Andrew McWatters
    Dennab
    March 2011
    4,658 Posts
    okay great! everything is working perfect, you're happy, the user's happy, annndddddd

    wait! you forgot to add an options menu! if the game is paused and the user presses a button, you want to overlay an options screen while still showing bits and pieces of the paused game.

    enjoy
    lol
    Reply With Quote Edit / Delete Windows 7 United States Show Events Funny Funny x 5Dumb Dumb x 1 (list)

  37. Post #197
    ASK ME ABOUT MY PLAYBOOK INSTEAD OF COLLEGE
    icantread49's Avatar
    April 2011
    1,625 Posts
    well? can't write the code?
    Reply With Quote Edit / Delete Windows XP United States Show Events Dumb Dumb x 6 (list)

  38. Post #198
    Gold Member
    Darwin226's Avatar
    January 2009
    4,158 Posts
    okay great! everything is working perfect, you're happy, the user's happy, annndddddd

    wait! you forgot to add an options menu! if the game is paused and the user presses a button, you want to overlay an options screen while still showing bits and pieces of the paused game.

    enjoy
    I agree there.
    I think the best solution might be what Flash does with the timeline.
    For each frame there's a list of object that are active. Then the frame changes, the old ones that are not in the next one become disabled and the new ones enable.

    This gives you great flexibility since you're using layer but you are still saying which layer is active based on the state of the game.

    I find that it makes for clean code that's more or less easy to follow.
    Reply With Quote Edit / Delete Windows 7 Croatia Show Events

  39. Post #199
    Gold Member
    Eric95's Avatar
    January 2009
    5,045 Posts
    That's without states
    What are states?
    Reply With Quote Edit / Delete Windows 7 Sweden Show Events

  40. Post #200
    Andrew McWatters
    Dennab
    March 2011
    4,658 Posts
    well? can't write the code?
    I actually can't believe you're serious. If someone presses their key option for pausing the game, what stops them from pressing the key option for opening a menu?

    It's like you're implying everything is blocked by an "if paused then return end" statement.
    Reply With Quote Edit / Delete Windows 7 United States Show Events Agree Agree x 3 (list)