How To

HOWTO

0

MeNTeN 2021-03-21 05:01

I want tirn over it
how to?


MeNTeN 2021-03-21 05:01

tirn→turn
sorry :)


qwaffe 2021-03-21 05:37 (Edited)

TOUCHSCREEN

SPRITE 0,0,0,2
SPRITE 0 SIZE 1

DO
  IF TAP THEN CALL CHANGE
LOOP

SUB CHANGE
  FOR I=0 TO 3
    ' CHANGE THE CHARACTER EVERY 15 FRAMES
    ' GOES THROUGH 2,4,6,8
    SPRITE 0,0,0,I*2+2
    WAIT 15
  NEXT I
END SUB

does this work for you?
also, you can edit messages (top right of the message, click Edit)


was8bit 2021-03-21 07:09

I "think" i know what you are wanting to do...

Look at this :)

Flipit.nx | Open in app
2021-03-21 07:09

MeNTeN 2021-03-21 09:20

@qwaffe
Thanks to reply. It's very nice.
@was8bit
Thanks! That is what I wanted!


was8bit 2021-03-21 10:32 (Edited)

I like that game, and i had guessed correctly :)

Properly done with an 8x8 grid, where i only made a 7x7 grid... but that is an easy fix :)


MeNTeN 2021-03-21 10:47

OMG! We only use 64sprite!
what can i do?


MeNTeN 2021-03-21 10:48

this

Flipit.nx | Open in app
2021-03-21 10:48

was8bit 2021-03-21 10:50

I have the answer... will post soon ...


was8bit 2021-03-21 11:04

Ok, i had to NOT use sprites...

I changed BG 1 into a double wide cell, which is tricky to use but now makes it behave as 2x2 cells... i can explain more :)

But this version works :) you will have to use BG 0 for TEXT, PRINT, or NUMBER, and BG 1 will be restricted to only showing the game pieces ...

Flipit2.nx | Open in app
2021-03-21 11:04

MeNTeN 2021-03-21 13:59

thanks!
It's very nice and beautiful.
:)


MeNTeN 2021-03-21 14:07 (Edited)

by the way, I want show game board behind pieces. what should I do? Should I use BG0?


was8bit 2021-03-21 14:57 (Edited)

Glad to help... :)

About the background....

You only have 2 BG layers... so you have 2 options...

1) do not use any text or numbers

2) tile your background as 4x4 sized sprites, and set things up so these sprites are seen behind everything (this option lets you still use numbers and text on the top layer BG 0)


was8bit 2021-03-21 15:02 (Edited)

A 3rd option would be.... to manually draw the gameboard into each game piece, and to each blank unplayed spaces, and then to the unused edges....

This might be the best option if your gameboard will be very simple... currently the green is just the default color, but if all you want is a plain color with drawn lines, i could easily show you how to do that :)

Flipit2 Demo.nx | Open in app
2021-03-21 15:18

WhyCanInotThinkOfAName? 2021-03-21 16:15 (Edited)

is this an implementation of the game reversi? btw, it looks really cool!


was8bit 2021-03-21 16:21

The little demo can be repurposed into a game.... the gamepiece design and idea is MeNTeN's , i simply demo'd a few programming ideas....


was8bit 2021-03-21 16:25

Oh yea, i guessed thats what they wanted :)


WhyCanInotThinkOfAName? 2021-03-21 16:26

ok!


MeNTeN 2021-03-21 21:35

thanks very much! That never crossed my mind at all.
yes,exactly.I'm trying to make game reversi.
I will make it.


was8bit 2021-03-22 06:22 (Edited)

Cool :)

If should be a rather simple to create a sub that checks each direction for changes on each placement..

AI for a computer player may take some carefull research though when considering levels of stategy to apply...

i would recommend starting with a random placement for the computer so you can spend your time making the game playable just the way you want it... you can always add a smarter computer player anytime :)


MeNTeN 2021-03-23 06:32

why it is not working correctly?
please tell me how to.

Flipit2 Demo.nx | Open in app
2021-03-23 06:32

was8bit 2021-03-23 10:04

Could you please clarify what won't work? :)


qwaffe 2021-03-23 11:00

Maybe it's the diagonal "flipping"


was8bit 2021-03-23 11:47

@MeNTeN,

I used your approach, but reworked the math by adding a direction array which simplifies everything :)

See what you think... i have tested it and i "think" there are no errors...

Othello 0.1.nx | Open in app
2021-03-23 11:47

was8bit 2021-03-23 11:51 (Edited)

Rather than approach it only as x,y, i used the idea of angle and length, then used that to calculate x,y ;)


MeNTeN 2021-03-23 13:52

Thanks,was8bit! It's fantastic! and thank you for your advice,qwaffle.
I understood the program, but I can't think of it.how do you come up with such amazing program?


was8bit 2021-03-23 17:07 (Edited)

Glad to help :)


I have had the same problems when moving things around, if things move in an irratic direction it looks unnatural... but using the angle approach, if a thing changed direction rightward you simply increment the angle, leftward yoi decrement the angle.. then the movement looks natural...

It also reduces having to write seperate code for each direction.... simplifying the code immensely... so using this concept here made sense too :)


was8bit 2021-03-23 17:12

If you are using sprites, and want very smooth movement, you use actual angles and trigonometry to calculate things, but my little system is simplier and can be used for many things, like for here :)

DIM GLOBAL XDIR(7),YDIR(7)
FOR I=0 TO 7
READ XDIR(I),YDIR(I)
NEXT I
DATA 0,-1,1,-1,1,0,1,1,0,1,-1,1,-1,0,-1,-1
REM UP=0, RIGHT=2, DOWN=4, LEFT=6


Log in to reply.