joeheader16
friendsoffortiesfive Aimoo Forum List | Ticket | Today | Member | Search | Who's On | Help | Sign In | |
friendsoffortiesfive > General > Games Go to subcategory:
Author Content
Zenith
  • Rank:Emerald
  • Score:76160
  • From:Canada
  • Register:07/31/2019 10:06 PM

Date Posted:02/05/2023 8:20 PMCopy HTML

CONCEIVE, BELIEVE, ACHIEVE!
Niceguy2 #1026
  • Rank:Diamond
  • Score:311285
  • From:USA
  • Register:01/12/2009 5:00 AM

Re:Game Code Development Area

Date Posted:04/24/2024 1:41 AMCopy HTML

NEVER MIND, I GOT IT!

Niceguy2 #1027
  • Rank:Diamond
  • Score:311285
  • From:USA
  • Register:01/12/2009 5:00 AM

Re:Game Code Development Area

Date Posted:04/24/2024 1:44 AMCopy HTML

I am done through Post #1019. I will take a break for a few minutes.

Zenith #1028
  • Rank:Emerald
  • Score:76160
  • From:Canada
  • Register:07/31/2019 10:06 PM

Re:Game Code Development Area

Date Posted:04/24/2024 12:45 PMCopy HTML

I missed this, due to new page .... so will post anyway ...

1: When you clicked Launch with MS_Edge, did the code run?

<<<<<<<<<<<<<<<<<<<<<<???

2: Is the code part on one line?

<<<<<<<<<<<<<<<<<<<<<<???

3: Check pic below.

========================================================

4: Check my macros for something else you may want. I only gave you a few.

5: I will teach you how to make macros ... just remember NEW LINE = \r\n and it will be easy.

Remember on a typewriter you push the RETURN handle, and when it's all the way left the platen rolls up to NEWLINE on the paper.

The \r in the script means DO A RETURN, not PRINT r. Similarly for \n.

And you don't want to print a space between them, so it's NOT \r \n.

Zenith #1029
  • Rank:Emerald
  • Score:76160
  • From:Canada
  • Register:07/31/2019 10:06 PM

Re:Game Code Development Area

Date Posted:04/24/2024 2:13 PMCopy HTML

Other code uses:

CR and LF

for carriage return and line feed, so remember both mean the same thing.

The "\r\n" is usually used in text scripts, which convert that into CRLF in the code.


CONCEIVE, BELIEVE, ACHIEVE!
Niceguy2 #1030
  • Rank:Diamond
  • Score:311285
  • From:USA
  • Register:01/12/2009 5:00 AM

Re:Game Code Development Area

Date Posted:04/25/2024 2:54 AMCopy HTML

I missed this, due to new page .... so will post anyway ...

1: When you clicked Launch with MS_Edge, did the code run?


Umm... I don't remember.  I may have missed that little detail.

Zenith #1031
  • Rank:Emerald
  • Score:76160
  • From:Canada
  • Register:07/31/2019 10:06 PM

Re:Game Code Development Area

Date Posted:04/25/2024 12:51 PMCopy HTML

01: Find game1.htm

02: Rt-click "open with" >> "Notepad++"

========

03: Click RUN

04: Click "launch in MS_Edge".

05: Tell me if it ran.

========

06: If it ran push game "start" button twice.

07: What happened then?

08: Close game display with X

========

09: Look at code ... did MACROs work properly to fix the one liner?

10: Do you now have multiple  lines of code?

========

11: Click the |P (reversed) button below PLUGINS TAB ... "show all characters"

12: Notice CR LF which means NEW LINE.

13: Click same button again.

========

14: Do not close game1.htm, since we will look at it again tomorrow.

15: If you do close it, you must repeat steps 1 and 2 tomorrow.

========

CONCEIVE, BELIEVE, ACHIEVE!
Niceguy2 #1032
  • Rank:Diamond
  • Score:311285
  • From:USA
  • Register:01/12/2009 5:00 AM

Re:Game Code Development Area

Date Posted:04/26/2024 2:45 AMCopy HTML

01: Find game1.htm




The only "game1" that I have is a text file on my desktop named Game #1, consisting of this:

 

<table style="margin:0px auto;width:auto;border:7px solid #CCCC00;padding:20px;border-spacing:0px;background-color:#009900;"><tbody><tr class="firstRow"><td style="text-align:center;"><!-- this is a comment --><table style="width:700px;height:500px;border:7px solid #CCCC00;padding:0px;border-spacing:0px;background-color:#FFFFDD;"><tbody><tr class="firstRow"><td style="text-align: center; word-break: break-word;"><div style="text-align:center;border:8px solid #006600;background-image:url('https://i.postimg.cc/DfCv10Hb/Wolf-Game-Background.jpg');"><!-- https://iili.io/HobIfTb.png use this bkg later --><strong style="color:#006600;font-size:36px;"><br>** MY FANTASTIC GAME **<br><br></strong><a href="https://www.random.org/integers/?num=1&amp;min=1&amp;max=6&amp;col=1&amp;base=10&amp;format=html&amp;rnd=new"><img src="https://i.postimg.cc/DzWL3RGx/Wolf-Game-Header.jpg" style="border:20px solid #006600;"></a><p style="color:#006600;font-size:30px;"><br><b>INSTRUCTIONS:</b><br>Move wolf to catch<br>Little Red Riding Hood!<br>Prior to COPY click Wolf (1-6).<br>First wolf to catch her wins!<br>Have fun!<br><!-- ICON TABLE --></p><p style="color:#006600;font-size:30px;"><b><br></b></p><table style="width:auto;margin:0px auto;text-align:center;border:#006600 7px solid;background-color:#FFFFFF;"><tbody><tr class="firstRow"><td style="background-color:#FFFFDD;text-align:center;width:100px;height:30px;border:1px solid #006600;font-weight:900;color:#FF0000;">NAME</td><td style="background-color:#FFFFDD;text-align:center;width:100px;height:30px;border:1px solid #006600;font-weight:900;color:#009900;">NAME</td><td style="background-color:#FFFFDD;text-align:center;width:100px;height:30px;border:1px solid #006600;font-weight:900;color:#FF00FF;">NAME</td></tr><tr><td style="line-height:1px;border:1px solid #006600;width:100px;height:100px;"><img src="https://i.postimg.cc/QtQBXDdJ/Wolf-Game-Wolf-1.png" style="width:80px;height:80px;"></td><td style="line-height:1px;border:1px solid #006600;width:100px;height:100px;"><img src="https://i.postimg.cc/wMWjvj8L/Wolf-Game-Wolf-2.png" style="width:80px;height:80px;"></td><td style="line-height:1px;border:1px solid #006600;width:100px;height:100px;"><img src="https://i.postimg.cc/V6mfWCzX/Wolf-Game-Wolf-3.png" style="width:80px;height:80px;"></td></tr><!-- this is existing tail below, so copy it overwhat you have or omit it --></tbody></table><br><br><br><br></div></td></tr></tbody></table><!-- this is a comment --></td></tr></tbody></table><p></p><p></p><p></p><p><br></p><p><br></p><p><br></p><p><br></p><p><br></p><p><br></p><p><br></p>

Zenith #1033
  • Rank:Emerald
  • Score:76160
  • From:Canada
  • Register:07/31/2019 10:06 PM

Re:Game Code Development Area

Date Posted:04/26/2024 12:28 PMCopy HTML

Maybe it was test1.htm

Whatever you loaded into Npp, do the post #1031 exercise on it,

so I can know if the xml is working.


Forget the button if it's not there.





CONCEIVE, BELIEVE, ACHIEVE!
Niceguy2 #1034
  • Rank:Diamond
  • Score:311285
  • From:USA
  • Register:01/12/2009 5:00 AM

Re:Game Code Development Area

Date Posted:04/27/2024 1:40 AMCopy HTML

01: Find game1.htm

02: Rt-click "edit with" >> "Notepad++" ("open with" threw me off, briefly)

========

03: Click RUN

04: Click "launch in MS_Edge".

05: Tell me if it ran.


Yes, and I clicked the button, also. 

Niceguy2 #1035
  • Rank:Diamond
  • Score:311285
  • From:USA
  • Register:01/12/2009 5:00 AM

Re:Game Code Development Area

Date Posted:04/27/2024 1:47 AMCopy HTML

06: If it ran push game "start" button twice.

07: What happened then?

08: Close game display with X

========

09: Look at code ... did MACROs work properly to fix the one liner?

10: Do you now have multiple  lines of code?


 

I pushed game "start" button twice.

The lights started changing colors.

Closed game display with X.

Macros worked great.

Have multiple lines of code.

Zenith #1036
  • Rank:Emerald
  • Score:76160
  • From:Canada
  • Register:07/31/2019 10:06 PM

Re:Game Code Development Area

Date Posted:04/27/2024 12:30 PMCopy HTML

Great, going, Joe! I'm proud of you!

=================================

Did you try both languages HTML and javascript?


We will make our first macro.

Note that the { } and */ are bunched up in JS.


The first macro will be to put CR LF after }.

As I mentioned before, that will be \r\n in the script.

CONCEIVE, BELIEVE, ACHIEVE!
Zenith #1037
  • Rank:Emerald
  • Score:76160
  • From:Canada
  • Register:07/31/2019 10:06 PM

Re:Game Code Development Area

Date Posted:04/27/2024 12:51 PMCopy HTML

CONCEIVE, BELIEVE, ACHIEVE!
Zenith #1038
  • Rank:Emerald
  • Score:76160
  • From:Canada
  • Register:07/31/2019 10:06 PM

Re:Game Code Development Area

Date Posted:04/27/2024 1:09 PMCopy HTML




==========================

Click MACRO tab
Get up to top area of that window.
Click "START RECORDING"
==========================
Push CTRL-HOME
Push CTRL-H .. a window will pop up.
Enable "EXTENDED SEARCH MODE" .. all other buttons UNCHECKED. See pic.
==========================
In top box type             }
In bottom box type      }\r\n
Click RELACE ALL in same window
Click CLOSE in same window
==========================
In MACRO, go to top and click "STOP RECORDING"
In MACRO, go to top and click "SAVE CURRENT RECORDED MACRO"
Name it   CHOP AFTER  }

Click CLOSE in window

==========================

CHOP AFTER  }       will now be on bottom of MACRO listing.

Every time you click it, it will put an ENTER, or CR LF, after every }.


If you overdo it, DEL BLANK LINE X1 will fix it.

CONCEIVE, BELIEVE, ACHIEVE!
Zenith #1039
  • Rank:Emerald
  • Score:76160
  • From:Canada
  • Register:07/31/2019 10:06 PM

Re:Game Code Development Area

Date Posted:04/27/2024 2:11 PMCopy HTML

If you go to the bottom of the MACRO list you can click MODIFY SHORTCUT and change the names. You can also add shortcut keys. Some keys are in use already so you have to poke ALT and CTRL and SHIFT sometimes to get a good one.

Take care not to delete any that you need, or you will have to redo them.

The DELETE is there in case you screw up and make a macro that doesn't do what you wanted.

===================

OPTIONAL:

To re-arrange the macro list, you have to manually edit SHORTCUTS.XML  .... very carefully.

Prior to that you need a SHORTCUTS.BAK, or some kind of copy of current xml in case of major EFF-UP, like your cat walked on the keyboard in mid edit, and hit garbage and SAVE!

CONCEIVE, BELIEVE, ACHIEVE!
Zenith #1040
  • Rank:Emerald
  • Score:76160
  • From:Canada
  • Register:07/31/2019 10:06 PM

Re:Game Code Development Area

Date Posted:04/27/2024 5:39 PMCopy HTML

As an example, you have to move the whole macro (or your target macro) in the red box in between 2 other macros, then save and close and exit.

Hilite & CTRL-X to cut, and CTRL-V to paste, plus get rid of blank lines left behind.

The blank lines thing is optional, but you want it to look nice.

Line-up any macros that are misaligned, optional.

Npp doesn't give a hoot about misaligned code unless it's out of sequence.

It's your friends that say, "OOH, look at Joe's messy XML code." ..... LOL




Zenith #1041
  • Rank:Emerald
  • Score:76160
  • From:Canada
  • Register:07/31/2019 10:06 PM

Re:Game Code Development Area

Date Posted:04/27/2024 6:19 PMCopy HTML

Two old ladies were sitting on a park bench when a flasher jumped in front of them and opened up his coat.

One old lady had a stroke;

The other old lady's arms were too short!


CONCEIVE, BELIEVE, ACHIEVE!
Niceguy2 #1042
  • Rank:Diamond
  • Score:311285
  • From:USA
  • Register:01/12/2009 5:00 AM

Re:Game Code Development Area

Date Posted:04/28/2024 3:12 AMCopy HTML

Great, going, Joe! I'm proud of you!

=================================

Did you try both languages HTML and javascript?

Thanks, Dave!

I clicked both languages, like you said to do.

LOL at the old ladies!

Will get back to this. (Sometime)


Zenith #1043
  • Rank:Emerald
  • Score:76160
  • From:Canada
  • Register:07/31/2019 10:06 PM

Re:Game Code Development Area

Date Posted:04/28/2024 1:16 PMCopy HTML

OK .. don't do the optional re-arranging stuff yet.

I just put that in  to tell how to do it, but you only have half a dozen macros at present. I have a couple of pages, so I like the same kind together where I can find them.

Zenith #1044
  • Rank:Emerald
  • Score:76160
  • From:Canada
  • Register:07/31/2019 10:06 PM

Re:Game Code Development Area

Date Posted:04/28/2024 1:41 PMCopy HTML

It's practically the same old stuff every time for whole-page macros.

Remember  \r\n means NEW LINE.


For your own future macros, just figure out which side of a code character you want a new line to happen!


Record these using a new page .. otherwise the code will move as you do this. Test these macros later on test1.htm.


NEW MACRO #1
==========================
Click MACRO tab
Get up to top area of that window.
Click "START RECORDING"
==========================
Push CTRL-HOME
Push CTRL-H .. a window will pop up.

Enable "EXTENDED SEARCH MODE" .. all other buttons UNCHECKED.

See pic #1038.

==========================
In top box type             }
In bottom box type      }\r\n

Click RELACE ALL in same window
Click CLOSE in same window
==========================
In MACRO, go to top and click "STOP RECORDING"
In MACRO, go to top and click "SAVE CURRENT RECORDED MACRO" 
Name it: CHOP AFTER }
Click CLOSE in window
==========================

**************************
NEW MACRO #2
==========================
Click MACRO >> START RECORDING
==========================
Push CTRL-HOME
Push CTRL-H
Ensure EXTENDED SEARCH is enabled.
==========================
In top box type {
In bottom box type {\r\n

==========================
Click RELACE ALL
Click CLOSE
==========================
MACRO >> STOP RECORDING
MACRO >> SAVE CURRENT RECORDED MACRO
Name it: CHOP AFTER (
==========================

**************************
NEW MACRO #3
==========================
Click MACRO >> START RECORDING
==========================
Push CTRL-HOME
Push CTRL-H
Ensure EXTENDED SEARCH is enabled.
==========================
In top box type */
In bottom box type */\r\n

==========================
Click RELACE ALL
Click CLOSE
==========================
MACRO >> STOP RECORDING
MACRO >> SAVE CURRENT RECORDED MACRO
Name it: CHOP AFTER */
==========================
CONCEIVE, BELIEVE, ACHIEVE!
Zenith #1045
  • Rank:Emerald
  • Score:76160
  • From:Canada
  • Register:07/31/2019 10:06 PM

Re:Game Code Development Area

Date Posted:04/28/2024 2:18 PMCopy HTML

*************************************************************
NEW MACRO #4 ...INSERT <br> AT CURSOR
==========================
Click MACRO >> START RECORDING
==========================
<br> ..... ON THE PAGE ... (NO CTRL-H)
==========================
MACRO >> STOP RECORDING
MACRO >> SAVE CURRENT RECORDED MACRO
Name it: INSERT <br>

==========================

I GAVE MINE KEY OF   ALT-I

I USE IT IN Randy BLURBS, AND OTHERS.
CONCEIVE, BELIEVE, ACHIEVE!
Zenith #1046
  • Rank:Emerald
  • Score:76160
  • From:Canada
  • Register:07/31/2019 10:06 PM

Re:Game Code Development Area

Date Posted:04/29/2024 2:18 PMCopy HTML

Joe:

You can have the instructions open in NPP, while writing the macro involved.


Here's another useful one.


It's all the same old sh!t, (that's easy to learn) except for the 2 boxes content,

which is easier to figure out than how to win a CONNECT-4 game.


==============

It's quite evident that the macro engine should be turned on and off like your washing machine if you use one:


MACRO >> START RECORDING

Wash the clothes ...

CTRL-HOME

\r\n</td>

</td>

Click RELACE ALL
Click CLOSE


Stop when done ...

MACRO >> STOP RECORDING


Then dry the clothes ...

SAVE CURRENT RECORDED MACRO.

==============


This one means replace a new line to left of </td> with NOTHING


EXAMPLE:

<td style="width:100px;">CR LF

</td>CR LF


becomes


<td style="width:100px;"></td>CR LF


or PUT </td> ON THE END OF PREVIOUS LINE.



******************************************
NEW MACRO #5 ... [END </td>]
==========================
MACRO >> START RECORDING
==========================
Push CTRL-HOME
Push CTRL-H
Ensure EXTENDED SEARCH is enabled.
==========================
In top box type        \r\n</td>
In bottom box type  </td>
==========================
Click RELACE ALL
Click CLOSE
==========================
MACRO >> STOP RECORDING
MACRO >> SAVE CURRENT RECORDED MACRO
Name it: END </td>
==========================
CONCEIVE, BELIEVE, ACHIEVE!
Zenith #1047
  • Rank:Emerald
  • Score:76160
  • From:Canada
  • Register:07/31/2019 10:06 PM

Re:Game Code Development Area

Date Posted:04/30/2024 1:13 PMCopy HTML

Make a macro that puts a NEWLINE after a colon    :

Call it whatever suits you!

==============

Re new macros:

If you don't make 'em, you don't have 'em!!!

You can also do the job one-by-one with ENTER ... good luck!

\ is just another character on your keyboard, not a demon from Hell!


Zenith #1048
  • Rank:Emerald
  • Score:76160
  • From:Canada
  • Register:07/31/2019 10:06 PM

Re:Game Code Development Area

Date Posted:04/30/2024 1:16 PMCopy HTML

We will examine parts of TEST1.HTM


<button style="
padding:10px;
color:white;
font-weight:900;
background-color:#0000cc;
border:5px solid black;

onclick="location.reload()">Reset</button>


The red code function is hidden somewhere in the browser,

so you don't have to write it yourself.

CONCEIVE, BELIEVE, ACHIEVE!
Zenith #1049
  • Rank:Emerald
  • Score:76160
  • From:Canada
  • Register:07/31/2019 10:06 PM

Re:Game Code Development Area

Date Posted:04/30/2024 2:41 PMCopy HTML

Unlike RESET, we have to make an INIT function that initializes our game,

and makes a continual loop to keep the game moving.

This is an example, pared down to minimum code.

Let me know if you have questions of how it works.


/* JS COMMENT */

<!--  HTML COMMENT  -->


<div>
<!-- I like to put the JS inside a div envelope -->

<a href="javascript:

function init(){
/*init sets up some variables ... one here*/
var count=0;

/* ... and a game loop*/
setInterval(doLoops, 200);

function doLoops(){
/*doLoops repeats the following code every 200ms*/

count+=1;  /* short for count = count + 1 */

if (count==9){
count=0;
alert ("... another 1800 ms has elapsed");

/*end if*/


/* after 200ms go back to doLoops start and crank up count */


/*end doLoops*/

/*end init*/

"> <!-- end js start -->

<!-- INIT and RESET button HTML codes are here.

See next post for reference. -->


</a><!-- end js altogether -->

</div>


CONCEIVE, BELIEVE, ACHIEVE!
Zenith #1050
  • Rank:Emerald
  • Score:76160
  • From:Canada
  • Register:07/31/2019 10:06 PM

Re:Game Code Development Area

Date Posted:04/30/2024 3:41 PMCopy HTML

For reference:

There are no lights to change, but init() will run, and count will keep incrementing!


<button style="
padding:10px;
color:white;
font-weight:900;
background-color:#0000cc;
border:5px solid black;
"
onclick="init()">Click until lights change</button>

&nbsp;

<button style="
padding:10px;
color:white;
font-weight:900;
background-color:#0000cc;
border:5px solid black;

onclick="location.reload()">Reset</button>

CONCEIVE, BELIEVE, ACHIEVE!
Copyright © 2000- Aimoo Free Forum All rights reserved.
Skin by SandhillsDebby - Elements from DivaAmyMarie.blogspot.com