Another Date Sim Update 6.45, and an annoying Firefox bug
So after releasing 6.4 and squishing some bugs, one of the commenters posted this:
Another bug, if you go to the strip club with Rebecca then have sex with Ariane in the hot tub you can’t stay the night because Rebecca is in the bedroom. I had always felt bad about ditching her at the strip club anyway, but I think I would have noticed if we had brought her home with us.
The easy fix is one new line of code, but I realized he has a point about the post strip club party, and thought of a fun new scenario to add. I then found myself in a common problem with this project which I call the “theme vs format” conflict.
A running theme in Dating Ariane simulator is that Ariane is a modern feminist who is not delicate or submissive. She does only what she wants to do. If it gives her pleasure, she will do it. If it gives others pleasure, she may do it if she is assured a mutual exchange. …or really drunk.
The format of the game is (mostly) still images in a first person perspective. It is supposed to play like a comic book, where you decide what happens next. The advantage is that I do not have to usually show the player doing stuff, only Ariane’s reaction to the player doing stuff.
While researching the problem, I ran into the old “every browser is different” problem, before eventually finding some code that smoothly moved an image linearly on all modern browsers. That’s the good news. The bad news is I did not want to move images linearly, I wanted wavy motion and circular motion. The linear motion code is all done with loops, one loop to move the picture to the left, then another to move the picture to the right. Since circular motion is a constantly changing direction, that complicates things greatly.
Then it hit me, what math functions go round and round and up and down? Trig functions! (yes, there are opportunities to use Trigonometry after college) I can rewrite the code to move in trig functions with ever increasing angles. Start with angle a=0, x = sin a, y = cos a, then increase the value of a and recalculate. (x,y) will form a perfect circle. You do not even need to check for an end of the loop, the value will just go round and round until you change the page. Scaling the direction will create ovals instead of circles, and adding an absolute value y = |cos a| will make a U shape pattern.
Anyways, I wrote a new scenario using these tricks, and because it is only a small update, I am releasing version 6.45.
Another annoying Firefox bug
So I created a cool new scenario, what else can I do to finish out? I have been thinking that the Comic Sans font I have been using, while fitting for the comic book theme, was getting old. The best way around it is to convert the whole thing to external CSS, so with one line of code I can change the text font of the whole site to whatever I want. This could be a fun new feature to play with.
Except I am running into another “every browser is different” problem. For some reason Firefox does not register ongoing “onMouseover” events in one frame while handling an external CSS file in another frame.
Let me show you what I mean. Go to the online version of the date simulator here, then click on “Introduce yourself” and “Give her a hug”. What you should see in the space below the picture is the words “You let go” written in navy blue in an Arial font. If you are using Internet Explorer, that is exactly what you will see. If you are in Safari, Opera or Chrome, you will see the text as soon as you move your mouse a tiny bit, which is wrong, but I can live with that. In Firefox, you will only see the text if you move your mouse out of the picture (triggering an onMousout event) then move it back on the picture. The only difference between this page and all the other pages is that this page uses a link to an external CSS file. If I put in CSS code internally into the page, Firefox works fine, but that means changing 500 web pages to change a font, which defeats the whole purpose of doing CSS in the first place.
I’m not going to try and release a CSS version until I figure this one out.