Jump to content
MakeWebGames

Roulette Refresh


Recommended Posts

Hi While I was working on Roulette page I decided to give it a refresh and add some new features. Added the ability to pick a random number each time or stick with the same number and added a session profit and loss tracking and colour coded it green with your in profit and red when in a loss. I have also made it responsive using w3.css.

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

  • Like 2
Link to comment
Share on other sites

  • 1 month later...

I like the fact that you are using w3.css not many people use it as well its less heavy on page loading speed than what we use bootstrap.min.css, bootsrap.js.min, popper.slim.js and so on for the hamburger menu to display on mobile devices.

w3.css uses a simple stylesheet and vanilla js to handle these thing and is faster on loading using pagespeed and other seo tactics the page speed at google is 100,100,100,100 using w3.css vs bootstrap being maxed out at the same on desktop and mobile being slower ms but still 100,100,100,100

 

For the code itself to improve security you should be using filter_input and FILTER_VALIDATE_INT to make sure no modifications happen before and after the processing of the form happens while also validating any user input and output to the screen.

 

You could also improve it further using Object Orientated Programming so if you use database back end say PDO or mysqli this then allows for pure OOP something you do not want to mix but this is a recommendation not a requirement not everyone wants complex code in many ways procedural style mysqli adds more lines but improves readability with the same level of security.

 

All in all i love the idea you have going here we use something similar but use dungeons and dragons 100 die logic here something we used coming from dice games that runescape had at the grand exchange ( sorry bit a runescape nerd so this is where our inital logic for it came from ) 

ps: i got told i type too much by the lovely wife 😜

  • Thanks 1
Link to comment
Share on other sites

  • 3 weeks later...

Hey sorry not sure how I missed your reply back back then. I have to give Peter credit for using w3.css, if I'm honest I hadn't heard of it until I was looking at his source code but we'll keep that on the down low lol. 🤫
switching to using PDO is something I want add to my game in the future, just haven't had the time to sit down and learn how it works and how to implement it.

yeah the js might not be the most eloquient or how it would be written today either, I had created this about 10 years ago originally and well it didn't really stand the test of time and with abit of help from chatGPT managed to get it working. 

On 12/14/2023 at 9:30 AM, i3ision said:

All in all i love the idea you have going here we use something similar but use dungeons and dragons 100 die logic here something we used coming from dice games that runescape had at the grand exchange ( sorry bit a runescape nerd so this is where our inital logic for it came from ) 

thanks and yeah my 1st try was just full of lots of if statements if I'm honet 🙄

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...