berry05 Posted December 10, 2008 Share Posted December 10, 2008 hello I'm trying to make a text based game...can somebody give me some pointers on what kind of php codes i should use and how i should start it? Quote Link to comment https://forums.phpfreaks.com/topic/136413-text-based-game-help/ Share on other sites More sharing options...
trq Posted December 10, 2008 Share Posted December 10, 2008 Thats gotta be the most vague question Ive seen in a while. Where exactly are you stuck? Quote Link to comment https://forums.phpfreaks.com/topic/136413-text-based-game-help/#findComment-711819 Share on other sites More sharing options...
Maq Posted December 10, 2008 Share Posted December 10, 2008 Ummm... What kind of game do you want to make? Can you elaborate more, besides using the word text-based? Give some details, like rules, objectives, etc... Quote Link to comment https://forums.phpfreaks.com/topic/136413-text-based-game-help/#findComment-711823 Share on other sites More sharing options...
revraz Posted December 10, 2008 Share Posted December 10, 2008 You should use PHP 5 code and start it with <?PHP Quote Link to comment https://forums.phpfreaks.com/topic/136413-text-based-game-help/#findComment-711825 Share on other sites More sharing options...
premiso Posted December 10, 2008 Share Posted December 10, 2008 You should use PHP 5 code and start it with <?PHP I would also suggest using sessions, so add session_start after the <?php tag. Quote Link to comment https://forums.phpfreaks.com/topic/136413-text-based-game-help/#findComment-711827 Share on other sites More sharing options...
Maq Posted December 10, 2008 Share Posted December 10, 2008 Some variables? session_start(); $a = 1; $b = 2; Quote Link to comment https://forums.phpfreaks.com/topic/136413-text-based-game-help/#findComment-711830 Share on other sites More sharing options...
Brian W Posted December 10, 2008 Share Posted December 10, 2008 I'm building a non text based game, its click based. fun stuff there. *sigh I suggest closing with ?> Quote Link to comment https://forums.phpfreaks.com/topic/136413-text-based-game-help/#findComment-711831 Share on other sites More sharing options...
berry05 Posted December 10, 2008 Author Share Posted December 10, 2008 i'm trying to make it based off farming so people can buy seeds and plant them and when they do its timed for like lets say a day and then when its a day they get that crop...and they can harvest either 1-10 of that crop they planted..and they can buy animals and say they have a cow the cow gives off 2 jugs of milk a day....wouldn't i need cron jobs for that or something? Quote Link to comment https://forums.phpfreaks.com/topic/136413-text-based-game-help/#findComment-711833 Share on other sites More sharing options...
PFMaBiSmAd Posted December 10, 2008 Share Posted December 10, 2008 Don't forget to validate all external data that your code receives. It will cut down on cheating and hackers taking over your site. Quote Link to comment https://forums.phpfreaks.com/topic/136413-text-based-game-help/#findComment-711836 Share on other sites More sharing options...
berry05 Posted December 10, 2008 Author Share Posted December 10, 2008 ok thxs! whats its called when i plant a crop and have to wait a day for it to be harvested...is that cron jobs or a timer? so like every time i plant a crop i have to wait lets say a day...how do i make a script like that? Quote Link to comment https://forums.phpfreaks.com/topic/136413-text-based-game-help/#findComment-711845 Share on other sites More sharing options...
bluesoul Posted December 10, 2008 Share Posted December 10, 2008 Yeah, you'd have a cron job to repopulate fields in your DB. Or something like that. Quote Link to comment https://forums.phpfreaks.com/topic/136413-text-based-game-help/#findComment-711849 Share on other sites More sharing options...
premiso Posted December 10, 2008 Share Posted December 10, 2008 Set a date in the database, then setup a cron job to run every x minutes, if that date has been reached do an update, if not than do not update. Quote Link to comment https://forums.phpfreaks.com/topic/136413-text-based-game-help/#findComment-711852 Share on other sites More sharing options...
berry05 Posted December 10, 2008 Author Share Posted December 10, 2008 Set a date in the database, then setup a cron job to run every x minutes, if that date has been reached do an update, if not than do not update. mhm.....i'm going to have to google that one Quote Link to comment https://forums.phpfreaks.com/topic/136413-text-based-game-help/#findComment-711856 Share on other sites More sharing options...
revraz Posted December 10, 2008 Share Posted December 10, 2008 You'll have to learn Javascript too, what you want to do won't really be possible in just PHP alone, at least not a very good one. Quote Link to comment https://forums.phpfreaks.com/topic/136413-text-based-game-help/#findComment-711871 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.